Changeset e2dd4c5 in git for modules/Calorimeter.cc
- Timestamp:
- Oct 7, 2015, 6:02:09 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 00e8dca
- Parents:
- c4b2aae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/Calorimeter.cc
rc4b2aae re2dd4c5 422 422 void Calorimeter::FinalizeTower() 423 423 { 424 Candidate *track, *tower ;424 Candidate *track, *tower, *mother; 425 425 Double_t energy, pt, eta, phi; 426 426 Double_t ecalEnergy, hcalEnergy; … … 428 428 Double_t ecalTrkSigma, hcalTrkSigma; 429 429 Double_t ecalFraction, hcalFraction; 430 430 431 431 Int_t pdgCode; 432 432 TLorentzVector momentum; 433 433 TFractionMap::iterator itFractionMap; 434 434 435 435 Float_t weight, sumWeightedTime, sumWeight; 436 436 437 437 if(!fTower) return; 438 438 439 439 440 440 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerECalEnergy); 441 441 hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerHCalEnergy); … … 509 509 // fill energy flow candidates 510 510 511 // save as eflowtracks only tracks that have better resolution than calo 512 513 514 515 516 momentum = track->Momentum;517 518 pdgCode = TMath::Abs(track->PID);519 520 itFractionMap = fFractionMap.find(pdgCode);521 if(itFractionMap == fFractionMap.end())522 {523 itFractionMap = fFractionMap.find(0); 524 }525 526 ecalFraction = itFractionMap->second.first; 527 hcalFraction = itFractionMap->second.second;528 529 // charged particle has to deposit either in ECAL or HCAL530 531 if(ecalFraction > 1.0E-9 && hcalFraction < 1.0E-9 ) 532 {533 ecalTrkSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, momentum.E());534 if(track->TrackResolution < ecalTrkSigma/momentum.E())535 {536 ecalEnergy -= momentum.E();537 fEFlowTrackOutputArray->Add(track);538 }539 540 541 542 hcalTrkSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, momentum.E());543 if(track->TrackResolution < hcalTrkSigma/momentum.E())544 545 hcalEnergy -= momentum.E();546 fEFlowTrackOutputArray->Add(track);547 548 } 549 else if(pdgCode == 13)550 {551 fEFlowTrackOutputArray->Add(track); 552 }553 }511 // save as eflowtracks only tracks that have better resolution than calo 512 513 fItTowerTrackArray->Reset(); 514 while((track = static_cast<Candidate*>(fItTowerTrackArray->Next()))) 515 { 516 pdgCode = TMath::Abs(track->PID); 517 518 itFractionMap = fFractionMap.find(pdgCode); 519 if(itFractionMap == fFractionMap.end()) 520 { 521 itFractionMap = fFractionMap.find(0); 522 } 523 524 ecalFraction = itFractionMap->second.first; 525 hcalFraction = itFractionMap->second.second; 526 527 mother = track; 528 track = static_cast<Candidate*>(track->Clone()); 529 track->AddCandidate(mother); 530 momentum = track->Momentum; 531 532 if(ecalFraction > 1.0E-9 && hcalFraction < 1.0E-9 ) 533 { 534 ecalTrkSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, momentum.E()); 535 if(ecalTrkSigma/momentum.E() < track->TrackResolution) 536 { 537 momentum *= ecalEnergy/fTrackECalEnergy; 538 } 539 } 540 else if(ecalFraction < 1.0E-9 && hcalFraction > 1.0E-9 ) 541 { 542 hcalTrkSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, momentum.E()); 543 if(hcalTrkSigma/momentum.E() < track->TrackResolution) 544 { 545 momentum *= hcalEnergy/fTrackHCalEnergy; 546 } 547 } 548 549 fEFlowTrackOutputArray->Add(track); 550 } 551 552 ecalEnergy -= fTrackECalEnergy; 553 hcalEnergy -= fTrackHCalEnergy; 554 554 555 555 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy);
Note:
See TracChangeset
for help on using the changeset viewer.