Changeset 4609 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 08/13/04 14:59:17 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/readraw.C
r948 r4609 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 24 24 25 25 26 void readraw( )26 void readraw(const char *fname="/data/MAGIC/Period016/mcdata/spot_1cm/standard/gamma/Gamma_zbin9_90_7_1740to1749_w0.root") 27 27 { 28 28 // 29 29 // open the file 30 30 // 31 TFile input( "test.root", "READ");31 TFile input(fname, "READ"); 32 32 33 33 // … … 46 46 // 47 47 MRawRunHeader *runheader = new MRawRunHeader(); 48 runtree->GetBranch("MRawRunHeader ")->SetAddress(&runheader);48 runtree->GetBranch("MRawRunHeader.")->SetAddress(&runheader); 49 49 runtree->GetEvent(0); 50 50 runheader->Print(); … … 53 53 // open the Data Tree 54 54 // 55 TTree *evttree = (TTree*) input.Get(" Data");55 TTree *evttree = (TTree*) input.Get("Events"); 56 56 57 57 // 58 58 // create the instances of the data to read in 59 59 // 60 MRawEvtHeader *evtheader = new MRawEvtHeader();61 MTime *evttime = new MTime();62 MRawEvtData *evtdata = new MRawEvtData();63 MRawCrateArray *evtcrate = new MRawCrateArray();60 MRawEvtHeader *evtheader = 0; 61 MTime *evttime = 0; 62 MRawEvtData *evtdata = 0; 63 MRawCrateArray *evtcrate = 0; 64 64 65 65 // 66 66 // enable the corresponding branches 67 67 // 68 evttree->GetBranch("MRawEvtHeader")->SetAddress(&evtheader); 69 evttree->GetBranch("MTime")->SetAddress(&evttime); 70 evttree->GetBranch("MRawEvtData")->SetAddress(&evtdata); 71 evttree->GetBranch("MRawCrateArray")->SetAddress(&evtcrate); 68 evttree->GetBranch("MRawEvtHeader.")->SetAddress(&evtheader); 69 evttree->GetBranch("MRawEvtData.")->SetAddress(&evtdata); 70 71 // Use this for real data only 72 //evttree->GetBranch("MTime.")->SetAddress(&evttime); 73 //evttree->GetBranch("MRawCrateArray.")->SetAddress(&evtcrate); 72 74 73 75 // … … 83 85 84 86 evtheader->Print(); 85 evttime->Print();86 evtcrate->Print();87 87 evtdata->Print(); 88 89 // Use this for real data only 90 //evttime->Print(); 91 //evtcrate->Print(); 88 92 } 89 93 }
Note:
See TracChangeset
for help on using the changeset viewer.