Logo coherent WaveBurst  
Library Reference Guide
Logo
TestTObjectMeyer.C
Go to the documentation of this file.
1 {
2  //
3  // Write & Read Meyer object to/from root file
4  // Author : Gabriele Vedovato
5 
6 
7  Meyer<double> S(512,2);
8  cout << "S level " << S.getLevel() << endl;
9 
10  TFile *froot = new TFile("test.root", "RECREATE");
11  if(froot==NULL) {
12  cout << "Failed to create file !!! " << endl;
13  gSystem->Exit(1);
14  }
15  S.Write("S");
16  froot->Close();
17 
18  TFile *f = new TFile("test.root");
19  if(f==NULL) {
20  cout << "Failed to open file test.root !!! " << endl;
21  gSystem->Exit(1);
22  }
23 
24  f->ls();
25 
26  Meyer<double>* S2 = (Meyer<double>*)f->Get("S");
27  if(S2==NULL) {
28  cout << "Object S not exist !!! " << endl;
29  gSystem->Exit(1);
30  }
31  cout << "S2 level " << S2->getLevel() << endl;
32  f->Close();
33 
34  exit(0);
35 }
virtual int getLevel()
Definition: Wavelet.hh:88
TFile * f
Meyer< double > * S2
TFile * froot
Definition: Meyer.hh:36
Meyer< double > S(1024, 2)
exit(0)