Fork me on GitHub

Changeset 9343566 in git


Ignore:
Timestamp:
Jun 26, 2015, 3:26:49 PM (9 years ago)
Author:
Keith Pedersen <kpeders1@…>
Parents:
9458a020 (diff), e33e6db (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge e33e6db9f2e9a918cef92de353fdda0fb9615bab into 9458a02015da8213ffbf8bace1be5a1a8f300dbc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/Calorimeter.cc

    r9458a020 r9343566  
    517517  if(energy > 0.0)
    518518  {
    519     if(fTowerPhotonHits > 0 && fTowerTrackHits == 0)
    520     {
    521       fPhotonOutputArray->Add(fTower);
    522     }
    523 
    524     fTowerOutputArray->Add(fTower);
    525   }
    526 
    527   // fill energy flow candidates
    528 
    529   // save all the tracks as energy flow tracks
    530   fItTowerTrackArray->Reset();
    531   while((track = static_cast<Candidate*>(fItTowerTrackArray->Next())))
    532   {
    533     fEFlowTrackOutputArray->Add(track);
    534   }
    535 
    536   ecalEnergy -= fTrackECalEnergy;
    537   hcalEnergy -= fTrackHCalEnergy;
    538 
    539   ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy);
    540   hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, hcalEnergy);
    541 
    542   if(ecalEnergy < fECalEnergyMin || ecalEnergy < fECalEnergySignificanceMin*ecalSigma) ecalEnergy = 0.0;
    543   if(hcalEnergy < fHCalEnergyMin || hcalEnergy < fHCalEnergySignificanceMin*hcalSigma) hcalEnergy = 0.0;
    544 
    545   energy = ecalEnergy + hcalEnergy;
    546 
    547   if(ecalEnergy > 0.0)
    548   {
    549     // create new photon tower
    550     tower = static_cast<Candidate*>(fTower->Clone());
    551 
    552     pt = ecalEnergy / TMath::CosH(eta);
    553 
    554     tower->Momentum.SetPtEtaPhiE(pt, eta, phi, ecalEnergy);
    555     tower->Eem = ecalEnergy;
    556     tower->Ehad = 0.0;
    557 
    558     fEFlowPhotonOutputArray->Add(tower);
    559   }
    560   if(hcalEnergy > 0.0)
    561   {
    562     // create new neutral hadron tower
    563     tower = static_cast<Candidate*>(fTower->Clone());
    564 
    565     pt = hcalEnergy / TMath::CosH(eta);
    566 
    567     tower->Momentum.SetPtEtaPhiE(pt, eta, phi, hcalEnergy);
    568     tower->Eem = 0.0;
    569     tower->Ehad = hcalEnergy;
    570 
    571     fEFlowNeutralHadronOutputArray->Add(tower);
     519     bool isCalPhoton = false;
     520
     521     if(fTowerTrackHits == 0)
     522     {
     523        // We have a CalPhoton when there are NOT tracks and there ARE photon hits
     524        isCalPhoton = (fTowerPhotonHits > 0);
     525     }
     526     else
     527     {
     528         // save all the tracks as energy flow tracks
     529         fItTowerTrackArray->Reset();
     530         while((track = static_cast<Candidate*>(fItTowerTrackArray->Next())))
     531         {
     532            fEFlowTrackOutputArray->Add(track);
     533         }
     534
     535         ecalEnergy -= fTrackECalEnergy;
     536         hcalEnergy -= fTrackHCalEnergy;
     537
     538         ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy);
     539         hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, hcalEnergy);
     540
     541         if(ecalEnergy < fECalEnergyMin || ecalEnergy < fECalEnergySignificanceMin*ecalSigma) ecalEnergy = 0.0;
     542         if(hcalEnergy < fHCalEnergyMin || hcalEnergy < fHCalEnergySignificanceMin*hcalSigma) hcalEnergy = 0.0;
     543
     544         energy = ecalEnergy + hcalEnergy;
     545     }
     546
     547     // If it's NOT a CalPhoton; add the tower as a whole entity.
     548     // Otherwise, the tower will be split into its ECAL and HCAL components,
     549     // then added to fPhotonArray and fTowerArray (respectively).
     550     // By construction (no track hits), no track subtraction will occur
     551     // for CalPhotons
     552     if(!isCalPhoton)
     553        fTowerOutputArray->Add(fTower);
     554
     555     // fill energy flow candidates
     556
     557     if(ecalEnergy > 0.0)
     558     {
     559         // create new photon tower
     560         tower = static_cast<Candidate*>(fTower->Clone());
     561
     562         pt = ecalEnergy / TMath::CosH(eta);
     563
     564         tower->Momentum.SetPtEtaPhiE(pt, eta, phi, ecalEnergy);
     565         tower->Eem = ecalEnergy;
     566         tower->Ehad = 0.0;
     567
     568         fEFlowPhotonOutputArray->Add(tower);
     569         if(isCalPhoton)
     570                      fPhotonOutputArray->Add(tower);
     571     }
     572
     573     if(hcalEnergy > 0.0)
     574     {
     575        // create new neutral hadron tower
     576        tower = static_cast<Candidate*>(fTower->Clone());
     577
     578        pt = hcalEnergy / TMath::CosH(eta);
     579
     580        tower->Momentum.SetPtEtaPhiE(pt, eta, phi, hcalEnergy);
     581        tower->Eem = 0.0;
     582        tower->Ehad = hcalEnergy;
     583
     584        fEFlowNeutralHadronOutputArray->Add(tower);
     585        if(isCalPhoton)
     586           fTowerOutputArray->Add(tower);
     587     }
    572588  }
    573589}
Note: See TracChangeset for help on using the changeset viewer.