Fork me on GitHub

Changeset e2dd4c5 in git


Ignore:
Timestamp:
Oct 7, 2015, 6:02:09 PM (9 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
00e8dca
Parents:
c4b2aae
Message:

new attempt to fix eflow for high pt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/Calorimeter.cc

    rc4b2aae re2dd4c5  
    422422void Calorimeter::FinalizeTower()
    423423{
    424   Candidate *track, *tower;
     424  Candidate *track, *tower, *mother;
    425425  Double_t energy, pt, eta, phi;
    426426  Double_t ecalEnergy, hcalEnergy;
     
    428428  Double_t ecalTrkSigma, hcalTrkSigma;
    429429  Double_t ecalFraction, hcalFraction;
    430  
     430
    431431  Int_t pdgCode;
    432432  TLorentzVector momentum;
    433433  TFractionMap::iterator itFractionMap;
    434  
     434
    435435  Float_t weight, sumWeightedTime, sumWeight;
    436436
    437437  if(!fTower) return;
    438438
    439  
     439
    440440  ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerECalEnergy);
    441441  hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerHCalEnergy);
     
    509509  // fill energy flow candidates
    510510
    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      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 HCAL
    530      
    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      else if(ecalFraction < 1.0E-9 && hcalFraction > 1.0E-9 )
    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;
    554554
    555555  ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy);
Note: See TracChangeset for help on using the changeset viewer.