Changeset e33e6db in git for modules/Calorimeter.cc
- Timestamp:
- May 22, 2015, 10:59:20 PM (9 years ago)
- Children:
- 9343566
- Parents:
- e8070b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/Calorimeter.cc
re8070b6 re33e6db 481 481 if(energy > 0.0) 482 482 { 483 if(fTowerPhotonHits > 0 && fTowerTrackHits == 0) 484 { 485 fPhotonOutputArray->Add(fTower); 486 } 487 488 fTowerOutputArray->Add(fTower); 489 } 490 491 // fill energy flow candidates 492 493 // save all the tracks as energy flow tracks 494 fItTowerTrackArray->Reset(); 495 while((track = static_cast<Candidate*>(fItTowerTrackArray->Next()))) 496 { 497 fEFlowTrackOutputArray->Add(track); 498 } 499 500 ecalEnergy -= fTrackECalEnergy; 501 hcalEnergy -= fTrackHCalEnergy; 502 503 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy); 504 hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, hcalEnergy); 505 506 if(ecalEnergy < fECalEnergyMin || ecalEnergy < fECalEnergySignificanceMin*ecalSigma) ecalEnergy = 0.0; 507 if(hcalEnergy < fHCalEnergyMin || hcalEnergy < fHCalEnergySignificanceMin*hcalSigma) hcalEnergy = 0.0; 508 509 energy = ecalEnergy + hcalEnergy; 510 511 if(ecalEnergy > 0.0) 512 { 513 // create new photon tower 514 tower = static_cast<Candidate*>(fTower->Clone()); 515 516 pt = ecalEnergy / TMath::CosH(eta); 517 518 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, ecalEnergy); 519 tower->Eem = ecalEnergy; 520 tower->Ehad = 0.0; 521 522 fEFlowPhotonOutputArray->Add(tower); 523 } 524 if(hcalEnergy > 0.0) 525 { 526 // create new neutral hadron tower 527 tower = static_cast<Candidate*>(fTower->Clone()); 528 529 pt = hcalEnergy / TMath::CosH(eta); 530 531 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, hcalEnergy); 532 tower->Eem = 0.0; 533 tower->Ehad = hcalEnergy; 534 535 fEFlowNeutralHadronOutputArray->Add(tower); 483 bool isCalPhoton = false; 484 485 if(fTowerTrackHits == 0) 486 { 487 // We have a CalPhoton when there are NOT tracks and there ARE photon hits 488 isCalPhoton = (fTowerPhotonHits > 0); 489 } 490 else 491 { 492 // save all the tracks as energy flow tracks 493 fItTowerTrackArray->Reset(); 494 while((track = static_cast<Candidate*>(fItTowerTrackArray->Next()))) 495 { 496 fEFlowTrackOutputArray->Add(track); 497 } 498 499 ecalEnergy -= fTrackECalEnergy; 500 hcalEnergy -= fTrackHCalEnergy; 501 502 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy); 503 hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, hcalEnergy); 504 505 if(ecalEnergy < fECalEnergyMin || ecalEnergy < fECalEnergySignificanceMin*ecalSigma) ecalEnergy = 0.0; 506 if(hcalEnergy < fHCalEnergyMin || hcalEnergy < fHCalEnergySignificanceMin*hcalSigma) hcalEnergy = 0.0; 507 508 energy = ecalEnergy + hcalEnergy; 509 } 510 511 // If it's NOT a CalPhoton; add the tower as a whole entity. 512 // Otherwise, the tower will be split into its ECAL and HCAL components, 513 // then added to fPhotonArray and fTowerArray (respectively). 514 // By construction (no track hits), no track subtraction will occur 515 // for CalPhotons 516 if(!isCalPhoton) 517 fTowerOutputArray->Add(fTower); 518 519 // fill energy flow candidates 520 521 if(ecalEnergy > 0.0) 522 { 523 // create new photon tower 524 tower = static_cast<Candidate*>(fTower->Clone()); 525 526 pt = ecalEnergy / TMath::CosH(eta); 527 528 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, ecalEnergy); 529 tower->Eem = ecalEnergy; 530 tower->Ehad = 0.0; 531 532 fEFlowPhotonOutputArray->Add(tower); 533 if(isCalPhoton) 534 fPhotonOutputArray->Add(tower); 535 } 536 537 if(hcalEnergy > 0.0) 538 { 539 // create new neutral hadron tower 540 tower = static_cast<Candidate*>(fTower->Clone()); 541 542 pt = hcalEnergy / TMath::CosH(eta); 543 544 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, hcalEnergy); 545 tower->Eem = 0.0; 546 tower->Ehad = hcalEnergy; 547 548 fEFlowNeutralHadronOutputArray->Add(tower); 549 if(isCalPhoton) 550 fTowerOutputArray->Add(tower); 551 } 536 552 } 537 553 }
Note:
See TracChangeset
for help on using the changeset viewer.