Fork me on GitHub

Changeset de2e39d in git for modules


Ignore:
Timestamp:
Jun 11, 2020, 6:07:17 PM (4 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
master
Children:
6c6efd1
Parents:
5c716fa
Message:

fixed energy threshold param bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/DualReadoutCalorimeter.cc

    r5c716fa rde2e39d  
    172172  fECalEnergyMin = GetDouble("ECalEnergyMin", 0.0);
    173173  fHCalEnergyMin = GetDouble("HCalEnergyMin", 0.0);
     174  fEnergyMin = GetDouble("EnergyMin", 0.0);
    174175
    175176  fECalEnergySignificanceMin = GetDouble("ECalEnergySignificanceMin", 0.0);
    176177  fHCalEnergySignificanceMin = GetDouble("HCalEnergySignificanceMin", 0.0);
     178  fEnergySignificanceMin = GetDouble("EnergySignificanceMin", 0.0);
    177179
    178180  // switch on or off the dithering of the center of DualReadoutCalorimeter towers
     
    631633  //cout<<"trackEnergy: "<<fTrackEnergy<<", trackSigma: "<<fTrackSigma<<", Ntracks: "<<fTowerTrackArray->GetEntries()<<endl;
    632634
    633   //cout<<"neutralEnergy: "<<neutralEnergy<<", neutralSigma: "<<neutralSigma<<endl;
     635  //cout<<"neutralEnergy: "<<neutralEnergy<<", neutralSigma: "<<neutralSigma<<", :fEnergyMin "<<fEnergyMin<<", fEnergySignificanceMin: "<<fEnergySignificanceMin<<endl;
    634636
    635637   // For now, if neutral excess is significant, simply create neutral EflowPhoton tower and clone each track into eflowtrack !!! -> Creating only photons !! EFlowNeutralHadron collection will be empy!!! TO BE FIXED
     
    647649    tower->PID = 22;
    648650
     651   
     652
    649653    fEFlowPhotonOutputArray->Add(tower);
    650654
     
    688692 
    689693
    690   /*
    691   // fill energy flow candidates
    692   fECalTrackSigma = TMath::Sqrt(fECalTrackSigma);
    693   fHCalTrackSigma = TMath::Sqrt(fHCalTrackSigma);
    694 
    695   //compute neutral excesses
    696   ecalNeutralEnergy = max( (ecalEnergy - fECalTrackEnergy) , 0.0);
    697   hcalNeutralEnergy = max( (hcalEnergy - fHCalTrackEnergy) , 0.0);
    698  
    699   ecalNeutralSigma = ecalNeutralEnergy / TMath::Sqrt(fECalTrackSigma*fECalTrackSigma + ecalSigma*ecalSigma);
    700   hcalNeutralSigma = hcalNeutralEnergy / TMath::Sqrt(fHCalTrackSigma*fHCalTrackSigma + hcalSigma*hcalSigma);
    701  
    702    // if ecal neutral excess is significant, simply create neutral EflowPhoton tower and clone each track into eflowtrack
    703   if(ecalNeutralEnergy > fECalEnergyMin && ecalNeutralSigma > fECalEnergySignificanceMin)
    704   {
    705     // create new photon tower
    706     tower = static_cast<Candidate*>(fTower->Clone());
    707     pt =  ecalNeutralEnergy / TMath::CosH(eta);
    708    
    709     tower->Momentum.SetPtEtaPhiE(pt, eta, phi, ecalNeutralEnergy);
    710     tower->Eem = ecalNeutralEnergy;
    711     tower->Ehad = 0.0;
    712     tower->PID = 22;
    713    
    714     fEFlowPhotonOutputArray->Add(tower);
    715    
    716     //clone tracks
    717     fItECalTowerTrackArray->Reset();
    718     while((track = static_cast<Candidate*>(fItECalTowerTrackArray->Next())))
    719     {
    720       mother = track;
    721       track = static_cast<Candidate*>(track->Clone());
    722       track->AddCandidate(mother);
    723 
    724       fEFlowTrackOutputArray->Add(track);
    725     }
    726  
    727   }
    728  
    729   // if neutral excess is not significant, rescale eflow tracks, such that the total charged equals the best measurement given by the DualReadoutCalorimeter and tracking
    730   else if(fECalTrackEnergy > 0.0)
    731   {
    732     weightTrack = (fECalTrackSigma > 0.0) ? 1 / (fECalTrackSigma*fECalTrackSigma) : 0.0;
    733     weightCalo  = (ecalSigma > 0.0) ? 1 / (ecalSigma*ecalSigma) : 0.0;
    734  
    735     bestEnergyEstimate = (weightTrack*fECalTrackEnergy + weightCalo*ecalEnergy) / (weightTrack + weightCalo);
    736     rescaleFactor = bestEnergyEstimate/fECalTrackEnergy;
    737 
    738     //rescale tracks
    739     fItECalTowerTrackArray->Reset();
    740     while((track = static_cast<Candidate*>(fItECalTowerTrackArray->Next())))
    741     { 
    742       mother = track;
    743       track = static_cast<Candidate*>(track->Clone());
    744       track->AddCandidate(mother);
    745 
    746       track->Momentum *= rescaleFactor;
    747 
    748       fEFlowTrackOutputArray->Add(track);
    749     }
    750   }
    751 
    752 
    753   // if hcal neutral excess is significant, simply create neutral EflowNeutralHadron tower and clone each track into eflowtrack
    754   if(hcalNeutralEnergy > fHCalEnergyMin && hcalNeutralSigma > fHCalEnergySignificanceMin)
    755   {
    756     // create new photon tower
    757     tower = static_cast<Candidate*>(fTower->Clone());
    758     pt =  hcalNeutralEnergy / TMath::CosH(eta);
    759    
    760     tower->Momentum.SetPtEtaPhiE(pt, eta, phi, hcalNeutralEnergy);
    761     tower->Ehad = hcalNeutralEnergy;
    762     tower->Eem = 0.0;
    763    
    764     fEFlowNeutralHadronOutputArray->Add(tower);
    765    
    766     //clone tracks
    767     fItHCalTowerTrackArray->Reset();
    768     while((track = static_cast<Candidate*>(fItHCalTowerTrackArray->Next())))
    769     {
    770       mother = track;
    771       track = static_cast<Candidate*>(track->Clone());
    772       track->AddCandidate(mother);
    773 
    774       fEFlowTrackOutputArray->Add(track);
    775     }
    776  
    777   }
    778  
    779   // if neutral excess is not significant, rescale eflow tracks, such that the total charged equals the best measurement given by the DualReadoutCalorimeter and tracking
    780   else if(fHCalTrackEnergy > 0.0)
    781   {
    782     weightTrack = (fHCalTrackSigma > 0.0) ? 1 / (fHCalTrackSigma*fHCalTrackSigma) : 0.0;
    783     weightCalo  = (hcalSigma > 0.0) ? 1 / (hcalSigma*hcalSigma) : 0.0;
    784  
    785     bestEnergyEstimate = (weightTrack*fHCalTrackEnergy + weightCalo*hcalEnergy) / (weightTrack + weightCalo);
    786     rescaleFactor = bestEnergyEstimate / fHCalTrackEnergy;
    787 
    788     //rescale tracks
    789     fItHCalTowerTrackArray->Reset();
    790     while((track = static_cast<Candidate*>(fItHCalTowerTrackArray->Next())))
    791     { 
    792       mother = track;
    793       track = static_cast<Candidate*>(track->Clone());
    794       track->AddCandidate(mother);
    795 
    796       track->Momentum *= rescaleFactor;
    797 
    798       fEFlowTrackOutputArray->Add(track);
    799     }
    800   }
    801 
    802   */
    803694}
    804695
Note: See TracChangeset for help on using the changeset viewer.