Skip to content

Commit

Permalink
code checks
Browse files Browse the repository at this point in the history
  • Loading branch information
swagata87 committed Aug 27, 2021
1 parent b3b60bf commit 1942ef7
Showing 1 changed file with 37 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class EgammaHLTHcalVarProducerFromRecHit : public edm::global::EDProducer<> {
const edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> hcalSevLvlComputerToken_;
const edm::ESGetToken<CaloTowerConstituentsMap, CaloGeometryRecord> caloTowerConstituentsMapToken_;
const edm::EDPutTokenT<reco::RecoEcalCandidateIsolationMap> putToken_;

};

EgammaHLTHcalVarProducerFromRecHit::EgammaHLTHcalVarProducerFromRecHit(const edm::ParameterSet &config)
Expand Down Expand Up @@ -141,9 +140,8 @@ void EgammaHLTHcalVarProducerFromRecHit::fillDescriptions(edm::ConfigurationDesc
}

void EgammaHLTHcalVarProducerFromRecHit::produce(edm::StreamID,
edm::Event &iEvent,
const edm::EventSetup &iSetup) const {

edm::Event &iEvent,
const edm::EventSetup &iSetup) const {
auto recoEcalCandHandle = iEvent.getHandle(recoEcalCandidateProducer_);

double rho = 0.0;
Expand All @@ -164,62 +162,55 @@ void EgammaHLTHcalVarProducerFromRecHit::produce(edm::StreamID,
float isol = 0;
EgammaHcalIsolation::InclusionRule external;
EgammaHcalIsolation::InclusionRule internal;

if (!useSingleTower_) { //useSingleTower_=False means H/E is cone-based
external=EgammaHcalIsolation::InclusionRule::withinConeAroundCluster;
internal=EgammaHcalIsolation::InclusionRule::withinConeAroundCluster;
}

if (useSingleTower_ && !doEtSum_) { //this is single tower based H/E
external=EgammaHcalIsolation::InclusionRule::isBehindClusterSeed;
internal=EgammaHcalIsolation::InclusionRule::withinConeAroundCluster;
if (!useSingleTower_) { //useSingleTower_=False means H/E is cone-based
external = EgammaHcalIsolation::InclusionRule::withinConeAroundCluster;
internal = EgammaHcalIsolation::InclusionRule::withinConeAroundCluster;
}

if (useSingleTower_ && doEtSum_) { //this is cone-based HCAL isolation with single tower based footprint removal
external=EgammaHcalIsolation::InclusionRule::withinConeAroundCluster;
internal=EgammaHcalIsolation::InclusionRule::isBehindClusterSeed;
if (useSingleTower_ && !doEtSum_) { //this is single tower based H/E
external = EgammaHcalIsolation::InclusionRule::isBehindClusterSeed;
internal = EgammaHcalIsolation::InclusionRule::withinConeAroundCluster;
}

if (useSingleTower_ && doEtSum_) { //this is cone-based HCAL isolation with single tower based footprint removal
external = EgammaHcalIsolation::InclusionRule::withinConeAroundCluster;
internal = EgammaHcalIsolation::InclusionRule::isBehindClusterSeed;
}

EgammaHcalIsolation thisHcalVar_ = EgammaHcalIsolation(external,
outerCone_,
internal,
innerCone_,
eThresHB_,
etThresHB_,
maxSeverityHB_,
eThresHE_,
etThresHE_,
maxSeverityHE_,
iEvent.get(hbheRecHitsTag_),
iSetup.getData(caloGeometryToken_),
iSetup.getData(hcalTopologyToken_),
iSetup.getData(hcalChannelQualityToken_),
iSetup.getData(hcalSevLvlComputerToken_),
iSetup.getData(caloTowerConstituentsMapToken_)
);


if (!useSingleTower_) { //useSingleTower_=False means H/E is cone-based.
if (doEtSum_) { //hcal iso
isol = thisHcalVar_.getHcalEtSum(recoEcalCandRef.get(),depth_); //depth=0 means all depths
}
else if (!doEtSum_) { // doEtSum_=False means sum up energy, this is for H/E
isol = thisHcalVar_.getHcalESum(recoEcalCandRef.get(),depth_); //depth=0 means all depths
outerCone_,
internal,
innerCone_,
eThresHB_,
etThresHB_,
maxSeverityHB_,
eThresHE_,
etThresHE_,
maxSeverityHE_,
iEvent.get(hbheRecHitsTag_),
iSetup.getData(caloGeometryToken_),
iSetup.getData(hcalTopologyToken_),
iSetup.getData(hcalChannelQualityToken_),
iSetup.getData(hcalSevLvlComputerToken_),
iSetup.getData(caloTowerConstituentsMapToken_));

if (!useSingleTower_) { //useSingleTower_=False means H/E is cone-based.
if (doEtSum_) { //hcal iso
isol = thisHcalVar_.getHcalEtSum(recoEcalCandRef.get(), depth_); //depth=0 means all depths
} else if (!doEtSum_) { // doEtSum_=False means sum up energy, this is for H/E
isol = thisHcalVar_.getHcalESum(recoEcalCandRef.get(), depth_); //depth=0 means all depths
}
}


if (useSingleTower_) {
if (doEtSum_) { //this is cone-based HCAL isolation with single tower based footprint removal
isol = thisHcalVar_.getHcalEtSumBc(recoEcalCandRef.get(),depth_); //depth=0 means all depths
}
else if (!doEtSum_) { //this is single tower based H/E
isol = thisHcalVar_.getHcalESumBc(recoEcalCandRef.get(),depth_); //depth=0 means all depths
if (doEtSum_) { //this is cone-based HCAL isolation with single tower based footprint removal
isol = thisHcalVar_.getHcalEtSumBc(recoEcalCandRef.get(), depth_); //depth=0 means all depths
} else if (!doEtSum_) { //this is single tower based H/E
isol = thisHcalVar_.getHcalESumBc(recoEcalCandRef.get(), depth_); //depth=0 means all depths
}
}


if (doRhoCorrection_) {
int iEA = -1;
auto scEta = std::abs(recoEcalCandRef->superCluster()->eta());
Expand Down

0 comments on commit 1942ef7

Please sign in to comment.