Changeset 988 for trunk/MagicSoft/Mars/macros/threshold.C
- Timestamp:
- 10/24/01 15:12:21 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/threshold.C
r971 r988 24 24 25 25 26 void threshold(char* filename="data/ CrabNebula_dnsb_09_loop.root")26 void threshold(char* filename="data/camera.root") 27 27 { 28 28 // … … 30 30 // MMcThresholdCalc and shows the results. 31 31 // 32 MParList 32 MParList parlist; 33 33 34 34 MTaskList tasklist; … … 43 43 // taking only the trigger information from MMcTrig 44 44 // 45 const UInt_t numtriggerconditions = 4; 45 const UInt_t numtrigcond = 0; 46 47 UInt_t from = numtrigcond>0 ? 1 : -numtrigcond; 48 UInt_t to = numtrigcond>0 ? numtrigcond : -numtrigcond; 49 50 Int_t dim = to-from+1; 46 51 47 52 // … … 49 54 // and store the histograms in an TObjArray 50 55 // 51 TObjArray *hists = new TObjArray(MParList::CreateObjList("MHMcEnergy", numtriggerconditions)); 56 TObjArray hists(MParList::CreateObjList("MHMcEnergy", from, to)); 57 hists.SetOwner(); 52 58 53 59 // 54 60 // Check if the list really contains the right number of histograms 55 61 // 56 if (hists ->GetEntriesFast() != numtriggerconditions)62 if (hists.GetEntriesFast() != dim) 57 63 return; 58 64 … … 60 66 // Add the histograms to the paramater list. 61 67 // 62 parlist.AddToList( hists);68 parlist.AddToList(&hists); 63 69 64 70 // … … 71 77 // like one dimension MMcThresholdCalc 72 78 // 73 MReadTree read("Events;7", filename); 74 MMcThresholdCalc calc(numtriggerconditions); 79 MReadTree read("Events", filename); 80 read.UseLeaf("fEnergy"); 81 read.UseLeaf("fNumFirstLevel"); 82 83 MMcThresholdCalc calc(numtrigcond); 75 84 76 85 tasklist.AddToList(&read); … … 90 99 // Now you can display the results 91 100 // 92 for (UInt_t i=0; i<numtriggerconditions; i++) 93 ((*hists)[i])->Draw(); 101 TIter Next(&hists); 102 TObject *obj; 103 while ((obj=Next())) 104 obj->DrawClone(); 94 105 }
Note:
See TracChangeset
for help on using the changeset viewer.