Changeset 855 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 07/05/01 13:23:12 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/macros
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/getThreshold.C
r851 r855 1 void getThreshold( char* filename = " /hdb1/users/jlopez/temp_loop.root")1 void getThreshold( char* filename = "data/oscar_protons.root") 2 2 { 3 // 3 4 // This macro fill the container MMcEnerThre using the task 4 5 // MMcEnerThreCalc and shows the results. 6 // 7 MParList parlist; 5 8 6 MParList parlist;7 9 MTaskList tasklist; 10 parlist.AddToList(&tasklist); 8 11 12 // 9 13 // Setup the parameter list 10 14 // - You need create the container MMcEnerThre. 11 15 // + You need to put the number of trigger conditions when 12 // you declarete the M McEnerThre13 // + If you don't put any dimension to M McEnerThreit works16 // you declarete the MHMcEnergies 17 // + If you don't put any dimension to MHMcEnergies it works 14 18 // taking only the trigger information from MMcTrig 15 // - You can control the number of bins in the energy distribution 16 // histogram used to compute the energy threshold using 17 // the SetBins() function. 19 // 20 const UInt_t numtriggerconditions = 1; 18 21 19 Int_t numtrigcond = 5; 20 MHMcEnergies *hists = new MHMcEnergies(numtrigcond); 21 22 parlist.AddToList(&tasklist); 22 MHMcEnergies *hists = new MHMcEnergies(numtriggerconditions); 23 23 hists->AddEntriesToList(&parlist); 24 24 25 // 25 26 // Setup the task list 26 // - You need the read and the MMcEnerThreCalc tasks 27 // - You need the read and the MMcThresholdCalc tasks 28 // - You have to fill the histograms for the Energy threshold 27 29 // + You need to put the number of trigger conditions when 28 // you declarete the MMcEnerThreCalc 29 // + If you don't put any dimension to MMcEnerThreCalc it works 30 // like one dimension MMcEnerThreCalc 31 32 MReadTree read("Events", filename); 33 34 MMcThresholdCalc tcalc(numtrigcond); 30 // you declarete the MMcThresholdCalc 31 // + If you don't put any dimension to MMcThresholdCalc it works 32 // like one dimension MMcThresholdCalc 33 // 34 MReadTree read("Events", filename); 35 MMcThresholdCalc calc(numtriggerconditions); 35 36 36 37 tasklist.AddToList(&read); 37 tasklist.AddToList(& tcalc);38 tasklist.AddToList(&calc); 38 39 39 40 MEvtLoop evtloop; 40 41 evtloop.SetParList(&parlist); 41 42 43 // 42 44 // Begin the loop 43 45 // 44 46 evtloop.Eventloop(); 45 47 48 // 46 49 // Now you can display the results 47 48 TCanvas *c; 49 50 c=new TCanvas("c0","Energy distribution for triggered events", 50, 50, 850, 550); 51 hists[0].Print(); 52 hists[0].Draw(); 53 c->Update(); 54 55 c= new TCanvas("c1","Energy distribution for triggered events", 50, 50, 850, 550); 56 hists[1].Print(); 57 hists[1].Draw(); 58 c->Update(); 59 60 c= new TCanvas("c2","Energy distribution for triggered events", 50, 50, 850, 550); 61 hists[2].Print(); 62 hists[2].Draw(); 63 c->Update(); 64 65 c= new TCanvas("c3","Energy distribution for triggered events", 50, 50, 850, 550); 66 hists[3].Print(); 67 hists[3].Draw(); 68 c->Update(); 69 70 c= new TCanvas("c4","Energy distribution for triggered events", 50, 50, 850, 550); 71 hists[4].Print(); 72 hists[4].Draw(); 73 c->Update(); 50 // 51 for (UInt_t i=0; i<numtriggerconditions; i++) 52 ((*hists)[i]).Draw(); 74 53 } -
trunk/MagicSoft/Mars/macros/readMagic.C
r706 r855 31 31 MCerPhotEvt &phevt = *(MCerPhotEvt*)plist->FindObject("MCerPhotEvt"); 32 32 33 Int_t icount = 0 ;34 33 MCamDisplay display(&geomcam) ; 35 34 36 35 while (read.Process()) 37 36 { 38 cout << "Event : " << icount++ << endl;37 cout << "Event #" << read.GetEventNum() ":" << endl; 39 38 40 39 ncalc.Process();
Note:
See TracChangeset
for help on using the changeset viewer.