Changeset 1379 for trunk/MagicSoft/Mars
- Timestamp:
- 07/05/02 14:03:31 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1377 r1379 1 1 -*-*- END -*-*- 2 2002/07/04: Abelardo Moralejo 3 4 * macros/trigrate.C: 5 - Introduced some style improvements suggested by T. Bretz. 6 2 7 2002/07/04: Abelardo Moralejo 3 8 -
trunk/MagicSoft/Mars/macros/trigrate.C
r1376 r1379 29 29 ! 30 30 \* ======================================================================== */ 31 32 31 33 32 void trigrate(int dim=0, char *filename = "data/camera.root", … … 101 100 // Now we have to build the BgR array, containing the number 102 101 // of triggers (may be more than 1 trigger/event!) from the 103 // total_nsb_events simulated in the nsbfile (3rd input parameter).102 // numnsbevents simulated in the nsbfile (3rd input parameter). 104 103 // If no nsbfile is supplied, we assume no triggers from NSB 105 104 106 Float_t total_nsb_events = 5.e4; // some default value.105 Float_t numnsbevents = 5.e4; // some default value. 107 106 108 107 Float_t* BgR = new float[num]; … … 110 109 BgR[i] = 0.; 111 110 112 // Float_t* BgR = new float[36];113 // for(Int_t i = 0; i < 36; i++)114 // BgR[i] = 0.;115 116 111 if (nsbfile) 117 112 { 118 nsb_events = new TChain("Events");119 nsb_events ->Add(nsbfile);113 TChain nsb_events("Events"); 114 nsb_events.Add(nsbfile); 120 115 121 // nsb_events = new TFile(nsbfile); 122 // nsb_events->cd(); 116 TH1F h("h","",5,.5,5.5); 123 117 124 h = new TH1F("h","",5,.5,5.5);125 126 Char_t plot[256];127 118 for (Int_t i = from; i <= to; i++) 128 119 { 129 // For each trigger condition (i)... 130 // histogram Number of L1 triggers: 131 sprintf(plot, "MMcTrig;%d.fNumFirstLevel>>h", i); 132 nsb_events->Draw(plot,"", "goff"); 120 TString plot = "MMcTrig;"; 121 plot+=i; 122 plot+=".fNumFirstLevel>>h"; 123 124 nsb_events.Draw(plot,"", "goff"); 133 125 // Get total number of L1 triggers from histogram: 134 if (dim > 0) 135 BgR[i-1] = h->Integral()*h->GetMean(); 136 else 137 BgR[0] = h->Integral()*h->GetMean(); 126 BgR[dim>0? i-1: 0] = h.Integral()*h.GetMean(); 138 127 139 total_nsb_events = (Float_t) h->GetEntries();128 numnsbevents = (Float_t) h.GetEntries(); 140 129 } 141 h->Delete();142 nsb_events->Delete();143 // nsb_headers = new TChain("RunHeaders");144 // nsb_headers->Add(nsbfile);145 130 } 146 131 147 132 cout << "Number of Trigger conditions: " << num << endl; 148 133 149 MMcTriggerRateCalc rate(dim, kPROTON, BgR, total_nsb_events);134 MMcTriggerRateCalc rate(dim, kPROTON, BgR, numnsbevents); 150 135 tasklist.AddToList(&rate); 151 136
Note:
See TracChangeset
for help on using the changeset viewer.