Changeset 988 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 10/24/01 15:12:21 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/macros
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/collarea.C
r971 r988 34 34 MTaskList tasklist; 35 35 36 //37 // Setup the parameter list.38 // - we need to create MCollArea only. The other containers39 // are created automatically without loss - we don't have to40 // access them-41 // - MCollArea must be created by us because we need the pointer42 // to it and if it would get created automatically it would also be43 // deleted automatically44 //45 36 parlist.AddToList(&tasklist); 46 47 MHMcCollectionArea *collArea = new MHMcCollectionArea;48 parlist.AddToList(collArea);49 37 50 38 // … … 64 52 MTask task; 65 53 tasklist.AddToList(&task); 66 67 54 68 55 // … … 84 71 // filled and can be displayd 85 72 // 86 collArea->Draw();73 parlist.FindObject("MHMcCollectionArea")->DrawClone(); 87 74 } -
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 } -
trunk/MagicSoft/Mars/macros/trigrate.C
r984 r988 109 109 return; 110 110 111 TIter Next(&hists); 112 MHMcRate *r=NULL; 113 while ((r=(MHMcRate*)Next())) 114 r->Print(); 111 hists.Print(); 115 112 }
Note:
See TracChangeset
for help on using the changeset viewer.