|
![CMS Logo](/cmsdoxygen/common/rightImage.jpg) |
#include <PhotonProducer.h>
|
void | fillPhotonCollection (edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::PhotonCoreCollection > &photonCoreHandle, const CaloTopology *topology, const EcalRecHitCollection *ecalBarrelHits, const EcalRecHitCollection *ecalEndcapHits, CaloTowerCollection const &hcalTowers, reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC, const EcalSeverityLevelAlgo *sevLv) |
|
- Author
- Nancy Marinelli, U. of Notre Dame, US
Definition at line 35 of file PhotonProducer.h.
◆ PhotonProducer()
Definition at line 33 of file PhotonProducer.cc.
56 const std::vector<std::string> flagnamesEB =
57 config.getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEB");
59 const std::vector<std::string> flagnamesEE =
60 config.getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEE");
62 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
64 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
66 const std::vector<std::string> severitynamesEB =
67 config.getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEB");
69 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
71 const std::vector<std::string> severitynamesEE =
72 config.getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEE");
74 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
References barrelEcalHits_, candidateP4type_, endcapEcalHits_, flagsexclEB_, flagsexclEE_, hcalTowers_, highEt_, hOverEConeSize_, gedPhotons_cfi::isolationSumsCalculatorSet, minR9Barrel_, minR9Endcap_, gedPhotons_cfi::mipVariableSet, PhotonCollection_, photonCoreProducer_, photonIsolationCalculator_, photonMIPHaloTagger_, MonitorAlCaEcalPi0_cfi::posCalcParameters, posCalculator_, preselCutValuesBarrel_, preselCutValuesEndcap_, runMIPTagger_, PhotonIsolationCalculator::setup(), PhotonMIPHaloTagger::setup(), severitiesexclEB_, severitiesexclEE_, AlCaHLTBitMon_QueryRunRegistry::string, usePrimaryVertex_, and vertexProducer_.
◆ fillPhotonCollection()
void PhotonProducer::fillPhotonCollection |
( |
edm::Event & |
evt, |
|
|
edm::EventSetup const & |
es, |
|
|
const edm::Handle< reco::PhotonCoreCollection > & |
photonCoreHandle, |
|
|
const CaloTopology * |
topology, |
|
|
const EcalRecHitCollection * |
ecalBarrelHits, |
|
|
const EcalRecHitCollection * |
ecalEndcapHits, |
|
|
CaloTowerCollection const & |
hcalTowers, |
|
|
reco::VertexCollection & |
pvVertices, |
|
|
reco::PhotonCollection & |
outputCollection, |
|
|
int & |
iSC, |
|
|
const EcalSeverityLevelAlgo * |
sevLv |
|
) |
| |
|
private |
fill shower shape block
fill full5x5 shower shape block
get ecal photon specific corrected energy plus values from regressions and store them in the Photon
Pre-selection loose isolation cuts
Definition at line 213 of file PhotonProducer.cc.
232 std::vector<double> preselCutValues;
237 std::vector<int> flags_, severitiesexcl_;
239 for (
unsigned int lSC = 0; lSC < photonCoreHandle->size(); lSC++) {
244 int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
250 hits = ecalBarrelHits;
256 hits = ecalEndcapHits;
260 edm::LogWarning(
"") <<
"PhotonProducer: do not know if it is a barrel or endcap SuperCluster";
266 if (scRef->energy() / cosh(scRef->eta()) <= preselCutValues[0])
272 double HoE1 = towerIso1.getTowerESum(&(*scRef)) / scRef->energy();
273 double HoE2 = towerIso2.getTowerESum(&(*scRef)) / scRef->energy();
290 float e2x5 = EcalClusterTools::e2x5Max(*(scRef->seed()), &(*
hits), &(*topology));
291 float e3x3 = EcalClusterTools::e3x3(*(scRef->seed()), &(*
hits), &(*topology));
292 float e5x5 = EcalClusterTools::e5x5(*(scRef->seed()), &(*
hits), &(*topology));
293 std::vector<float> cov = EcalClusterTools::covariances(*(scRef->seed()), &(*
hits), &(*topology),
geometry);
294 std::vector<float> locCov = EcalClusterTools::localCovariances(*(scRef->seed()), &(*
hits), &(*topology));
297 float sigmaIetaIeta =
sqrt(locCov[0]);
298 float r9 = e3x3 / (scRef->rawEnergy());
307 std::vector<float> full5x5_cov =
309 std::vector<float> full5x5_locCov =
312 float full5x5_sigmaEtaEta =
sqrt(full5x5_cov[0]);
318 caloPosition = unconvPos;
320 caloPosition = scRef->position();
340 newCandidate.setFiducialVolumeFlags(fiducialFlags);
341 newCandidate.setIsolationVariables(isolVarR04, isolVarR03);
347 showerShape.
e3x3 = e3x3;
348 showerShape.
e5x5 = e5x5;
357 newCandidate.setShowerShapeVariables(showerShape);
361 full5x5_showerShape.
e1x5 = full5x5_e1x5;
362 full5x5_showerShape.
e2x5 = full5x5_e2x5;
363 full5x5_showerShape.
e3x3 = full5x5_e3x3;
364 full5x5_showerShape.
e5x5 = full5x5_e5x5;
366 full5x5_showerShape.
sigmaEtaEta = full5x5_sigmaEtaEta;
368 newCandidate.full5x5_setShowerShapeVariables(full5x5_showerShape);
386 newCandidate.setMIPVariables(mipVar);
390 bool isLooseEM =
true;
391 if (newCandidate.pt() <
highEt_) {
392 if (newCandidate.hadronicOverEm() >= preselCutValues[1])
394 if (newCandidate.ecalRecHitSumEtConeDR04() > preselCutValues[2] + preselCutValues[3] * newCandidate.pt())
396 if (newCandidate.hcalTowerSumEtConeDR04() > preselCutValues[4] + preselCutValues[5] * newCandidate.pt())
398 if (newCandidate.nTrkSolidConeDR04() >
int(preselCutValues[6]))
400 if (newCandidate.nTrkHollowConeDR04() >
int(preselCutValues[7]))
402 if (newCandidate.trkSumPtSolidConeDR04() > preselCutValues[8])
404 if (newCandidate.trkSumPtHollowConeDR04() > preselCutValues[9])
406 if (newCandidate.sigmaIetaIeta() > preselCutValues[10])
References PhotonIsolationCalculator::calculate(), PhotonEnergyCorrector::calculate(), PositionCalc::Calculate_Location(), candidateP4type_, EcalClusterToolsT< noZS >::covariances(), egamma::depth1HcalESum(), egamma::depth2HcalESum(), EgHLTOffHistBins_cfi::e1x5, EcalClusterToolsT< noZS >::e1x5(), reco::Photon::ShowerShape::e1x5, EgHLTOffHistBins_cfi::e2x5, reco::Photon::ShowerShape::e2x5, EcalClusterToolsT< noZS >::e2x5Max(), EcalClusterToolsT< noZS >::e3x3(), reco::Photon::ShowerShape::e3x3, EcalClusterToolsT< noZS >::e5x5(), reco::Photon::ShowerShape::e5x5, DetId::Ecal, reco::Photon::ecal_photons, EcalBarrel, EcalEndcap, EcalPreshower, cosmicPhotonAnalyzer_cfi::eMax, EcalClusterToolsT< noZS >::eMax(), flagsexclEB_, flagsexclEE_, HLT_FULL_cff::full5x5_sigmaIetaIeta, geometry, edm::EventSetup::get(), get, CaloGeometry::getSubdetectorGeometry(), EgammaTowerIsolation::getTowerESum(), reco::Photon::ShowerShape::hcalDepth1OverEcal, reco::Photon::ShowerShape::hcalDepth1OverEcalBc, reco::Photon::ShowerShape::hcalDepth2OverEcal, reco::Photon::ShowerShape::hcalDepth2OverEcalBc, conversions_cfi::hcalTowers, reco::Photon::ShowerShape::hcalTowersBehindClusters, highEt_, hfClusterShapes_cfi::hits, hOverEConeSize_, PhotonEnergyCorrector::init(), createfilelist::int, EcalClusterToolsT< noZS >::localCovariances(), reco::Photon::ShowerShape::maxEnergyXtal, EgHLTOffEleSelection_cfi::minR9, minR9Barrel_, minR9Endcap_, PhotonMIPHaloTagger::MIPcalculate(), gedPhotons_cfi::outputPhotonCollection, p4, MaterialEffects_cfi::photonEnergy, photonEnergyCorrector_, photonIsolationCalculator_, photonMIPHaloTagger_, posCalculator_, preselCutValuesBarrel_, preselCutValuesEndcap_, edm::ESHandle< T >::product(), electrons_cff::r9, reco::Photon::regression1, runMIPTagger_, severitiesexclEB_, severitiesexclEE_, electronIdCutBasedExt_cfi::sigmaEtaEta, reco::Photon::ShowerShape::sigmaEtaEta, reco::Photon::ShowerShape::sigmaIetaIeta, mathSSE::sqrt(), egamma::towersOf(), spclusmultinvestigator_cfi::vertexCollection, and extraflags_cff::vtx.
Referenced by produce().
◆ produce()
Definition at line 126 of file PhotonProducer.cc.
131 auto outputPhotonCollection_p = std::make_unique<reco::PhotonCollection>();
134 bool validPhotonCoreHandle =
true;
137 if (!photonCoreHandle.
isValid()) {
138 edm::LogError(
"PhotonProducer") <<
"Error! Can't get the photonCoreProducer";
139 validPhotonCoreHandle =
false;
143 bool validEcalRecHits =
true;
147 if (!barrelHitHandle.
isValid()) {
148 edm::LogError(
"PhotonProducer") <<
"Error! Can't get the barrelEcalHits";
149 validEcalRecHits =
false;
151 if (validEcalRecHits)
157 if (!endcapHitHandle.
isValid()) {
158 edm::LogError(
"PhotonProducer") <<
"Error! Can't get the endcapEcalHits";
159 validEcalRecHits =
false;
161 if (validEcalRecHits)
180 bool validVertex =
true;
184 edm::LogWarning(
"PhotonProducer") <<
"Error! Can't get the product primary Vertex Collection "
194 if (validPhotonCoreHandle)
208 edm::LogInfo(
"PhotonProducer") <<
" Put in the event " << iSC <<
" Photon Candidates \n";
References barrelEcalHits_, HLT_FULL_cff::barrelRecHits, endcapEcalHits_, HLT_FULL_cff::endcapRecHits, fillPhotonCollection(), edm::EventSetup::get(), edm::Event::get(), get, edm::Event::getByToken(), conversions_cfi::hcalTowers, hcalTowers_, edm::HandleBase::isValid(), eostools::move(), gedPhotons_cfi::outputPhotonCollection, PhotonCollection_, photonCoreProducer_, edm::Handle< T >::product(), edm::ESHandle< T >::product(), edm::Event::put(), ecaldqm::topology(), usePrimaryVertex_, spclusmultinvestigator_cfi::vertexCollection, and vertexProducer_.
◆ barrelEcalHits_
◆ candidateP4type_
std::string PhotonProducer::candidateP4type_ |
|
private |
◆ endcapEcalHits_
◆ flagsexclEB_
std::vector<int> PhotonProducer::flagsexclEB_ |
|
private |
◆ flagsexclEE_
std::vector<int> PhotonProducer::flagsexclEE_ |
|
private |
◆ hcalTowers_
◆ highEt_
double PhotonProducer::highEt_ |
|
private |
◆ hOverEConeSize_
double PhotonProducer::hOverEConeSize_ |
|
private |
◆ maxHOverE_
double PhotonProducer::maxHOverE_ |
|
private |
◆ minR9Barrel_
double PhotonProducer::minR9Barrel_ |
|
private |
◆ minR9Endcap_
double PhotonProducer::minR9Endcap_ |
|
private |
◆ minSCEt_
double PhotonProducer::minSCEt_ |
|
private |
◆ PhotonCollection_
std::string PhotonProducer::PhotonCollection_ |
|
private |
◆ photonCoreProducer_
◆ photonEnergyCorrector_
◆ photonIsolationCalculator_
◆ photonMIPHaloTagger_
◆ posCalculator_
◆ preselCutValuesBarrel_
std::vector<double> PhotonProducer::preselCutValuesBarrel_ |
|
private |
◆ preselCutValuesEndcap_
std::vector<double> PhotonProducer::preselCutValuesEndcap_ |
|
private |
◆ runMIPTagger_
bool PhotonProducer::runMIPTagger_ |
|
private |
◆ severitiesexclEB_
std::vector<int> PhotonProducer::severitiesexclEB_ |
|
private |
◆ severitiesexclEE_
std::vector<int> PhotonProducer::severitiesexclEE_ |
|
private |
◆ usePrimaryVertex_
bool PhotonProducer::usePrimaryVertex_ |
|
private |
◆ validConversions_
bool PhotonProducer::validConversions_ |
|
private |
◆ validPixelSeeds_
bool PhotonProducer::validPixelSeeds_ |
|
private |
◆ vertexProducer_
T const * product() const
float hcalDepth2OverEcalBc
void setup(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
void setup(const edm::ParameterSet &conf, std::vector< int > const &flagsEB_, std::vector< int > const &flagsEE_, std::vector< int > const &severitiesEB_, std::vector< int > const &severitiesEE_, edm::ConsumesCollector &&iC)
ESHandle< TrackerGeometry > geometry
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
std::vector< int > flagsexclEE_
T const * product() const
edm::EDGetTokenT< reco::PhotonCoreCollection > photonCoreProducer_
void fillPhotonCollection(edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::PhotonCoreCollection > &photonCoreHandle, const CaloTopology *topology, const EcalRecHitCollection *ecalBarrelHits, const EcalRecHitCollection *ecalEndcapHits, CaloTowerCollection const &hcalTowers, reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC, const EcalSeverityLevelAlgo *sevLv)
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::vector< Vertex > VertexCollection
collection of Vertex objects
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Log< level::Info, false > LogInfo
double depth2HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
std::vector< double > preselCutValuesBarrel_
Log< level::Warning, false > LogWarning
void MIPcalculate(const reco::Photon *, const edm::Event &, const edm::EventSetup &es, reco::Photon::MIPVariables &mipId)
PhotonEnergyCorrector photonEnergyCorrector_
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
const CaloTopology * topology(nullptr)
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=nullptr)
float hcalDepth1OverEcalBc
std::string candidateP4type_
std::vector< CaloTowerDetId > towersOf(reco::SuperCluster const &sc, CaloTowerConstituentsMap const &towerMap, HoeMode mode=HoeMode::SingleTower)
XYZPointD XYZPoint
point in space with cartesian internal representation
std::string PhotonCollection_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
std::vector< double > preselCutValuesEndcap_
Log< level::Error, false > LogError
isolationSumsCalculatorSet
std::vector< int > severitiesexclEE_
PhotonIsolationCalculator photonIsolationCalculator_
void init(const edm::EventSetup &theEventSetup)
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
std::vector< CaloTowerDetId > hcalTowersBehindClusters
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
double depth1HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
PositionCalc posCalculator_
void calculate(const reco::Photon *, const edm::Event &, const edm::EventSetup &es, reco::Photon::FiducialFlags &phofid, reco::Photon::IsolationVariables &phoisolR03, reco::Photon::IsolationVariables &phoisolR04) const
std::vector< Photon > PhotonCollection
collectin of Photon objects
std::vector< int > severitiesexclEB_
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
PhotonMIPHaloTagger photonMIPHaloTagger_
std::vector< int > flagsexclEB_