Changeset 2036 for trunk/MagicSoft/Mars/mhistmc
- Timestamp:
- 04/29/03 09:18:03 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhistmc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc
r2015 r2036 40 40 #include "MHMcEnergyImpact.h" 41 41 42 #include "MLog.h" 43 #include "MLogManip.h" 44 42 45 ClassImp(MHMcCollectionArea); 43 46 … … 223 226 // flag 224 227 // 225 void MHMcCollectionArea::CalcEfficiency(UInt_t numevts, Float_t angle)228 void MHMcCollectionArea::CalcEfficiency(UInt_t numevts, Float_t emin, Float_t emax, Float_t index) 226 229 { 227 230 // Here we estimate the total number of showers in each energy bin … … 238 241 MH::SetBinning(fHistCol, &xaxis); 239 242 240 // TO BE FIXED! In forthcoming camera versions emin, emax and index 241 // will be available in a run header, and should be read from it. 242 243 const Float_t emin = 10.; 244 const Float_t emax = 30000.; // Energies in GeV. 245 const Float_t index = 2.6; // Differential spectral Index. 246 247 const Float_t expo = 1.-index; 243 const Float_t expo = 1+index; 248 244 249 245 const Float_t k = (Float_t)numevts / (pow(emax,expo) - pow(emin,expo)); … … 267 263 268 264 // ----------------------------------------------------------- 269 270 // Impact parameter range: 265 // 266 // Impact parameter range: TO BE FIXED! Impact parameter shoud be 267 // read from run header, but it is not yet in!! 268 // 271 269 const Float_t r1 = 0; 272 const Float_t r2 = 400; 273 274 const Float_t dr = TMath::Pi() * (r2*r2 - r1*r1); 275 276 angle *= TMath::Pi()/180; 270 const Float_t r2 = 300; 271 272 *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; 273 const Float_t area = TMath::Pi() * (r2*r2 - r1*r1); 277 274 278 275 for (Int_t ix=1; ix<=nbinx; ix++) … … 294 291 const Double_t eff = Ns/Na; 295 292 296 const Double_t err = sqrt((1.-eff)*Ns)/Na; 297 298 const Float_t area = dr * cos(angle); 293 const Double_t efferr = sqrt((1.-eff)*Ns)/Na; 299 294 300 295 fHistCol->SetBinContent(ix, eff*area); 301 fHistCol->SetBinError(ix, e rr*area);296 fHistCol->SetBinError(ix, efferr*area); 302 297 } 303 298 … … 340 335 341 336 const Double_t eff = h.GetCellContent(ix, iy); 342 const Double_t e rr = h.GetCellError(ix, iy);337 const Double_t efferr = h.GetCellError(ix, iy); 343 338 344 339 colA += eff*A; 345 errA += A*A * e rr*err;340 errA += A*A * efferr*efferr; 346 341 } 347 342 -
trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h
r2015 r2036 38 38 39 39 void CalcEfficiency(); 40 void CalcEfficiency(UInt_t allevts, Float_t theta);40 void CalcEfficiency(UInt_t allevts, Float_t emin, Float_t emax, Float_t index); 41 41 42 42 void Calc(const MHMcEnergyImpact &mcsel, const MHMcEnergyImpact &mcall);
Note:
See TracChangeset
for help on using the changeset viewer.