Changeset 39022b6 in git for modules/Calorimeter.cc
- Timestamp:
- Jun 25, 2013, 2:43:27 PM (11 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- be42bf4
- Parents:
- 6085382
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/Calorimeter.cc
r6085382 r39022b6 155 155 fEFlowTrackOutputArray = ExportArray(GetString("EFlowTrackOutputArray", "eflowTracks")); 156 156 fEFlowTowerOutputArray = ExportArray(GetString("EFlowTowerOutputArray", "eflowTowers")); 157 158 159 157 160 } 158 161 … … 373 376 Double_t energy, pt, eta, phi; 374 377 Double_t ecalEnergy, hcalEnergy; 375 378 Double_t sE,mE,sH,mH,SE=0,ME=0,SH=0,MH=0; 379 376 380 if(!fTower) return; 377 381 378 ecalEnergy = gRandom->Gaus(fTowerECalEnergy, fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerECalEnergy)); 382 // cout<<"new tower -----------------------"<<endl; 383 384 385 sE = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerECalEnergy); 386 mE = fTowerECalEnergy; 387 388 sH = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerHCalEnergy); 389 mH = fTowerHCalEnergy; 390 391 // cout<<sE<<","<<mE<<endl; 392 // cout<<sH<<","<<mH<<endl; 393 // cout<<"---"<<endl; 394 395 if(mE>0)SE = TMath::Sqrt(TMath::Log((1+(sE*sE)/(mE*mE)))); 396 if(mE>0)ME = TMath::Log(mE)-0.5*SE*SE; 397 398 if(mH>0)SH = TMath::Sqrt(TMath::Log((1+(sH*sH)/(mH*mH)))); 399 if(mH>0)MH = TMath::Log(mH)-0.5*SH*SH; 400 401 // cout<<SE<<","<<ME<<endl; 402 // cout<<SH<<","<<MH<<endl; 403 // cout<<"---"<<endl; 404 405 // ecalEnergy = gRandom->Gaus(fTowerECalEnergy, fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerECalEnergy)); 406 ecalEnergy = (ME != 0.0 ? Draw_lognormal(ME,SE) : 0.0); 407 // cout<<ecalEnergy<<endl; 408 379 409 if(ecalEnergy < 0.0) ecalEnergy = 0.0; 380 410 381 hcalEnergy = gRandom->Gaus(fTowerHCalEnergy, fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerHCalEnergy)); 411 hcalEnergy = (MH != 0.0 ? Draw_lognormal(MH,SH) : 0.0); 412 //hcalEnergy = gRandom->Gaus(fTowerHCalEnergy, fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerHCalEnergy)); 382 413 if(hcalEnergy < 0.0) hcalEnergy = 0.0; 383 414 415 // cout<<hcalEnergy<<endl; 416 384 417 energy = ecalEnergy + hcalEnergy; 385 418 386 387 419 // eta = fTowerEta; 420 // phi = fTowerPhi; 388 421 389 422 eta = gRandom->Uniform(fTowerEdges[0], fTowerEdges[1]); … … 468 501 469 502 //------------------------------------------------------------------------------ 503 504 Double_t Calorimeter::Draw_lognormal(Double_t mu, Double_t sigma) 505 { 506 Double_t g = gRandom->Gaus(0, 1); 507 return TMath::Exp(mu + sigma * g); 508 }
Note:
See TracChangeset
for help on using the changeset viewer.