Changeset 2250 for trunk/MagicSoft/Mars/mhistmc
- Timestamp:
- 06/27/03 17:29:49 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhistmc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc
r2173 r2250 237 237 // flag 238 238 // 239 void MHMcCollectionArea::CalcEfficiency (UInt_t numevts, Float_t emin, Float_t emax, Float_t index)239 void MHMcCollectionArea::CalcEfficiency2() 240 240 { 241 241 // Here we estimate the total number of showers in each energy bin … … 244 244 245 245 TH1D &histsel = *fHistSel->ProjectionX(); 246 247 TH1D histall; 246 TH1D &histall = *fHistAll->ProjectionX(); 248 247 249 248 TAxis &xaxis = *histsel.GetXaxis(); 250 251 MH::SetBinning(&histall, &xaxis);252 249 MH::SetBinning(fHistCol, &xaxis); 253 254 const Float_t expo = 1+index;255 256 const Float_t k = (Float_t)numevts / (pow(emax,expo) - pow(emin,expo));257 258 250 const Int_t nbinx = xaxis.GetNbins(); 259 260 for (Int_t i=1; i<=nbinx; i++)261 {262 const Float_t e1 = histall.GetBinLowEdge(i);263 const Float_t e2 = histall.GetBinLowEdge(i+1);264 265 if (e1 < emin || e2 > emax)266 continue;267 268 const Float_t events = k * (pow(e2, expo) - pow(e1, expo));269 270 histall.SetBinContent(i, events);271 histall.SetBinError(i, sqrt(events));272 273 }274 251 275 252 // ----------------------------------------------------------- … … 282 259 283 260 *fLog << warn << endl << dbginf << "WARNING! I will assume a maximum impact parameter of 300 meters for the MC events. Check that this is the true one!" <<endl<<endl; 284 const Float_t area = TMath::Pi() * (r2*r2 - r1*r1);261 const Float_t total_area = TMath::Pi() * (r2*r2 - r1*r1); 285 262 286 263 for (Int_t ix=1; ix<=nbinx; ix++) … … 303 280 304 281 const Double_t efferr = sqrt((1.-eff)*Ns)/Na; 305 306 fHistCol->SetBinContent(ix, eff*area); 307 fHistCol->SetBinError(ix, efferr*area); 282 283 const Float_t col_area = eff * total_area; 284 const Float_t col_area_error = efferr * total_area; 285 286 fHistCol->SetBinContent(ix, col_area); 287 fHistCol->SetBinError(ix, col_area_error); 308 288 } 309 289 -
trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h
r2036 r2250 35 35 const TH1D *GetHist() const { return fHistCol; } 36 36 37 TH2D *GetHistAll() { return fHistAll; } 38 37 39 void Draw(Option_t *option=""); 38 40 39 41 void CalcEfficiency(); 40 void CalcEfficiency (UInt_t allevts, Float_t emin, Float_t emax, Float_t index);42 void CalcEfficiency2(); 41 43 42 44 void Calc(const MHMcEnergyImpact &mcsel, const MHMcEnergyImpact &mcall);
Note:
See TracChangeset
for help on using the changeset viewer.