![]() |
![]() |
#include <EgammaRecHitIsolation.h>
Public Member Functions | |
void | doFlagChecks (const std::vector< int > v) |
void | doSpikeRemoval (const EcalRecHitCollection *const recHits, const EcalChannelStatus *const chStatus, const int &severityLevelCut=3, const float &sevRecHitThresh=5.0, const EcalSeverityLevelAlgo::SpikeId &id=EcalSeverityLevelAlgo::kSwissCross, const float &spIdThresh=0.95) |
EgammaRecHitIsolation (double extRadius, double intRadius, double etaSlice, double etLow, double eLow, edm::ESHandle< CaloGeometry >, CaloRecHitMetaCollectionV *, DetId::Detector detector) | |
double | getEnergySum (const reco::Candidate *emObject) const |
double | getEtSum (const reco::Candidate *emObject) const |
void | setUseNumCrystals (bool b=true) |
void | setVetoClustered (bool b=true) |
~EgammaRecHitIsolation () | |
Private Member Functions | |
double | getSum_ (const reco::Candidate *, bool returnEt) const |
Private Attributes | |
CaloRecHitMetaCollectionV * | caloHits_ |
const EcalChannelStatus * | chStatus_ |
const EcalRecHitCollection * | ecalBarHits_ |
double | eLow_ |
double | etaSlice_ |
double | etLow_ |
double | extRadius_ |
double | intRadius_ |
int | severityLevelCut_ |
float | severityRecHitThreshold_ |
EcalSeverityLevelAlgo::SpikeId | spId_ |
float | spIdThreshold_ |
const CaloSubdetectorGeometry * | subdet_ [2] |
edm::ESHandle< CaloGeometry > | theCaloGeom_ |
bool | useNumCrystals_ |
std::vector< int > | v_chstatus_ |
bool | vetoClustered_ |
Definition at line 26 of file EgammaRecHitIsolation.h.
EgammaRecHitIsolation::EgammaRecHitIsolation | ( | double | extRadius, |
double | intRadius, | ||
double | etaSlice, | ||
double | etLow, | ||
double | eLow, | ||
edm::ESHandle< CaloGeometry > | theCaloGeom, | ||
CaloRecHitMetaCollectionV * | caloHits, | ||
DetId::Detector | detector | ||
) |
Definition at line 32 of file EgammaRecHitIsolation.cc.
References DetId::Ecal, EcalBarrel, EcalEndcap, CaloGeometry::getSubdetectorGeometry(), edm::ESHandle< T >::product(), subdet_, and theCaloGeom_.
: // not used anymore, kept for compatibility extRadius_(extRadius), intRadius_(intRadius), etaSlice_(etaSlice), etLow_(etLow), eLow_(eLow), theCaloGeom_(theCaloGeom) , caloHits_(caloHits), useNumCrystals_(false), vetoClustered_(false), ecalBarHits_(0), chStatus_(0), severityLevelCut_(-1), severityRecHitThreshold_(0), spId_(EcalSeverityLevelAlgo::kSwissCross), spIdThreshold_(0), v_chstatus_(0) { //set up the geometry and selector const CaloGeometry* caloGeom = theCaloGeom_.product(); subdet_[0] = caloGeom->getSubdetectorGeometry(DetId::Ecal,EcalBarrel); subdet_[1] = caloGeom->getSubdetectorGeometry(DetId::Ecal,EcalEndcap); }
EgammaRecHitIsolation::~EgammaRecHitIsolation | ( | ) |
Definition at line 63 of file EgammaRecHitIsolation.cc.
{ }
void EgammaRecHitIsolation::doFlagChecks | ( | const std::vector< int > | v | ) | [inline] |
Definition at line 57 of file EgammaRecHitIsolation.h.
References python::multivaluedict::sort(), and v_chstatus_.
Referenced by GsfElectronAlgo::beginEvent().
{ v_chstatus_.clear(); v_chstatus_.insert(v_chstatus_.begin(),v.begin(),v.end()); std::sort( v_chstatus_.begin(), v_chstatus_.end() ); }
void EgammaRecHitIsolation::doSpikeRemoval | ( | const EcalRecHitCollection *const | recHits, |
const EcalChannelStatus *const | chStatus, | ||
const int & | severityLevelCut = 3 , |
||
const float & | sevRecHitThresh = 5.0 , |
||
const EcalSeverityLevelAlgo::SpikeId & | id = EcalSeverityLevelAlgo::kSwissCross , |
||
const float & | spIdThresh = 0.95 |
||
) | [inline] |
Definition at line 43 of file EgammaRecHitIsolation.h.
References chStatus_, ecalBarHits_, ExpressReco_HICollisions_FallBack::id, ExpressReco_HICollisions_FallBack::severityLevelCut, severityLevelCut_, severityRecHitThreshold_, spId_, and spIdThreshold_.
Referenced by GsfElectronAlgo::beginEvent(), and PhotonIsolationCalculator::calculateEcalRecHitIso().
{ ecalBarHits_ = recHits; chStatus_ = chStatus; severityLevelCut_ = severityLevelCut; severityRecHitThreshold_ = sevRecHitThresh; spId_ = id; spIdThreshold_ = spIdThresh; }
double EgammaRecHitIsolation::getEnergySum | ( | const reco::Candidate * | emObject | ) | const [inline] |
Definition at line 40 of file EgammaRecHitIsolation.h.
References getSum_().
Referenced by EgammaHLTEcalRecIsolationProducer::produce(), and EgammaEcalRecHitIsolationProducer::produce().
{ return getSum_(emObject,false);}
double EgammaRecHitIsolation::getEtSum | ( | const reco::Candidate * | emObject | ) | const [inline] |
Definition at line 39 of file EgammaRecHitIsolation.h.
References getSum_().
Referenced by PhotonIsolationCalculator::calculateEcalRecHitIso(), GsfElectronAlgo::createElectron(), egHLT::OffHelper::fillIsolData(), EgammaHLTEcalRecIsolationProducer::produce(), and EgammaEcalRecHitIsolationProducer::produce().
{return getSum_(emObject,true);}
double EgammaRecHitIsolation::getSum_ | ( | const reco::Candidate * | emObject, |
bool | returnEt | ||
) | const [private] |
Definition at line 67 of file EgammaRecHitIsolation.cc.
References caloHits_, chStatus_, Geom::deltaPhi(), ecalBarHits_, eLow_, CaloRecHitMetaCollectionV::end(), relval_parameters_module::energy, CastorDataFrameFilter_impl::energySum(), ExpressReco_HICollisions_FallBack::et, eta(), PV3DBase< T, PVType, FrameType >::eta(), etaSlice_, etLow_, extRadius_, CaloRecHitMetaCollectionV::find(), spr::find(), reco::Candidate::get(), edm::Ref< C, T, F >::get(), CaloSubdetectorGeometry::getCells(), i, intRadius_, j, PV3DBase< T, PVType, FrameType >::mag(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phi, position, edm::ESHandle< T >::product(), EcalSeverityLevelAlgo::severityLevel(), severityLevelCut_, severityRecHitThreshold_, spId_, spIdThreshold_, mathSSE::sqrt(), subdet_, theCaloGeom_, useNumCrystals_, v_chstatus_, and vetoClustered_.
Referenced by getEnergySum(), and getEtSum().
{ double energySum = 0.; if (caloHits_){ //Take the SC position reco::SuperClusterRef sc = emObject->get<reco::SuperClusterRef>(); math::XYZPoint theCaloPosition = sc.get()->position(); GlobalPoint pclu (theCaloPosition.x () , theCaloPosition.y () , theCaloPosition.z () ); double etaclus = pclu.eta(); double phiclus = pclu.phi(); double r2 = intRadius_*intRadius_; std::vector< std::pair<DetId, float> >::const_iterator rhIt; for(int subdetnr=0; subdetnr<=1 ; subdetnr++){ // look in barrel and endcap CaloSubdetectorGeometry::DetIdSet chosen = subdet_[subdetnr]->getCells(pclu,extRadius_);// select cells around cluster CaloRecHitMetaCollectionV::const_iterator j=caloHits_->end(); for (CaloSubdetectorGeometry::DetIdSet::const_iterator i = chosen.begin ();i!= chosen.end ();++i){//loop selected cells j=caloHits_->find(*i); // find selected cell among rechits if( j!=caloHits_->end()){ // add rechit only if available const GlobalPoint & position = theCaloGeom_.product()->getPosition(*i); double eta = position.eta(); double phi = position.phi(); double etaDiff = eta - etaclus; double phiDiff= reco::deltaPhi(phi,phiclus); double energy = j->energy(); if(useNumCrystals_) { if( fabs(etaclus) < 1.479 ) { // Barrel num crystals, crystal width = 0.0174 if ( fabs(etaDiff) < 0.0174*etaSlice_) continue; if ( sqrt(etaDiff*etaDiff + phiDiff*phiDiff) < 0.0174*intRadius_) continue; } else { // Endcap num crystals, crystal width = 0.00864*fabs(sinh(eta)) if ( fabs(etaDiff) < 0.00864*fabs(sinh(eta))*etaSlice_) continue; if ( sqrt(etaDiff*etaDiff + phiDiff*phiDiff) < 0.00864*fabs(sinh(eta))*intRadius_) continue; } } else { if ( fabs(etaDiff) < etaSlice_) continue; // jurassic strip cut if ( etaDiff*etaDiff + phiDiff*phiDiff < r2) continue; // jurassic exclusion cone cut } //Check if RecHit is in SC if(vetoClustered_) { //Loop over basic clusters: bool isClustered = false; for(reco::CaloCluster_iterator bcIt = sc->clustersBegin();bcIt != sc->clustersEnd(); ++bcIt) { for(rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) { if( rhIt->first == *i ) isClustered = true; if( isClustered ) break; } if( isClustered ) break; } //end loop over basic clusters if(isClustered) continue; } //end if removeClustered //Severity level check if( severityLevelCut_!=-1 && ecalBarHits_ && //make sure we have a barrel rechit EcalSeverityLevelAlgo::severityLevel( //call the severity level method EBDetId(j->detid()), //passing the EBDetId *ecalBarHits_, //the rechit collection in order to calculate the swiss crss *chStatus_, //and the EcalChannelRecHitRcd severityRecHitThreshold_, //only consider rechits with ET > spId_, //the SpikeId method (currently kE1OverE9 or kSwissCross) spIdThreshold_ //cut value for above ) >= severityLevelCut_) continue; //then if the severity level is too high, we continue to the next rechit //Check based on flags to protect from recovered channels from non-read towers //Assumption is that v_chstatus_ is empty unless doFlagChecks() has been called std::vector<int>::const_iterator vit = std::find( v_chstatus_.begin(), v_chstatus_.end(), ((EcalRecHit*)(&*j))->recoFlag() ); if ( vit != v_chstatus_.end() ) continue; // the recHit has to be excluded from the iso sum double et = energy*position.perp()/position.mag(); if ( fabs(et) > etLow_ && fabs(energy) > eLow_){ //Changed energy --> fabs(energy) if(returnEt) energySum+=et; else energySum+=energy; } } //End if not end of list } //End loop over rechits } //End loop over barrel/endcap } //End if caloHits_ return energySum; }
void EgammaRecHitIsolation::setUseNumCrystals | ( | bool | b = true | ) | [inline] |
Definition at line 41 of file EgammaRecHitIsolation.h.
References b, and useNumCrystals_.
Referenced by GsfElectronAlgo::beginEvent(), PhotonIsolationCalculator::calculateEcalRecHitIso(), EgammaHLTEcalRecIsolationProducer::produce(), and EgammaEcalRecHitIsolationProducer::produce().
{ useNumCrystals_ = b; }
void EgammaRecHitIsolation::setVetoClustered | ( | bool | b = true | ) | [inline] |
Definition at line 42 of file EgammaRecHitIsolation.h.
References b, and vetoClustered_.
Referenced by GsfElectronAlgo::beginEvent(), PhotonIsolationCalculator::calculateEcalRecHitIso(), and EgammaEcalRecHitIsolationProducer::produce().
{ vetoClustered_ = b; }
Definition at line 77 of file EgammaRecHitIsolation.h.
Referenced by getSum_().
const EcalChannelStatus* EgammaRecHitIsolation::chStatus_ [private] |
Definition at line 82 of file EgammaRecHitIsolation.h.
Referenced by doSpikeRemoval(), and getSum_().
const EcalRecHitCollection* EgammaRecHitIsolation::ecalBarHits_ [private] |
Definition at line 81 of file EgammaRecHitIsolation.h.
Referenced by doSpikeRemoval(), and getSum_().
double EgammaRecHitIsolation::eLow_ [private] |
Definition at line 73 of file EgammaRecHitIsolation.h.
Referenced by getSum_().
double EgammaRecHitIsolation::etaSlice_ [private] |
Definition at line 71 of file EgammaRecHitIsolation.h.
Referenced by getSum_().
double EgammaRecHitIsolation::etLow_ [private] |
Definition at line 72 of file EgammaRecHitIsolation.h.
Referenced by getSum_().
double EgammaRecHitIsolation::extRadius_ [private] |
Definition at line 69 of file EgammaRecHitIsolation.h.
Referenced by getSum_().
double EgammaRecHitIsolation::intRadius_ [private] |
Definition at line 70 of file EgammaRecHitIsolation.h.
Referenced by getSum_().
int EgammaRecHitIsolation::severityLevelCut_ [private] |
Definition at line 83 of file EgammaRecHitIsolation.h.
Referenced by doSpikeRemoval(), and getSum_().
float EgammaRecHitIsolation::severityRecHitThreshold_ [private] |
Definition at line 84 of file EgammaRecHitIsolation.h.
Referenced by doSpikeRemoval(), and getSum_().
Definition at line 85 of file EgammaRecHitIsolation.h.
Referenced by doSpikeRemoval(), and getSum_().
float EgammaRecHitIsolation::spIdThreshold_ [private] |
Definition at line 86 of file EgammaRecHitIsolation.h.
Referenced by doSpikeRemoval(), and getSum_().
const CaloSubdetectorGeometry* EgammaRecHitIsolation::subdet_[2] [private] |
Definition at line 90 of file EgammaRecHitIsolation.h.
Referenced by EgammaRecHitIsolation(), and getSum_().
Definition at line 76 of file EgammaRecHitIsolation.h.
Referenced by EgammaRecHitIsolation(), and getSum_().
bool EgammaRecHitIsolation::useNumCrystals_ [private] |
Definition at line 79 of file EgammaRecHitIsolation.h.
Referenced by getSum_(), and setUseNumCrystals().
std::vector<int> EgammaRecHitIsolation::v_chstatus_ [private] |
Definition at line 87 of file EgammaRecHitIsolation.h.
Referenced by doFlagChecks(), and getSum_().
bool EgammaRecHitIsolation::vetoClustered_ [private] |
Definition at line 80 of file EgammaRecHitIsolation.h.
Referenced by getSum_(), and setVetoClustered().