CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
GEDPhotonProducer Class Reference
Inheritance diagram for GEDPhotonProducer:
edm::stream::EDProducer<>

Classes

class  RecoStepInfo
 

Public Member Functions

void beginRun (edm::Run const &r, edm::EventSetup const &es) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
 GEDPhotonProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void fillPhotonCollection (edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::PhotonCollection > &photonHandle, const edm::Handle< reco::PFCandidateCollection > pfCandidateHandle, const edm::Handle< reco::PFCandidateCollection > pfEGCandidateHandle, reco::VertexCollection const &pvVertices, reco::PhotonCollection &outputCollection, int &iSC, const edm::Handle< edm::ValueMap< float >> &chargedHadrons, const edm::Handle< edm::ValueMap< float >> &neutralHadrons, const edm::Handle< edm::ValueMap< float >> &photons, const edm::Handle< edm::ValueMap< float >> &chargedHadronsWorstVtx, const edm::Handle< edm::ValueMap< float >> &chargedHadronsWorstVtxGeomVeto, const edm::Handle< edm::ValueMap< float >> &chargedHadronsPFPV, const edm::Handle< edm::ValueMap< float >> &pfEcalClusters, const edm::Handle< edm::ValueMap< float >> &pfHcalClusters)
 
void fillPhotonCollection (edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::PhotonCoreCollection > &photonCoreHandle, const CaloTopology *topology, const EcalRecHitCollection *ecalBarrelHits, const EcalRecHitCollection *ecalEndcapHits, const EcalRecHitCollection *preshowerHits, const ElectronHcalHelper *hcalHelperCone, const ElectronHcalHelper *hcalHelperBc, const reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC, EcalPFRecHitThresholds const &thresholds)
 

Private Attributes

edm::EDGetTokenT< EcalRecHitCollectionbarrelEcalHits_
 
CaloGeometry const * caloGeom_ = nullptr
 
const edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeometryToken_
 
const edm::ESGetToken< CaloTopology, CaloTopologyRecordcaloTopologyToken_
 
std::string candidateP4type_
 
bool checkHcalStatus_
 
const EcalClusterLazyTools::ESGetTokens ecalClusterESGetTokens_
 
const edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcdecalPFRechitThresholdsToken_
 
edm::EDGetTokenT< EcalRecHitCollectionendcapEcalHits_
 
std::vector< int > flagsexclEB_
 
std::vector< int > flagsexclEE_
 
edm::EDGetTokenT< HBHERecHitCollectionhbheRecHits_
 
std::unique_ptr< ElectronHcalHelperhcalHelperBc_
 
std::unique_ptr< ElectronHcalHelperhcalHelperCone_
 
bool hcalRun2EffDepth_
 
double highEt_
 
double hOverEConeSize_
 
double minR9Barrel_
 
double minR9Endcap_
 
double multThresEB_
 
double multThresEE_
 
edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > particleBasedIsolationToken
 
edm::EDGetTokenT< reco::PFCandidateCollectionpfCandidates_
 
edm::EDGetTokenT< reco::PFCandidateCollectionpfEgammaCandidates_
 
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedIsolationToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedPFPVIsoToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedWorstVtxGeomVetoIsoToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedWorstVtxIsoToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > phoNeutralHadronIsolationToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > phoPFECALClusIsolationToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > phoPFHCALClusIsolationToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > phoPhotonIsolationToken_
 
std::string photonCollection_
 
edm::EDGetTokenT< reco::PhotonCoreCollectionphotonCoreProducerT_
 
std::unique_ptr< PhotonEnergyCorrectorphotonEnergyCorrector_ = nullptr
 
std::unique_ptr< PhotonIsolationCalculatorphotonIsoCalculator_ = nullptr
 
std::unique_ptr< PhotonMIPHaloTaggerphotonMIPHaloTagger_ = nullptr
 
const edm::InputTag photonProducer_
 
edm::EDGetTokenT< reco::PhotonCollectionphotonProducerT_
 
std::vector< double > preselCutValuesBarrel_
 
std::vector< double > preselCutValuesEndcap_
 
edm::EDGetTokenT< EcalRecHitCollectionpreshowerHits_
 
RecoStepInfo recoStep_
 
bool runMIPTagger_
 
std::vector< int > severitiesexclEB_
 
std::vector< int > severitiesexclEE_
 
bool usePrimaryVertex_
 
std::string valueMapPFCandPhoton_
 
edm::EDGetTokenT< reco::VertexCollectionvertexProducer_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 50 of file GEDPhotonProducer.cc.

Constructor & Destructor Documentation

◆ GEDPhotonProducer()

GEDPhotonProducer::GEDPhotonProducer ( const edm::ParameterSet ps)

Definition at line 201 of file GEDPhotonProducer.cc.

202  : photonProducer_{config.getParameter<edm::InputTag>("photonProducer")},
203  ecalClusterESGetTokens_{consumesCollector()},
204  recoStep_(config.getParameter<std::string>("reconstructionStep")),
208  hcalHelperCone_(nullptr),
209  hcalHelperBc_(nullptr) {
210  if (recoStep_.isFinal()) {
211  photonProducerT_ = consumes(photonProducer_);
212  pfCandidates_ = consumes(config.getParameter<edm::InputTag>("pfCandidates"));
213 
214  const edm::ParameterSet& pfIsolCfg = config.getParameter<edm::ParameterSet>("pfIsolCfg");
215  auto getVMToken = [&pfIsolCfg, this](const std::string& name) {
216  return consumes(pfIsolCfg.getParameter<edm::InputTag>(name));
217  };
218  phoChargedIsolationToken_ = getVMToken("chargedHadronIso");
219  phoNeutralHadronIsolationToken_ = getVMToken("neutralHadronIso");
220  phoPhotonIsolationToken_ = getVMToken("photonIso");
221  phoChargedWorstVtxIsoToken_ = getVMToken("chargedHadronWorstVtxIso");
222  phoChargedWorstVtxGeomVetoIsoToken_ = getVMToken("chargedHadronWorstVtxGeomVetoIso");
223  phoChargedPFPVIsoToken_ = getVMToken("chargedHadronPFPVIso");
224 
225  //OOT photons in legacy 80X re-miniAOD do not have PF cluster embeded into the reco object
226  //to preserve 80X behaviour
227  if (config.exists("pfECALClusIsolation")) {
228  phoPFECALClusIsolationToken_ = consumes(config.getParameter<edm::InputTag>("pfECALClusIsolation"));
229  }
230  if (config.exists("pfHCALClusIsolation")) {
231  phoPFHCALClusIsolationToken_ = consumes(config.getParameter<edm::InputTag>("pfHCALClusIsolation"));
232  }
233  } else {
235  }
236 
237  auto pfEg = config.getParameter<edm::InputTag>("pfEgammaCandidates");
238  if (not pfEg.label().empty()) {
239  pfEgammaCandidates_ = consumes(pfEg);
240  }
241  barrelEcalHits_ = consumes(config.getParameter<edm::InputTag>("barrelEcalHits"));
242  endcapEcalHits_ = consumes(config.getParameter<edm::InputTag>("endcapEcalHits"));
243  preshowerHits_ = consumes(config.getParameter<edm::InputTag>("preshowerHits"));
244  vertexProducer_ = consumes(config.getParameter<edm::InputTag>("primaryVertexProducer"));
245 
246  auto hbhetag = config.getParameter<edm::InputTag>("hbheRecHits");
247  if (not hbhetag.label().empty())
248  hbheRecHits_ = consumes<HBHERecHitCollection>(hbhetag);
249 
250  //
251  photonCollection_ = config.getParameter<std::string>("outputPhotonCollection");
252  multThresEB_ = config.getParameter<double>("multThresEB");
253  multThresEE_ = config.getParameter<double>("multThresEE");
254  hOverEConeSize_ = config.getParameter<double>("hOverEConeSize");
255  highEt_ = config.getParameter<double>("highEt");
256  // R9 value to decide converted/unconverted
257  minR9Barrel_ = config.getParameter<double>("minR9Barrel");
258  minR9Endcap_ = config.getParameter<double>("minR9Endcap");
259  usePrimaryVertex_ = config.getParameter<bool>("usePrimaryVertex");
260  runMIPTagger_ = config.getParameter<bool>("runMIPTagger");
261 
262  candidateP4type_ = config.getParameter<std::string>("candidateP4type");
263  valueMapPFCandPhoton_ = config.getParameter<std::string>("valueMapPhotons");
264 
265  //AA
266  //Flags and Severities to be excluded from photon calculations
267  auto const& flagnamesEB = config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEB");
268  auto const& flagnamesEE = config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEE");
269 
270  flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
271  flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
272 
273  auto const& severitynamesEB = config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEB");
274  auto const& severitynamesEE = config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEE");
275 
276  severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
277  severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
278 
279  photonEnergyCorrector_ = std::make_unique<PhotonEnergyCorrector>(config, consumesCollector());
280 
281  checkHcalStatus_ = config.getParameter<bool>("checkHcalStatus");
282  if (not hbheRecHits_.isUninitialized()) {
283  ElectronHcalHelper::Configuration cfgCone, cfgBc;
285  if (cfgCone.hOverEConeSize > 0) {
286  cfgCone.onlyBehindCluster = false;
288 
289  cfgCone.hbheRecHits = hbheRecHits_;
290 
291  cfgCone.eThresHB = config.getParameter<EgammaHcalIsolation::arrayHB>("recHitEThresholdHB");
292  cfgCone.maxSeverityHB = config.getParameter<int>("maxHcalRecHitSeverity");
293  cfgCone.eThresHE = config.getParameter<EgammaHcalIsolation::arrayHE>("recHitEThresholdHE");
294  cfgCone.maxSeverityHE = cfgCone.maxSeverityHB;
295  }
296  cfgBc.hOverEConeSize = 0.;
297  cfgBc.onlyBehindCluster = true;
299 
300  cfgBc.hbheRecHits = hbheRecHits_;
301 
302  cfgBc.eThresHB = config.getParameter<EgammaHcalIsolation::arrayHB>("recHitEThresholdHB");
303  cfgBc.maxSeverityHB = config.getParameter<int>("maxHcalRecHitSeverity");
304  cfgBc.eThresHE = config.getParameter<EgammaHcalIsolation::arrayHE>("recHitEThresholdHE");
305  cfgBc.maxSeverityHE = cfgBc.maxSeverityHB;
306 
307  hcalHelperCone_ = std::make_unique<ElectronHcalHelper>(cfgCone, consumesCollector());
308  hcalHelperBc_ = std::make_unique<ElectronHcalHelper>(cfgBc, consumesCollector());
309  }
310 
311  hcalRun2EffDepth_ = config.getParameter<bool>("hcalRun2EffDepth");
312 
313  //AA
314 
315  // cut values for pre-selection
316  preselCutValuesBarrel_ = {config.getParameter<double>("minSCEtBarrel"),
317  config.getParameter<double>("maxHoverEBarrel"),
318  config.getParameter<double>("ecalRecHitSumEtOffsetBarrel"),
319  config.getParameter<double>("ecalRecHitSumEtSlopeBarrel"),
320  config.getParameter<double>("hcalRecHitSumEtOffsetBarrel"),
321  config.getParameter<double>("hcalRecHitSumEtSlopeBarrel"),
322  config.getParameter<double>("nTrackSolidConeBarrel"),
323  config.getParameter<double>("nTrackHollowConeBarrel"),
324  config.getParameter<double>("trackPtSumSolidConeBarrel"),
325  config.getParameter<double>("trackPtSumHollowConeBarrel"),
326  config.getParameter<double>("sigmaIetaIetaCutBarrel")};
327  //
328  preselCutValuesEndcap_ = {config.getParameter<double>("minSCEtEndcap"),
329  config.getParameter<double>("maxHoverEEndcap"),
330  config.getParameter<double>("ecalRecHitSumEtOffsetEndcap"),
331  config.getParameter<double>("ecalRecHitSumEtSlopeEndcap"),
332  config.getParameter<double>("hcalRecHitSumEtOffsetEndcap"),
333  config.getParameter<double>("hcalRecHitSumEtSlopeEndcap"),
334  config.getParameter<double>("nTrackSolidConeEndcap"),
335  config.getParameter<double>("nTrackHollowConeEndcap"),
336  config.getParameter<double>("trackPtSumSolidConeEndcap"),
337  config.getParameter<double>("trackPtSumHollowConeEndcap"),
338  config.getParameter<double>("sigmaIetaIetaCutEndcap")};
339  //
340 
341  //moved from beginRun to here, I dont see how this could cause harm as its just reading in the exactly same parameters each run
342  if (!recoStep_.isFinal()) {
343  photonIsoCalculator_ = std::make_unique<PhotonIsolationCalculator>();
344  edm::ParameterSet isolationSumsCalculatorSet = config.getParameter<edm::ParameterSet>("isolationSumsCalculatorSet");
346  flagsexclEB_,
347  flagsexclEE_,
350  consumesCollector());
351  photonMIPHaloTagger_ = std::make_unique<PhotonMIPHaloTagger>();
352  edm::ParameterSet mipVariableSet = config.getParameter<edm::ParameterSet>("mipVariableSet");
353  photonMIPHaloTagger_->setup(mipVariableSet, consumesCollector());
354  }
355 
356  // Register the product
357  produces<reco::PhotonCollection>(photonCollection_);
359  produces<edm::ValueMap<reco::PhotonRef>>(valueMapPFCandPhoton_);
360  }
361 }

Member Function Documentation

◆ beginRun()

void GEDPhotonProducer::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
final

Definition at line 363 of file GEDPhotonProducer.cc.

363  {
364  if (!recoStep_.isFinal()) {
365  photonEnergyCorrector_->init(eventSetup);
366  }
367 }

References GEDPhotonProducer::RecoStepInfo::isFinal(), photonEnergyCorrector_, and recoStep_.

◆ endRun()

void GEDPhotonProducer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlinefinal

Definition at line 55 of file GEDPhotonProducer.cc.

55 {}

◆ fillPhotonCollection() [1/2]

void GEDPhotonProducer::fillPhotonCollection ( edm::Event evt,
edm::EventSetup const &  es,
const edm::Handle< reco::PhotonCollection > &  photonHandle,
const edm::Handle< reco::PFCandidateCollection pfCandidateHandle,
const edm::Handle< reco::PFCandidateCollection pfEGCandidateHandle,
reco::VertexCollection const &  pvVertices,
reco::PhotonCollection outputCollection,
int &  iSC,
const edm::Handle< edm::ValueMap< float >> &  chargedHadrons,
const edm::Handle< edm::ValueMap< float >> &  neutralHadrons,
const edm::Handle< edm::ValueMap< float >> &  photons,
const edm::Handle< edm::ValueMap< float >> &  chargedHadronsWorstVtx,
const edm::Handle< edm::ValueMap< float >> &  chargedHadronsWorstVtxGeomVeto,
const edm::Handle< edm::ValueMap< float >> &  chargedHadronsPFPV,
const edm::Handle< edm::ValueMap< float >> &  pfEcalClusters,
const edm::Handle< edm::ValueMap< float >> &  pfHcalClusters 
)
private

Definition at line 867 of file GEDPhotonProducer.cc.

882  {
883  std::vector<double> preselCutValues;
884 
885  for (unsigned int lSC = 0; lSC < photonHandle->size(); lSC++) {
886  reco::PhotonRef phoRef(reco::PhotonRef(photonHandle, lSC));
887  reco::SuperClusterRef parentSCRef = phoRef->parentSuperCluster();
888  reco::SuperClusterRef scRef = phoRef->superCluster();
889  DetId::Detector thedet = scRef->seed()->hitsAndFractions()[0].first.det();
890  int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
891  if (subdet == EcalBarrel) {
892  preselCutValues = preselCutValuesBarrel_;
893  } else if (subdet == EcalEndcap) {
894  preselCutValues = preselCutValuesEndcap_;
895  } else if (EcalTools::isHGCalDet(thedet)) {
896  preselCutValues = preselCutValuesEndcap_;
897  } else {
898  edm::LogWarning("") << "GEDPhotonProducer: do not know if it is a barrel or endcap SuperCluster" << thedet << ' '
899  << subdet;
900  }
901 
902  // SC energy preselection
903  if (parentSCRef.isNonnull() &&
904  ptFast(parentSCRef->energy(), parentSCRef->position(), {0, 0, 0}) <= preselCutValues[0])
905  continue;
906  reco::Photon newCandidate(*phoRef);
907  iSC++;
908 
909  // Calculate the PF isolation and ID - for the time being there is no calculation. Only the setting
912 
913  //get the pointer for the photon object
914  edm::Ptr<reco::Photon> photonPtr(photonHandle, lSC);
915 
916  if (!recoStep_.isOOT()) { //out of time photons do not have PF info so skip in this case
917  pfIso.chargedHadronIso = (*chargedHadrons)[photonPtr];
918  pfIso.neutralHadronIso = (*neutralHadrons)[photonPtr];
919  pfIso.photonIso = (*photons)[photonPtr];
920  pfIso.chargedHadronWorstVtxIso = (*chargedHadronsWorstVtx)[photonPtr];
921  pfIso.chargedHadronWorstVtxGeomVetoIso = (*chargedHadronsWorstVtxGeomVeto)[photonPtr];
922  pfIso.chargedHadronPFPVIso = (*chargedHadronsPFPV)[photonPtr];
923  }
924 
925  //OOT photons in legacy 80X reminiAOD workflow dont have pf cluster isolation embeded into them at this stage
926  pfIso.sumEcalClusterEt = !phoPFECALClusIsolationToken_.isUninitialized() ? (*pfEcalClusters)[photonPtr] : 0.;
927  pfIso.sumHcalClusterEt = !phoPFHCALClusIsolationToken_.isUninitialized() ? (*pfHcalClusters)[photonPtr] : 0.;
928 
929  newCandidate.setPflowIsolationVariables(pfIso);
930  newCandidate.setPflowIDVariables(pfID);
931 
932  // do the regression
933  photonEnergyCorrector_->calculate(evt, newCandidate, subdet, vertexCollection, es);
934  if (candidateP4type_ == "fromEcalEnergy") {
935  newCandidate.setP4(newCandidate.p4(reco::Photon::ecal_photons));
936  newCandidate.setCandidateP4type(reco::Photon::ecal_photons);
937  } else if (candidateP4type_ == "fromRegression1") {
938  newCandidate.setP4(newCandidate.p4(reco::Photon::regression1));
939  newCandidate.setCandidateP4type(reco::Photon::regression1);
940  } else if (candidateP4type_ == "fromRegression2") {
941  newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
942  newCandidate.setCandidateP4type(reco::Photon::regression2);
943  } else if (candidateP4type_ == "fromRefinedSCRegression") {
944  newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
945  newCandidate.setCandidateP4type(reco::Photon::regression2);
946  }
947 
948  outputPhotonCollection.push_back(newCandidate);
949  }
950 }

References candidateP4type_, reco::Photon::PflowIsolationVariables::chargedHadronIso, reco::Photon::PflowIsolationVariables::chargedHadronPFPVIso, reco::Photon::PflowIsolationVariables::chargedHadronWorstVtxGeomVetoIso, reco::Photon::PflowIsolationVariables::chargedHadronWorstVtxIso, reco::Photon::ecal_photons, EcalBarrel, EcalEndcap, EcalTools::isHGCalDet(), edm::Ref< C, T, F >::isNonnull(), GEDPhotonProducer::RecoStepInfo::isOOT(), edm::EDGetTokenT< T >::isUninitialized(), reco::Photon::PflowIsolationVariables::neutralHadronIso, gedPhotons_cfi::outputPhotonCollection, reco::Photon::p4(), phoPFECALClusIsolationToken_, phoPFHCALClusIsolationToken_, photonEnergyCorrector_, reco::Photon::PflowIsolationVariables::photonIso, preselCutValuesBarrel_, preselCutValuesEndcap_, ptFast(), recoStep_, reco::Photon::regression1, reco::Photon::regression2, reco::Photon::setCandidateP4type(), reco::Photon::setP4(), reco::Photon::setPflowIDVariables(), reco::Photon::setPflowIsolationVariables(), reco::Photon::PflowIsolationVariables::sumEcalClusterEt, reco::Photon::PflowIsolationVariables::sumHcalClusterEt, and spclusmultinvestigator_cfi::vertexCollection.

◆ fillPhotonCollection() [2/2]

void GEDPhotonProducer::fillPhotonCollection ( edm::Event evt,
edm::EventSetup const &  es,
const edm::Handle< reco::PhotonCoreCollection > &  photonCoreHandle,
const CaloTopology topology,
const EcalRecHitCollection ecalBarrelHits,
const EcalRecHitCollection ecalEndcapHits,
const EcalRecHitCollection preshowerHits,
const ElectronHcalHelper hcalHelperCone,
const ElectronHcalHelper hcalHelperBc,
const reco::VertexCollection pvVertices,
reco::PhotonCollection outputCollection,
int &  iSC,
EcalPFRecHitThresholds const &  thresholds 
)
private

fill shower shape block

fill extra shower shapes

fill full5x5 shower shape block

fill extra full5x5 shower shapes

get ecal photon specific corrected energy plus values from regressions and store them in the Photon

Pre-selection loose isolation cuts

Definition at line 548 of file GEDPhotonProducer.cc.

560  {
561  const EcalRecHitCollection* hits = nullptr;
562  std::vector<double> preselCutValues;
563  std::vector<int> flags_, severitiesexcl_;
564 
565  for (unsigned int lSC = 0; lSC < photonCoreHandle->size(); lSC++) {
566  reco::PhotonCoreRef coreRef(reco::PhotonCoreRef(photonCoreHandle, lSC));
567  reco::SuperClusterRef parentSCRef = coreRef->parentSuperCluster();
568  reco::SuperClusterRef scRef = coreRef->superCluster();
569 
570  // const reco::SuperCluster* pClus=&(*scRef);
571  iSC++;
572 
573  DetId::Detector thedet = scRef->seed()->hitsAndFractions()[0].first.det();
574  int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
575  if (subdet == EcalBarrel) {
576  preselCutValues = preselCutValuesBarrel_;
577  hits = ecalBarrelHits;
578  flags_ = flagsexclEB_;
579  severitiesexcl_ = severitiesexclEB_;
580  } else if (subdet == EcalEndcap) {
581  preselCutValues = preselCutValuesEndcap_;
582  hits = ecalEndcapHits;
583  flags_ = flagsexclEE_;
584  severitiesexcl_ = severitiesexclEE_;
585  } else if (EcalTools::isHGCalDet(thedet)) {
586  preselCutValues = preselCutValuesEndcap_;
587  hits = nullptr;
588  flags_ = flagsexclEE_;
589  severitiesexcl_ = severitiesexclEE_;
590  } else {
591  edm::LogWarning("") << "GEDPhotonProducer: do not know if it is a barrel or endcap SuperCluster: " << thedet
592  << ' ' << subdet;
593  }
594 
595  // SC energy preselection
596  if (parentSCRef.isNonnull() &&
597  ptFast(parentSCRef->energy(), parentSCRef->position(), {0, 0, 0}) <= preselCutValues[0])
598  continue;
599 
600  float maxXtal = (hits != nullptr ? EcalClusterTools::eMax(*(scRef->seed()), hits) : 0.f);
601 
602  //AA
603  //Change these to consider severity level of hits
604  float e1x5 = (hits != nullptr ? EcalClusterTools::e1x5(*(scRef->seed()), hits, topology) : 0.f);
605  float e2x5 = (hits != nullptr ? EcalClusterTools::e2x5Max(*(scRef->seed()), hits, topology) : 0.f);
606  float e3x3 = (hits != nullptr ? EcalClusterTools::e3x3(*(scRef->seed()), hits, topology) : 0.f);
607  float e5x5 = (hits != nullptr ? EcalClusterTools::e5x5(*(scRef->seed()), hits, topology) : 0.f);
608  const auto& cov = (hits != nullptr ? EcalClusterTools::covariances(*(scRef->seed()), hits, topology, caloGeom_)
609  : std::array<float, 3>({{0.f, 0.f, 0.f}}));
610  // fractional local covariances
611  const auto& locCov = (hits != nullptr ? EcalClusterTools::localCovariances(*(scRef->seed()), hits, topology)
612  : std::array<float, 3>({{0.f, 0.f, 0.f}}));
613 
614  float sigmaEtaEta = std::sqrt(cov[0]);
615  float sigmaIetaIeta = std::sqrt(locCov[0]);
616 
617  float full5x5_maxXtal = (hits != nullptr ? noZS::EcalClusterTools::eMax(*(scRef->seed()), hits) : 0.f);
618  //AA
619  //Change these to consider severity level of hits
620  float full5x5_e1x5 = (hits != nullptr ? noZS::EcalClusterTools::e1x5(*(scRef->seed()), hits, topology) : 0.f);
621  float full5x5_e2x5 = (hits != nullptr ? noZS::EcalClusterTools::e2x5Max(*(scRef->seed()), hits, topology) : 0.f);
622  float full5x5_e3x3 = (hits != nullptr ? noZS::EcalClusterTools::e3x3(*(scRef->seed()), hits, topology) : 0.f);
623  float full5x5_e5x5 = (hits != nullptr ? noZS::EcalClusterTools::e5x5(*(scRef->seed()), hits, topology) : 0.f);
624  const auto& full5x5_cov =
625  (hits != nullptr ? noZS::EcalClusterTools::covariances(*(scRef->seed()), hits, topology, caloGeom_)
626  : std::array<float, 3>({{0.f, 0.f, 0.f}}));
627  // for full5x5 local covariances, do noise-cleaning
628  // by passing per crystal PF recHit thresholds and mult values.
629  // mult values for EB and EE were obtained by dedicated studies.
630  const auto& full5x5_locCov =
631  (hits != nullptr ? noZS::EcalClusterTools::localCovariances(*(scRef->seed()),
632  hits,
633  topology,
635  &thresholds,
636  multThresEB_,
637  multThresEE_)
638  : std::array<float, 3>({{0.f, 0.f, 0.f}}));
639 
640  float full5x5_sigmaEtaEta = sqrt(full5x5_cov[0]);
641  float full5x5_sigmaIetaIeta = sqrt(full5x5_locCov[0]);
642 
643  // compute position of ECAL shower
644  math::XYZPoint caloPosition = scRef->position();
645 
647  double photonEnergy = 1.;
648  math::XYZPoint vtx(0., 0., 0.);
649  if (!vertexCollection.empty())
650  vtx = vertexCollection.begin()->position();
651  // compute momentum vector of photon from primary vertex and cluster position
652  math::XYZVector direction = caloPosition - vtx;
653  //math::XYZVector momentum = direction.unit() * photonEnergy ;
654  math::XYZVector momentum = direction.unit();
655 
656  // Create dummy candidate with unit momentum and zero energy to allow setting of all variables. The energy is set for last.
657  math::XYZTLorentzVectorD p4(momentum.x(), momentum.y(), momentum.z(), photonEnergy);
658  reco::Photon newCandidate(p4, caloPosition, coreRef, vtx);
659 
660  //std::cout << " standard p4 before " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
661  //std::cout << " type " <<newCandidate.getCandidateP4type() << " standard p4 after " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
662 
663  // Calculate fiducial flags and isolation variable. Blocked are filled from the isolationCalculator
664  reco::Photon::FiducialFlags fiducialFlags;
665  reco::Photon::IsolationVariables isolVarR03, isolVarR04;
666  if (!EcalTools::isHGCalDet(thedet)) {
667  photonIsoCalculator_->calculate(&newCandidate, evt, es, fiducialFlags, isolVarR04, isolVarR03);
668  }
669  newCandidate.setFiducialVolumeFlags(fiducialFlags);
670  newCandidate.setIsolationVariables(isolVarR04, isolVarR03);
671 
673  reco::Photon::ShowerShape showerShape;
674  showerShape.e1x5 = e1x5;
675  showerShape.e2x5 = e2x5;
676  showerShape.e3x3 = e3x3;
677  showerShape.e5x5 = e5x5;
678  showerShape.maxEnergyXtal = maxXtal;
679  showerShape.sigmaEtaEta = sigmaEtaEta;
680  showerShape.sigmaIetaIeta = sigmaIetaIeta;
681  for (uint id = 0; id < showerShape.hcalOverEcal.size(); ++id) {
682  showerShape.hcalOverEcal[id] =
683  (hcalHelperCone != nullptr) ? hcalHelperCone->hcalESum(*scRef, id + 1) / scRef->energy() : 0.f;
684  showerShape.hcalOverEcalBc[id] =
685  (hcalHelperBc != nullptr) ? hcalHelperBc->hcalESum(*scRef, id + 1) / scRef->energy() : 0.f;
686  }
687  showerShape.invalidHcal = (hcalHelperBc != nullptr) ? !hcalHelperBc->hasActiveHcal(*scRef) : false;
688  if (hcalHelperBc != nullptr)
689  showerShape.hcalTowersBehindClusters = hcalHelperBc->hcalTowersBehindClusters(*scRef);
690  showerShape.pre7DepthHcal = false;
691 
693  const float spp = (!edm::isFinite(locCov[2]) ? 0. : sqrt(locCov[2]));
694  const float sep = locCov[1];
695  showerShape.sigmaIetaIphi = sep;
696  showerShape.sigmaIphiIphi = spp;
697  showerShape.e2nd = (hits != nullptr ? EcalClusterTools::e2nd(*(scRef->seed()), hits) : 0.f);
698  showerShape.eTop = (hits != nullptr ? EcalClusterTools::eTop(*(scRef->seed()), hits, topology) : 0.f);
699  showerShape.eLeft = (hits != nullptr ? EcalClusterTools::eLeft(*(scRef->seed()), hits, topology) : 0.f);
700  showerShape.eRight = (hits != nullptr ? EcalClusterTools::eRight(*(scRef->seed()), hits, topology) : 0.f);
701  showerShape.eBottom = (hits != nullptr ? EcalClusterTools::eBottom(*(scRef->seed()), hits, topology) : 0.f);
702  showerShape.e1x3 = (hits != nullptr ? EcalClusterTools::e1x3(*(scRef->seed()), hits, topology) : 0.f);
703  showerShape.e2x2 = (hits != nullptr ? EcalClusterTools::e2x2(*(scRef->seed()), hits, topology) : 0.f);
704  showerShape.e2x5Max = (hits != nullptr ? EcalClusterTools::e2x5Max(*(scRef->seed()), hits, topology) : 0.f);
705  showerShape.e2x5Left = (hits != nullptr ? EcalClusterTools::e2x5Left(*(scRef->seed()), hits, topology) : 0.f);
706  showerShape.e2x5Right = (hits != nullptr ? EcalClusterTools::e2x5Right(*(scRef->seed()), hits, topology) : 0.f);
707  showerShape.e2x5Top = (hits != nullptr ? EcalClusterTools::e2x5Top(*(scRef->seed()), hits, topology) : 0.f);
708  showerShape.e2x5Bottom = (hits != nullptr ? EcalClusterTools::e2x5Bottom(*(scRef->seed()), hits, topology) : 0.f);
709  if (hits) {
710  Cluster2ndMoments clus2ndMoments = EcalClusterTools::cluster2ndMoments(*(scRef->seed()), *hits);
711  showerShape.smMajor = clus2ndMoments.sMaj;
712  showerShape.smMinor = clus2ndMoments.sMin;
713  showerShape.smAlpha = clus2ndMoments.alpha;
714  } else {
715  showerShape.smMajor = 0.f;
716  showerShape.smMinor = 0.f;
717  showerShape.smAlpha = 0.f;
718  }
719 
720  // fill preshower shapes
721  EcalClusterLazyTools toolsforES(
722  evt, ecalClusterESGetTokens_.get(es), barrelEcalHits_, endcapEcalHits_, preshowerHits_);
723  const float sigmaRR = toolsforES.eseffsirir(*scRef);
724  showerShape.effSigmaRR = sigmaRR;
725  newCandidate.setShowerShapeVariables(showerShape);
726 
727  const reco::CaloCluster& seedCluster = *(scRef->seed());
728  DetId seedXtalId = seedCluster.seed();
729  int nSaturatedXtals = 0;
730  bool isSeedSaturated = false;
731  if (hits != nullptr) {
732  const auto hitsAndFractions = scRef->hitsAndFractions();
733  for (auto const& hitFractionPair : hitsAndFractions) {
734  auto&& ecalRecHit = hits->find(hitFractionPair.first);
735  if (ecalRecHit == hits->end())
736  continue;
737  if (ecalRecHit->checkFlag(EcalRecHit::Flags::kSaturated)) {
738  nSaturatedXtals++;
739  if (seedXtalId == ecalRecHit->detid())
740  isSeedSaturated = true;
741  }
742  }
743  }
744  reco::Photon::SaturationInfo saturationInfo;
745  saturationInfo.nSaturatedXtals = nSaturatedXtals;
746  saturationInfo.isSeedSaturated = isSeedSaturated;
747  newCandidate.setSaturationInfo(saturationInfo);
748 
750  reco::Photon::ShowerShape full5x5_showerShape;
751  full5x5_showerShape.e1x5 = full5x5_e1x5;
752  full5x5_showerShape.e2x5 = full5x5_e2x5;
753  full5x5_showerShape.e3x3 = full5x5_e3x3;
754  full5x5_showerShape.e5x5 = full5x5_e5x5;
755  full5x5_showerShape.maxEnergyXtal = full5x5_maxXtal;
756  full5x5_showerShape.sigmaEtaEta = full5x5_sigmaEtaEta;
757  full5x5_showerShape.sigmaIetaIeta = full5x5_sigmaIetaIeta;
759  const float full5x5_spp = (!edm::isFinite(full5x5_locCov[2]) ? 0. : std::sqrt(full5x5_locCov[2]));
760  const float full5x5_sep = full5x5_locCov[1];
761  full5x5_showerShape.sigmaIetaIphi = full5x5_sep;
762  full5x5_showerShape.sigmaIphiIphi = full5x5_spp;
763  full5x5_showerShape.e2nd = (hits != nullptr ? noZS::EcalClusterTools::e2nd(*(scRef->seed()), hits) : 0.f);
764  full5x5_showerShape.eTop = (hits != nullptr ? noZS::EcalClusterTools::eTop(*(scRef->seed()), hits, topology) : 0.f);
765  full5x5_showerShape.eLeft =
766  (hits != nullptr ? noZS::EcalClusterTools::eLeft(*(scRef->seed()), hits, topology) : 0.f);
767  full5x5_showerShape.eRight =
768  (hits != nullptr ? noZS::EcalClusterTools::eRight(*(scRef->seed()), hits, topology) : 0.f);
769  full5x5_showerShape.eBottom =
770  (hits != nullptr ? noZS::EcalClusterTools::eBottom(*(scRef->seed()), hits, topology) : 0.f);
771  full5x5_showerShape.e1x3 = (hits != nullptr ? noZS::EcalClusterTools::e1x3(*(scRef->seed()), hits, topology) : 0.f);
772  full5x5_showerShape.e2x2 = (hits != nullptr ? noZS::EcalClusterTools::e2x2(*(scRef->seed()), hits, topology) : 0.f);
773  full5x5_showerShape.e2x5Max =
774  (hits != nullptr ? noZS::EcalClusterTools::e2x5Max(*(scRef->seed()), hits, topology) : 0.f);
775  full5x5_showerShape.e2x5Left =
776  (hits != nullptr ? noZS::EcalClusterTools::e2x5Left(*(scRef->seed()), hits, topology) : 0.f);
777  full5x5_showerShape.e2x5Right =
778  (hits != nullptr ? noZS::EcalClusterTools::e2x5Right(*(scRef->seed()), hits, topology) : 0.f);
779  full5x5_showerShape.e2x5Top =
780  (hits != nullptr ? noZS::EcalClusterTools::e2x5Top(*(scRef->seed()), hits, topology) : 0.f);
781  full5x5_showerShape.e2x5Bottom =
782  (hits != nullptr ? noZS::EcalClusterTools::e2x5Bottom(*(scRef->seed()), hits, topology) : 0.f);
783  if (hits) {
784  Cluster2ndMoments clus2ndMoments = noZS::EcalClusterTools::cluster2ndMoments(*(scRef->seed()), *hits);
785  full5x5_showerShape.smMajor = clus2ndMoments.sMaj;
786  full5x5_showerShape.smMinor = clus2ndMoments.sMin;
787  full5x5_showerShape.smAlpha = clus2ndMoments.alpha;
788  } else {
789  full5x5_showerShape.smMajor = 0.f;
790  full5x5_showerShape.smMinor = 0.f;
791  full5x5_showerShape.smAlpha = 0.f;
792  }
793  // fill preshower shapes
794  full5x5_showerShape.effSigmaRR = sigmaRR;
795  for (uint id = 0; id < full5x5_showerShape.hcalOverEcal.size(); ++id) {
796  full5x5_showerShape.hcalOverEcal[id] =
797  (hcalHelperCone != nullptr) ? hcalHelperCone->hcalESum(*scRef, id + 1) / full5x5_e5x5 : 0.f;
798  full5x5_showerShape.hcalOverEcalBc[id] =
799  (hcalHelperBc != nullptr) ? hcalHelperBc->hcalESum(*scRef, id + 1) / full5x5_e5x5 : 0.f;
800  }
801  full5x5_showerShape.pre7DepthHcal = false;
802  newCandidate.full5x5_setShowerShapeVariables(full5x5_showerShape);
803 
806  // Photon candidate takes by default (set in photons_cfi.py)
807  // a 4-momentum derived from the ecal photon-specific corrections.
808  if (!EcalTools::isHGCalDet(thedet)) {
809  photonEnergyCorrector_->calculate(evt, newCandidate, subdet, vertexCollection, es);
810  if (candidateP4type_ == "fromEcalEnergy") {
811  newCandidate.setP4(newCandidate.p4(reco::Photon::ecal_photons));
812  newCandidate.setCandidateP4type(reco::Photon::ecal_photons);
813  } else if (candidateP4type_ == "fromRegression1") {
814  newCandidate.setP4(newCandidate.p4(reco::Photon::regression1));
815  newCandidate.setCandidateP4type(reco::Photon::regression1);
816  } else if (candidateP4type_ == "fromRegression2") {
817  newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
818  newCandidate.setCandidateP4type(reco::Photon::regression2);
819  } else if (candidateP4type_ == "fromRefinedSCRegression") {
820  newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
821  newCandidate.setCandidateP4type(reco::Photon::regression2);
822  }
823  } else {
824  math::XYZVector gamma_momentum = direction.unit() * scRef->energy();
825  math::XYZTLorentzVectorD p4(gamma_momentum.x(), gamma_momentum.y(), gamma_momentum.z(), scRef->energy());
826  newCandidate.setP4(p4);
827  newCandidate.setCandidateP4type(reco::Photon::ecal_photons);
828  // Make it an EE photon
829  reco::Photon::FiducialFlags fiducialFlags;
830  fiducialFlags.isEE = true;
831  newCandidate.setFiducialVolumeFlags(fiducialFlags);
832  }
833 
834  // fill MIP Vairables for Halo: Block for MIP are filled from PhotonMIPHaloTagger
836  if (subdet == EcalBarrel && runMIPTagger_) {
837  photonMIPHaloTagger_->MIPcalculate(&newCandidate, evt, es, mipVar);
838  newCandidate.setMIPVariables(mipVar);
839  }
840 
842  bool isLooseEM = true;
843  if (newCandidate.pt() < highEt_) {
844  if (newCandidate.hadronicOverEm() >= preselCutValues[1])
845  isLooseEM = false;
846  if (newCandidate.ecalRecHitSumEtConeDR04() > preselCutValues[2] + preselCutValues[3] * newCandidate.pt())
847  isLooseEM = false;
848  if (newCandidate.hcalTowerSumEtConeDR04() > preselCutValues[4] + preselCutValues[5] * newCandidate.pt())
849  isLooseEM = false;
850  if (newCandidate.nTrkSolidConeDR04() > int(preselCutValues[6]))
851  isLooseEM = false;
852  if (newCandidate.nTrkHollowConeDR04() > int(preselCutValues[7]))
853  isLooseEM = false;
854  if (newCandidate.trkSumPtSolidConeDR04() > preselCutValues[8])
855  isLooseEM = false;
856  if (newCandidate.trkSumPtHollowConeDR04() > preselCutValues[9])
857  isLooseEM = false;
858  if (newCandidate.sigmaIetaIeta() > preselCutValues[10])
859  isLooseEM = false;
860  }
861 
862  if (isLooseEM)
863  outputPhotonCollection.push_back(newCandidate);
864  }
865 }

References Cluster2ndMoments::alpha, barrelEcalHits_, caloGeom_, candidateP4type_, EcalClusterToolsT< noZS >::cluster2ndMoments(), EcalClusterToolsT< noZS >::covariances(), EcalClusterToolsT< noZS >::e1x3(), reco::Photon::ShowerShape::e1x3, EgHLTOffHistBins_cfi::e1x5, EcalClusterToolsT< noZS >::e1x5(), reco::Photon::ShowerShape::e1x5, reco::Photon::ShowerShape::e2nd, EcalClusterToolsT< noZS >::e2nd(), EcalClusterToolsT< noZS >::e2x2(), reco::Photon::ShowerShape::e2x2, EgHLTOffHistBins_cfi::e2x5, reco::Photon::ShowerShape::e2x5, EcalClusterToolsT< noZS >::e2x5Bottom(), reco::Photon::ShowerShape::e2x5Bottom, EcalClusterToolsT< noZS >::e2x5Left(), reco::Photon::ShowerShape::e2x5Left, EcalClusterToolsT< noZS >::e2x5Max(), reco::Photon::ShowerShape::e2x5Max, EcalClusterToolsT< noZS >::e2x5Right(), reco::Photon::ShowerShape::e2x5Right, EcalClusterToolsT< noZS >::e2x5Top(), reco::Photon::ShowerShape::e2x5Top, EcalClusterToolsT< noZS >::e3x3(), reco::Photon::ShowerShape::e3x3, EcalClusterToolsT< noZS >::e5x5(), reco::Photon::ShowerShape::e5x5, EcalClusterToolsT< noZS >::eBottom(), reco::Photon::ShowerShape::eBottom, reco::Photon::ecal_photons, EcalBarrel, ecalClusterESGetTokens_, EcalEndcap, IOMC_cff::ecalRecHit, reco::Photon::ShowerShape::effSigmaRR, EcalClusterToolsT< noZS >::eLeft(), reco::Photon::ShowerShape::eLeft, cosmicPhotonAnalyzer_cfi::eMax, EcalClusterToolsT< noZS >::eMax(), endcapEcalHits_, EcalClusterToolsT< noZS >::eRight(), reco::Photon::ShowerShape::eRight, EcalClusterToolsT< noZS >::eTop(), reco::Photon::ShowerShape::eTop, flagsexclEB_, flagsexclEE_, HLT_FULL_cff::full5x5_sigmaIetaIeta, EcalClusterLazyToolsBase::ESGetTokens::get(), ElectronHcalHelper::hasActiveHcal(), ElectronHcalHelper::hcalESum(), reco::Photon::ShowerShape::hcalOverEcal, reco::Photon::ShowerShape::hcalOverEcalBc, ElectronHcalHelper::hcalTowersBehindClusters(), reco::Photon::ShowerShape::hcalTowersBehindClusters, highEt_, hfClusterShapes_cfi::hits, triggerObjects_cff::id, createfilelist::int, reco::Photon::ShowerShape::invalidHcal, reco::Photon::FiducialFlags::isEE, edm::isFinite(), EcalTools::isHGCalDet(), edm::Ref< C, T, F >::isNonnull(), reco::Photon::SaturationInfo::isSeedSaturated, EgammaLocalCovParamDefaults::kRelEnCut, EcalClusterToolsT< noZS >::localCovariances(), reco::Photon::ShowerShape::maxEnergyXtal, multThresEB_, multThresEE_, reco::Photon::SaturationInfo::nSaturatedXtals, gedPhotons_cfi::outputPhotonCollection, p4, MaterialEffects_cfi::photonEnergy, photonEnergyCorrector_, photonIsoCalculator_, photonMIPHaloTagger_, reco::Photon::ShowerShape::pre7DepthHcal, preselCutValuesBarrel_, preselCutValuesEndcap_, preshowerHits_, ptFast(), reco::Photon::regression1, reco::Photon::regression2, runMIPTagger_, reco::CaloCluster::seed(), severitiesexclEB_, severitiesexclEE_, electronIdCutBasedExt_cfi::sigmaEtaEta, reco::Photon::ShowerShape::sigmaEtaEta, reco::Photon::ShowerShape::sigmaIetaIeta, reco::Photon::ShowerShape::sigmaIetaIphi, reco::Photon::ShowerShape::sigmaIphiIphi, Cluster2ndMoments::sMaj, reco::Photon::ShowerShape::smAlpha, Cluster2ndMoments::sMin, reco::Photon::ShowerShape::smMajor, reco::Photon::ShowerShape::smMinor, mathSSE::sqrt(), particleFlowZeroSuppressionECAL_cff::thresholds, parallelization::uint, spclusmultinvestigator_cfi::vertexCollection, and extraflags_cff::vtx.

Referenced by produce().

◆ produce()

void GEDPhotonProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 369 of file GEDPhotonProducer.cc.

369  {
370  using namespace edm;
371 
372  auto outputPhotonCollection_p = std::make_unique<reco::PhotonCollection>();
373  edm::ValueMap<reco::PhotonRef> pfEGCandToPhotonMap;
374 
375  // Get the PhotonCore collection
376  bool validPhotonCoreHandle = false;
377  Handle<reco::PhotonCoreCollection> photonCoreHandle;
378  bool validPhotonHandle = false;
379  Handle<reco::PhotonCollection> photonHandle;
380  //value maps for isolation
381  edm::Handle<edm::ValueMap<float>> phoChargedIsolationMap;
382  edm::Handle<edm::ValueMap<float>> phoNeutralHadronIsolationMap;
383  edm::Handle<edm::ValueMap<float>> phoPhotonIsolationMap;
384  edm::Handle<edm::ValueMap<float>> phoChargedWorstVtxIsoMap;
385  edm::Handle<edm::ValueMap<float>> phoChargedWorstVtxGeomVetoIsoMap;
386  edm::Handle<edm::ValueMap<float>> phoChargedPFPVIsoMap;
387 
388  edm::Handle<edm::ValueMap<float>> phoPFECALClusIsolationMap;
389  edm::Handle<edm::ValueMap<float>> phoPFHCALClusIsolationMap;
390 
391  if (recoStep_.isFinal()) {
392  theEvent.getByToken(photonProducerT_, photonHandle);
393  //get isolation objects
394  theEvent.getByToken(phoChargedIsolationToken_, phoChargedIsolationMap);
395  theEvent.getByToken(phoNeutralHadronIsolationToken_, phoNeutralHadronIsolationMap);
396  theEvent.getByToken(phoPhotonIsolationToken_, phoPhotonIsolationMap);
397  theEvent.getByToken(phoChargedWorstVtxIsoToken_, phoChargedWorstVtxIsoMap);
398  theEvent.getByToken(phoChargedWorstVtxGeomVetoIsoToken_, phoChargedWorstVtxGeomVetoIsoMap);
399  theEvent.getByToken(phoChargedPFPVIsoToken_, phoChargedPFPVIsoMap);
400 
401  //OOT photons in legacy 80X re-miniAOD workflow dont have cluster isolation embed in them
403  theEvent.getByToken(phoPFECALClusIsolationToken_, phoPFECALClusIsolationMap);
404  }
406  theEvent.getByToken(phoPFHCALClusIsolationToken_, phoPFHCALClusIsolationMap);
407  }
408 
409  if (photonHandle.isValid()) {
410  validPhotonHandle = true;
411  } else {
412  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the product " << photonProducer_.label() << "\n";
413  }
414  } else {
415  theEvent.getByToken(photonCoreProducerT_, photonCoreHandle);
416  if (photonCoreHandle.isValid()) {
417  validPhotonCoreHandle = true;
418  } else {
419  throw cms::Exception("GEDPhotonProducer")
420  << "Error! Can't get the photonCoreProducer " << photonProducer_.label() << "\n";
421  }
422  }
423 
424  // Get EcalRecHits
425  auto const& barrelRecHits = theEvent.get(barrelEcalHits_);
426  auto const& endcapRecHits = theEvent.get(endcapEcalHits_);
427  auto const& preshowerRecHits = theEvent.get(preshowerHits_);
428 
429  Handle<reco::PFCandidateCollection> pfEGCandidateHandle;
430  // Get the PF refined cluster collection
432  theEvent.getByToken(pfEgammaCandidates_, pfEGCandidateHandle);
433  if (!pfEGCandidateHandle.isValid()) {
434  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the pfEgammaCandidates";
435  }
436  }
437 
438  Handle<reco::PFCandidateCollection> pfCandidateHandle;
439 
440  if (recoStep_.isFinal()) {
441  // Get the PF candidates collection
442  theEvent.getByToken(pfCandidates_, pfCandidateHandle);
443  //OOT photons have no PF candidates so its not an error in this case
444  if (!pfCandidateHandle.isValid() && !recoStep_.isOOT()) {
445  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the pfCandidates";
446  }
447  }
448 
449  // get the geometry from the event setup:
450  caloGeom_ = &eventSetup.getData(caloGeometryToken_);
451 
452  // prepare access to hcal data
453  if (hcalHelperCone_ != nullptr and hcalHelperBc_ != nullptr) {
454  hcalHelperCone_->beginEvent(theEvent, eventSetup);
455  hcalHelperBc_->beginEvent(theEvent, eventSetup);
456  }
457 
458  auto const& topology = eventSetup.getData(caloTopologyToken_);
459  auto const& thresholds = eventSetup.getData(ecalPFRechitThresholdsToken_);
460 
461  // Get the primary event vertex
462  const reco::VertexCollection dummyVC;
463  auto const& vertexCollection{usePrimaryVertex_ ? theEvent.get(vertexProducer_) : dummyVC};
464 
465  // math::XYZPoint vtx(0.,0.,0.);
466  //if (vertexCollection.size()>0) vtx = vertexCollection.begin()->position();
467 
468  // get the regression calculator ready
469  photonEnergyCorrector_->init(eventSetup);
470  if (photonEnergyCorrector_->gedRegression()) {
471  photonEnergyCorrector_->gedRegression()->setEvent(theEvent);
472  photonEnergyCorrector_->gedRegression()->setEventContent(eventSetup);
473  }
474 
475  int iSC = 0; // index in photon collection
476  // Loop over barrel and endcap SC collections and fill the photon collection
477  if (validPhotonCoreHandle)
478  fillPhotonCollection(theEvent,
479  eventSetup,
480  photonCoreHandle,
481  &topology,
482  &barrelRecHits,
483  &endcapRecHits,
484  &preshowerRecHits,
485  hcalHelperCone_.get(),
486  hcalHelperBc_.get(),
487  //vtx,
489  *outputPhotonCollection_p,
490  iSC,
491  thresholds);
492 
493  iSC = 0;
494  if (validPhotonHandle && recoStep_.isFinal())
495  fillPhotonCollection(theEvent,
496  eventSetup,
497  photonHandle,
498  pfCandidateHandle,
499  pfEGCandidateHandle,
500  theEvent.get(vertexProducer_),
501  *outputPhotonCollection_p,
502  iSC,
503  phoChargedIsolationMap,
504  phoNeutralHadronIsolationMap,
505  phoPhotonIsolationMap,
506  phoChargedWorstVtxIsoMap,
507  phoChargedWorstVtxGeomVetoIsoMap,
508  phoChargedPFPVIsoMap,
509  phoPFECALClusIsolationMap,
510  phoPFHCALClusIsolationMap);
511 
512  // put the product in the event
513  edm::LogInfo("GEDPhotonProducer") << " Put in the event " << iSC << " Photon Candidates \n";
514 
515  // go back to run2-like 2 effective depths if desired - depth 1 is the normal depth 1, depth 2 is the sum over the rest
516  if (hcalRun2EffDepth_) {
517  for (auto& pho : *outputPhotonCollection_p)
518  pho.hcalToRun2EffDepth();
519  }
520  const auto photonOrphHandle = theEvent.put(std::move(outputPhotonCollection_p), photonCollection_);
521 
524  auto pfEGCandToPhotonMap_p = std::make_unique<edm::ValueMap<reco::PhotonRef>>();
525  edm::ValueMap<reco::PhotonRef>::Filler filler(*pfEGCandToPhotonMap_p);
526  unsigned nObj = pfEGCandidateHandle->size();
527  std::vector<reco::PhotonRef> values(nObj);
529  for (unsigned int lCand = 0; lCand < nObj; lCand++) {
530  reco::PFCandidateRef pfCandRef(reco::PFCandidateRef(pfEGCandidateHandle, lCand));
531  reco::SuperClusterRef pfScRef = pfCandRef->superClusterRef();
532 
533  for (unsigned int lSC = 0; lSC < photonOrphHandle->size(); lSC++) {
534  reco::PhotonRef photonRef(reco::PhotonRef(photonOrphHandle, lSC));
535  reco::SuperClusterRef scRef = photonRef->superCluster();
536  if (pfScRef != scRef)
537  continue;
538  values[lCand] = photonRef;
539  }
540  }
541 
542  filler.insert(pfEGCandidateHandle, values.begin(), values.end());
543  filler.fill();
544  theEvent.put(std::move(pfEGCandToPhotonMap_p), valueMapPFCandPhoton_);
545  }
546 }

References barrelEcalHits_, HLT_FULL_cff::barrelRecHits, caloGeom_, caloGeometryToken_, caloTopologyToken_, ecalPFRechitThresholdsToken_, endcapEcalHits_, HLT_FULL_cff::endcapRecHits, Exception, trigObjTnPSource_cfi::filler, fillPhotonCollection(), edm::Event::get(), edm::Event::getByToken(), edm::EventSetup::getData(), hcalHelperBc_, hcalHelperCone_, hcalRun2EffDepth_, GEDPhotonProducer::RecoStepInfo::isFinal(), GEDPhotonProducer::RecoStepInfo::isOOT(), edm::EDGetTokenT< T >::isUninitialized(), edm::HandleBase::isValid(), edm::InputTag::label(), eostools::move(), pfCandidates_, pfEgammaCandidates_, phoChargedIsolationToken_, phoChargedPFPVIsoToken_, phoChargedWorstVtxGeomVetoIsoToken_, phoChargedWorstVtxIsoToken_, phoNeutralHadronIsolationToken_, phoPFECALClusIsolationToken_, phoPFHCALClusIsolationToken_, phoPhotonIsolationToken_, photonCollection_, photonCoreProducerT_, photonEnergyCorrector_, photonProducer_, photonProducerT_, preshowerHits_, edm::Event::put(), recoStep_, particleFlowZeroSuppressionECAL_cff::thresholds, usePrimaryVertex_, valueMapPFCandPhoton_, contentValuesCheck::values, spclusmultinvestigator_cfi::vertexCollection, and vertexProducer_.

Member Data Documentation

◆ barrelEcalHits_

edm::EDGetTokenT<EcalRecHitCollection> GEDPhotonProducer::barrelEcalHits_
private

Definition at line 108 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ caloGeom_

CaloGeometry const* GEDPhotonProducer::caloGeom_ = nullptr
private

Definition at line 155 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ caloGeometryToken_

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> GEDPhotonProducer::caloGeometryToken_
private

Definition at line 167 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ caloTopologyToken_

const edm::ESGetToken<CaloTopology, CaloTopologyRecord> GEDPhotonProducer::caloTopologyToken_
private

Definition at line 166 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ candidateP4type_

std::string GEDPhotonProducer::candidateP4type_
private

Definition at line 164 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ checkHcalStatus_

bool GEDPhotonProducer::checkHcalStatus_
private

Definition at line 145 of file GEDPhotonProducer.cc.

◆ ecalClusterESGetTokens_

const EcalClusterLazyTools::ESGetTokens GEDPhotonProducer::ecalClusterESGetTokens_
private

Definition at line 128 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ ecalPFRechitThresholdsToken_

const edm::ESGetToken<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd> GEDPhotonProducer::ecalPFRechitThresholdsToken_
private

Definition at line 168 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ endcapEcalHits_

edm::EDGetTokenT<EcalRecHitCollection> GEDPhotonProducer::endcapEcalHits_
private

Definition at line 109 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ flagsexclEB_

std::vector<int> GEDPhotonProducer::flagsexclEB_
private

Definition at line 137 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ flagsexclEE_

std::vector<int> GEDPhotonProducer::flagsexclEE_
private

Definition at line 138 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ hbheRecHits_

edm::EDGetTokenT<HBHERecHitCollection> GEDPhotonProducer::hbheRecHits_
private

Definition at line 113 of file GEDPhotonProducer.cc.

◆ hcalHelperBc_

std::unique_ptr<ElectronHcalHelper> GEDPhotonProducer::hcalHelperBc_
private

Definition at line 172 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ hcalHelperCone_

std::unique_ptr<ElectronHcalHelper> GEDPhotonProducer::hcalHelperCone_
private

Definition at line 171 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ hcalRun2EffDepth_

bool GEDPhotonProducer::hcalRun2EffDepth_
private

Definition at line 173 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ highEt_

double GEDPhotonProducer::highEt_
private

Definition at line 146 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ hOverEConeSize_

double GEDPhotonProducer::hOverEConeSize_
private

Definition at line 144 of file GEDPhotonProducer.cc.

◆ minR9Barrel_

double GEDPhotonProducer::minR9Barrel_
private

Definition at line 147 of file GEDPhotonProducer.cc.

◆ minR9Endcap_

double GEDPhotonProducer::minR9Endcap_
private

Definition at line 148 of file GEDPhotonProducer.cc.

◆ multThresEB_

double GEDPhotonProducer::multThresEB_
private

Definition at line 142 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ multThresEE_

double GEDPhotonProducer::multThresEE_
private

Definition at line 143 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ particleBasedIsolationToken

edm::EDGetTokenT<edm::ValueMap<std::vector<reco::PFCandidateRef> > > GEDPhotonProducer::particleBasedIsolationToken
private

Definition at line 116 of file GEDPhotonProducer.cc.

◆ pfCandidates_

edm::EDGetTokenT<reco::PFCandidateCollection> GEDPhotonProducer::pfCandidates_
private

Definition at line 112 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ pfEgammaCandidates_

edm::EDGetTokenT<reco::PFCandidateCollection> GEDPhotonProducer::pfEgammaCandidates_
private

Definition at line 111 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoChargedIsolationToken_

edm::EDGetTokenT<edm::ValueMap<float> > GEDPhotonProducer::phoChargedIsolationToken_
private

Definition at line 118 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoChargedPFPVIsoToken_

edm::EDGetTokenT<edm::ValueMap<float> > GEDPhotonProducer::phoChargedPFPVIsoToken_
private

Definition at line 123 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoChargedWorstVtxGeomVetoIsoToken_

edm::EDGetTokenT<edm::ValueMap<float> > GEDPhotonProducer::phoChargedWorstVtxGeomVetoIsoToken_
private

Definition at line 122 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoChargedWorstVtxIsoToken_

edm::EDGetTokenT<edm::ValueMap<float> > GEDPhotonProducer::phoChargedWorstVtxIsoToken_
private

Definition at line 121 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoNeutralHadronIsolationToken_

edm::EDGetTokenT<edm::ValueMap<float> > GEDPhotonProducer::phoNeutralHadronIsolationToken_
private

Definition at line 119 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoPFECALClusIsolationToken_

edm::EDGetTokenT<edm::ValueMap<float> > GEDPhotonProducer::phoPFECALClusIsolationToken_
private

Definition at line 125 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ phoPFHCALClusIsolationToken_

edm::EDGetTokenT<edm::ValueMap<float> > GEDPhotonProducer::phoPFHCALClusIsolationToken_
private

Definition at line 126 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ phoPhotonIsolationToken_

edm::EDGetTokenT<edm::ValueMap<float> > GEDPhotonProducer::phoPhotonIsolationToken_
private

Definition at line 120 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ photonCollection_

std::string GEDPhotonProducer::photonCollection_
private

Definition at line 103 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ photonCoreProducerT_

edm::EDGetTokenT<reco::PhotonCoreCollection> GEDPhotonProducer::photonCoreProducerT_
private

Definition at line 106 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ photonEnergyCorrector_

std::unique_ptr<PhotonEnergyCorrector> GEDPhotonProducer::photonEnergyCorrector_ = nullptr
private

Definition at line 163 of file GEDPhotonProducer.cc.

Referenced by beginRun(), fillPhotonCollection(), and produce().

◆ photonIsoCalculator_

std::unique_ptr<PhotonIsolationCalculator> GEDPhotonProducer::photonIsoCalculator_ = nullptr
private

Definition at line 132 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ photonMIPHaloTagger_

std::unique_ptr<PhotonMIPHaloTagger> GEDPhotonProducer::photonMIPHaloTagger_ = nullptr
private

Definition at line 158 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ photonProducer_

const edm::InputTag GEDPhotonProducer::photonProducer_
private

Definition at line 104 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ photonProducerT_

edm::EDGetTokenT<reco::PhotonCollection> GEDPhotonProducer::photonProducerT_
private

Definition at line 107 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ preselCutValuesBarrel_

std::vector<double> GEDPhotonProducer::preselCutValuesBarrel_
private

Definition at line 160 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ preselCutValuesEndcap_

std::vector<double> GEDPhotonProducer::preselCutValuesEndcap_
private

Definition at line 161 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ preshowerHits_

edm::EDGetTokenT<EcalRecHitCollection> GEDPhotonProducer::preshowerHits_
private

Definition at line 110 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ recoStep_

RecoStepInfo GEDPhotonProducer::recoStep_
private

Definition at line 151 of file GEDPhotonProducer.cc.

Referenced by beginRun(), fillPhotonCollection(), and produce().

◆ runMIPTagger_

bool GEDPhotonProducer::runMIPTagger_
private

Definition at line 149 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ severitiesexclEB_

std::vector<int> GEDPhotonProducer::severitiesexclEB_
private

Definition at line 139 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ severitiesexclEE_

std::vector<int> GEDPhotonProducer::severitiesexclEE_
private

Definition at line 140 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ usePrimaryVertex_

bool GEDPhotonProducer::usePrimaryVertex_
private

Definition at line 153 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ valueMapPFCandPhoton_

std::string GEDPhotonProducer::valueMapPFCandPhoton_
private

Definition at line 130 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ vertexProducer_

edm::EDGetTokenT<reco::VertexCollection> GEDPhotonProducer::vertexProducer_
private

Definition at line 114 of file GEDPhotonProducer.cc.

Referenced by produce().

EgHLTOffHistBins_cfi.e1x5
e1x5
Definition: EgHLTOffHistBins_cfi.py:22
ElectronHcalHelper::Configuration::hbheRecHits
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits
Definition: ElectronHcalHelper.h:33
reco::Photon::ShowerShape::eTop
float eTop
Definition: Photon.h:160
reco::Photon::ShowerShape::sigmaIphiIphi
float sigmaIphiIphi
Definition: Photon.h:158
reco::Photon::ShowerShape::maxEnergyXtal
float maxEnergyXtal
Definition: Photon.h:145
ElectronHcalHelper::hcalTowersBehindClusters
auto hcalTowersBehindClusters(const reco::SuperCluster &sc) const
Definition: ElectronHcalHelper.h:45
GEDPhotonProducer::preshowerHits_
edm::EDGetTokenT< EcalRecHitCollection > preshowerHits_
Definition: GEDPhotonProducer.cc:110
reco::Photon::ShowerShape::eRight
float eRight
Definition: Photon.h:162
GEDPhotonProducer::valueMapPFCandPhoton_
std::string valueMapPFCandPhoton_
Definition: GEDPhotonProducer.cc:130
reco::Photon::ShowerShape::e2x5Left
float e2x5Left
Definition: Photon.h:167
reco::Photon::ShowerShape::sigmaEtaEta
float sigmaEtaEta
Definition: Photon.h:139
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
particleFlowZeroSuppressionECAL_cff.thresholds
thresholds
Definition: particleFlowZeroSuppressionECAL_cff.py:31
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
reco::Photon::SaturationInfo::nSaturatedXtals
int nSaturatedXtals
Definition: Photon.h:300
reco::Photon::ShowerShape::e1x5
float e1x5
Definition: Photon.h:141
EcalTools::isHGCalDet
static bool isHGCalDet(DetId::Detector thedet)
identify HGCal cells
Definition: EcalTools.h:49
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
GEDPhotonProducer::ecalPFRechitThresholdsToken_
const edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRechitThresholdsToken_
Definition: GEDPhotonProducer.cc:168
GEDPhotonProducer::fillPhotonCollection
void fillPhotonCollection(edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::PhotonCoreCollection > &photonCoreHandle, const CaloTopology *topology, const EcalRecHitCollection *ecalBarrelHits, const EcalRecHitCollection *ecalEndcapHits, const EcalRecHitCollection *preshowerHits, const ElectronHcalHelper *hcalHelperCone, const ElectronHcalHelper *hcalHelperBc, const reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC, EcalPFRecHitThresholds const &thresholds)
Definition: GEDPhotonProducer.cc:548
reco::Photon::ShowerShape::e1x3
float e1x3
Definition: Photon.h:164
GEDPhotonProducer::caloTopologyToken_
const edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopologyToken_
Definition: GEDPhotonProducer.cc:166
reco::Photon::FiducialFlags::isEE
bool isEE
Definition: Photon.h:97
EgammaHcalIsolation::arrayHB
std::array< double, 4 > arrayHB
Definition: EgammaHcalIsolation.h:41
HLT_FULL_cff.endcapRecHits
endcapRecHits
Definition: HLT_FULL_cff.py:14947
reco::Photon::ShowerShape::pre7DepthHcal
bool pre7DepthHcal
Definition: Photon.h:155
EcalClusterToolsT::e2x5Bottom
static float e2x5Bottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:598
reco::Photon::ShowerShape::e2nd
float e2nd
Definition: Photon.h:159
edm
HLT enums.
Definition: AlignableModifier.h:19
GEDPhotonProducer::multThresEB_
double multThresEB_
Definition: GEDPhotonProducer.cc:142
gedPhotons_cfi.mipVariableSet
mipVariableSet
Definition: gedPhotons_cfi.py:37
math::XYZTLorentzVectorD
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
GEDPhotonProducer::photonEnergyCorrector_
std::unique_ptr< PhotonEnergyCorrector > photonEnergyCorrector_
Definition: GEDPhotonProducer.cc:163
HLT_FULL_cff.barrelRecHits
barrelRecHits
Definition: HLT_FULL_cff.py:14946
reco::Photon::ShowerShape::e2x2
float e2x2
Definition: Photon.h:165
reco::Photon::ShowerShape::invalidHcal
bool invalidHcal
Definition: Photon.h:154
GEDPhotonProducer::hcalRun2EffDepth_
bool hcalRun2EffDepth_
Definition: GEDPhotonProducer.cc:173
reco::Photon::SaturationInfo
Definition: Photon.h:299
reco::Photon::PflowIsolationVariables::chargedHadronPFPVIso
float chargedHadronPFPVIso
Definition: Photon.h:523
EcalClusterToolsT::eMax
static float eMax(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
Definition: EcalClusterTools.h:555
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
edm::SortedCollection< EcalRecHit >
mps_check.array
array
Definition: mps_check.py:216
GEDPhotonProducer::phoChargedPFPVIsoToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedPFPVIsoToken_
Definition: GEDPhotonProducer.cc:123
reco::Photon::PflowIsolationVariables::chargedHadronIso
float chargedHadronIso
Definition: Photon.h:520
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
reco::Photon::ShowerShape::eBottom
float eBottom
Definition: Photon.h:163
EcalClusterToolsT::localCovariances
static std::array< float, 3 > localCovariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=EgammaLocalCovParamDefaults::kRelEnCut, const EcalPFRecHitThresholds *thresholds=nullptr, float multEB=0.0, float multEE=0.0)
Definition: EcalClusterTools.h:1036
edm::Handle
Definition: AssociativeIterator.h:50
parallelization.uint
uint
Definition: parallelization.py:124
GEDPhotonProducer::photonCollection_
std::string photonCollection_
Definition: GEDPhotonProducer.cc:103
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
GEDPhotonProducer::flagsexclEB_
std::vector< int > flagsexclEB_
Definition: GEDPhotonProducer.cc:137
reco::Photon::PflowIsolationVariables::neutralHadronIso
float neutralHadronIso
Definition: Photon.h:524
EcalBarrel
Definition: EcalSubdetector.h:10
edm::Ref< PhotonCollection >
reco::Photon::ShowerShape::e2x5Bottom
float e2x5Bottom
Definition: Photon.h:170
reco::Photon::PflowIsolationVariables::chargedHadronWorstVtxGeomVetoIso
float chargedHadronWorstVtxGeomVetoIso
Definition: Photon.h:522
config
Definition: config.py:1
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
DetId
Definition: DetId.h:17
ElectronHcalHelper::Configuration::maxSeverityHB
int maxSeverityHB
Definition: ElectronHcalHelper.h:36
GEDPhotonProducer::caloGeom_
CaloGeometry const * caloGeom_
Definition: GEDPhotonProducer.cc:155
GEDPhotonProducer::photonCoreProducerT_
edm::EDGetTokenT< reco::PhotonCoreCollection > photonCoreProducerT_
Definition: GEDPhotonProducer.cc:106
reco::Photon::PflowIsolationVariables
Definition: Photon.h:519
reco::Photon::ShowerShape::sigmaIetaIphi
float sigmaIetaIphi
Definition: Photon.h:157
GEDPhotonProducer::flagsexclEE_
std::vector< int > flagsexclEE_
Definition: GEDPhotonProducer.cc:138
reco::Photon::ecal_photons
Definition: Photon.h:314
GEDPhotonProducer::recoStep_
RecoStepInfo recoStep_
Definition: GEDPhotonProducer.cc:151
EcalClusterToolsT::e2x5Max
static float e2x5Max(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:608
reco::Photon::ShowerShape::eLeft
float eLeft
Definition: Photon.h:161
ElectronHcalHelper::Configuration::onlyBehindCluster
bool onlyBehindCluster
Definition: ElectronHcalHelper.h:30
EcalClusterToolsT::e2x5Top
static float e2x5Top(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:590
GEDPhotonProducer::endcapEcalHits_
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
Definition: GEDPhotonProducer.cc:109
EcalClusterToolsT::e2x2
static float e2x2(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:494
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
reco::Photon::ShowerShape::smAlpha
float smAlpha
Definition: Photon.h:173
GEDPhotonProducer::pfEgammaCandidates_
edm::EDGetTokenT< reco::PFCandidateCollection > pfEgammaCandidates_
Definition: GEDPhotonProducer.cc:111
reco::CaloCluster
Definition: CaloCluster.h:31
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EcalClusterToolsT::covariances
static std::array< float, 3 > covariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
Definition: EcalClusterTools.h:962
reco::Photon::ShowerShape::hcalOverEcal
std::array< float, 7 > hcalOverEcal
Definition: Photon.h:150
ElectronHcalHelper::Configuration::hOverEConeSize
double hOverEConeSize
Definition: ElectronHcalHelper.h:27
ElectronHcalHelper::hasActiveHcal
bool hasActiveHcal(const reco::SuperCluster &sc) const
Definition: ElectronHcalHelper.cc:67
reco::Photon::ShowerShape::smMajor
float smMajor
Definition: Photon.h:171
GEDPhotonProducer::severitiesexclEE_
std::vector< int > severitiesexclEE_
Definition: GEDPhotonProducer.cc:140
GEDPhotonProducer::minR9Endcap_
double minR9Endcap_
Definition: GEDPhotonProducer.cc:148
Cluster2ndMoments::alpha
float alpha
Definition: EcalClusterTools.h:71
ElectronHcalHelper::hcalESum
double hcalESum(const reco::SuperCluster &, int depth) const
Definition: ElectronHcalHelper.cc:73
EcalClusterLazyTools
EcalClusterToolsT::cluster2ndMoments
static Cluster2ndMoments cluster2ndMoments(const reco::BasicCluster &basicCluster, const EcalRecHitCollection &recHits, double phiCorrectionFactor=0.8, double w0=4.7, bool useLogWeights=true)
Definition: EcalClusterTools.h:1459
reco::Photon::ShowerShape::e2x5Right
float e2x5Right
Definition: Photon.h:168
ElectronHcalHelper::Configuration
Definition: ElectronHcalHelper.h:25
EcalClusterToolsT::eTop
static float eTop(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:673
GEDPhotonProducer::phoChargedWorstVtxGeomVetoIsoToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedWorstVtxGeomVetoIsoToken_
Definition: GEDPhotonProducer.cc:122
GEDPhotonProducer::photonIsoCalculator_
std::unique_ptr< PhotonIsolationCalculator > photonIsoCalculator_
Definition: GEDPhotonProducer.cc:132
GEDPhotonProducer::phoChargedIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedIsolationToken_
Definition: GEDPhotonProducer.cc:118
EcalEndcap
Definition: EcalSubdetector.h:10
GEDPhotonProducer::hbheRecHits_
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits_
Definition: GEDPhotonProducer.cc:113
EgammaLocalCovParamDefaults::kRelEnCut
static constexpr float kRelEnCut
Definition: EgammaLocalCovParamDefaults.h:5
reco::Photon::ShowerShape::effSigmaRR
float effSigmaRR
Definition: Photon.h:156
GEDPhotonProducer::phoPFHCALClusIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoPFHCALClusIsolationToken_
Definition: GEDPhotonProducer.cc:126
IOMC_cff.ecalRecHit
ecalRecHit
Definition: IOMC_cff.py:103
GEDPhotonProducer::photonProducerT_
edm::EDGetTokenT< reco::PhotonCollection > photonProducerT_
Definition: GEDPhotonProducer.cc:107
reco::Photon::PflowIsolationVariables::chargedHadronWorstVtxIso
float chargedHadronWorstVtxIso
Definition: Photon.h:521
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Cluster2ndMoments::sMaj
float sMaj
Definition: EcalClusterTools.h:68
reco::Photon::ShowerShape::e2x5Max
float e2x5Max
Definition: Photon.h:166
GEDPhotonProducer::barrelEcalHits_
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
Definition: GEDPhotonProducer.cc:108
reco::Photon::ShowerShape::e2x5Top
float e2x5Top
Definition: Photon.h:169
GEDPhotonProducer::RecoStepInfo::isOOT
bool isOOT() const
Definition: GEDPhotonProducer.cc:64
reco::Photon::ShowerShape::sigmaIetaIeta
float sigmaIetaIeta
Definition: Photon.h:140
cosmicPhotonAnalyzer_cfi.eMax
eMax
Definition: cosmicPhotonAnalyzer_cfi.py:10
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
GEDPhotonProducer::candidateP4type_
std::string candidateP4type_
Definition: GEDPhotonProducer.cc:164
EcalClusterToolsT::eBottom
static float eBottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:681
reco::Photon::ShowerShape::e2x5
float e2x5
Definition: Photon.h:142
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
reco::Photon::ShowerShape::smMinor
float smMinor
Definition: Photon.h:172
reco::Photon::FiducialFlags
Definition: Photon.h:94
GEDPhotonProducer::severitiesexclEB_
std::vector< int > severitiesexclEB_
Definition: GEDPhotonProducer.cc:139
GEDPhotonProducer::hOverEConeSize_
double hOverEConeSize_
Definition: GEDPhotonProducer.cc:144
createfilelist.int
int
Definition: createfilelist.py:10
GEDPhotonProducer::hcalHelperCone_
std::unique_ptr< ElectronHcalHelper > hcalHelperCone_
Definition: GEDPhotonProducer.cc:171
p4
double p4[4]
Definition: TauolaWrapper.h:92
GEDPhotonProducer::minR9Barrel_
double minR9Barrel_
Definition: GEDPhotonProducer.cc:147
ElectronHcalHelper::Configuration::maxSeverityHE
int maxSeverityHE
Definition: ElectronHcalHelper.h:38
DetId::Detector
Detector
Definition: DetId.h:24
EcalClusterToolsT::e2nd
static float e2nd(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
Definition: EcalClusterTools.h:560
GEDPhotonProducer::hcalHelperBc_
std::unique_ptr< ElectronHcalHelper > hcalHelperBc_
Definition: GEDPhotonProducer.cc:172
gedPhotons_cfi.isolationSumsCalculatorSet
isolationSumsCalculatorSet
Definition: gedPhotons_cfi.py:35
GEDPhotonProducer::ecalClusterESGetTokens_
const EcalClusterLazyTools::ESGetTokens ecalClusterESGetTokens_
Definition: GEDPhotonProducer.cc:128
reco::Photon::IsolationVariables
Definition: Photon.h:399
reco::CaloCluster::seed
DetId seed() const
return DetId of seed
Definition: CaloCluster.h:219
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEDPhotonProducer::photonProducer_
const edm::InputTag photonProducer_
Definition: GEDPhotonProducer.cc:104
EcalClusterToolsT::eRight
static float eRight(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:665
GEDPhotonProducer::phoPFECALClusIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoPFECALClusIsolationToken_
Definition: GEDPhotonProducer.cc:125
GEDPhotonProducer::phoNeutralHadronIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoNeutralHadronIsolationToken_
Definition: GEDPhotonProducer.cc:119
EcalClusterToolsT::e2x5Right
static float e2x5Right(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:574
edm::Ptr
Definition: AssociationVector.h:31
EcalClusterToolsT::e3x3
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:519
GEDPhotonProducer::caloGeometryToken_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
Definition: GEDPhotonProducer.cc:167
gedPhotonSequence_cff.pfIsolCfg
pfIsolCfg
Definition: gedPhotonSequence_cff.py:29
reco::Photon
Definition: Photon.h:22
reco::Photon::ShowerShape::hcalTowersBehindClusters
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: Photon.h:153
GEDPhotonProducer::phoChargedWorstVtxIsoToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedWorstVtxIsoToken_
Definition: GEDPhotonProducer.cc:121
reco::Photon::ShowerShape::hcalOverEcalBc
std::array< float, 7 > hcalOverEcalBc
Definition: Photon.h:152
reco::Photon::ShowerShape
Definition: Photon.h:138
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
GEDPhotonProducer::checkHcalStatus_
bool checkHcalStatus_
Definition: GEDPhotonProducer.cc:145
reco::Photon::PflowIDVariables
Definition: Photon.h:559
GEDPhotonProducer::photonMIPHaloTagger_
std::unique_ptr< PhotonMIPHaloTagger > photonMIPHaloTagger_
Definition: GEDPhotonProducer.cc:158
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:19
ElectronHcalHelper::Configuration::eThresHB
EgammaHcalIsolation::arrayHB eThresHB
Definition: ElectronHcalHelper.h:35
gedPhotons_cfi.outputPhotonCollection
outputPhotonCollection
Definition: gedPhotons_cfi.py:31
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
ElectronHcalHelper::Configuration::checkHcalStatus
bool checkHcalStatus
Definition: ElectronHcalHelper.h:30
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
EcalClusterToolsT::e2x5Left
static float e2x5Left(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:582
edm::ValueMap
Definition: ValueMap.h:107
Exception
Definition: hltDiff.cc:245
EcalClusterToolsT::e1x5
static float e1x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:625
GEDPhotonProducer::usePrimaryVertex_
bool usePrimaryVertex_
Definition: GEDPhotonProducer.cc:153
HLT_FULL_cff.full5x5_sigmaIetaIeta
full5x5_sigmaIetaIeta
Definition: HLT_FULL_cff.py:13698
ptFast
double ptFast(const double energy, const math::XYZPoint &position, const math::XYZPoint &origin)
Definition: SuperClusterImporter.cc:12
reco::Photon::regression1
Definition: Photon.h:314
reco::Photon::SaturationInfo::isSeedSaturated
bool isSeedSaturated
Definition: Photon.h:301
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EcalClusterToolsT::e5x5
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:539
GEDPhotonProducer::RecoStepInfo::isFinal
bool isFinal() const
Definition: GEDPhotonProducer.cc:65
reco::Photon::PflowIsolationVariables::photonIso
float photonIso
Definition: Photon.h:525
reco::Photon::MIPVariables
Definition: Photon.h:365
Cluster2ndMoments::sMin
float sMin
Definition: EcalClusterTools.h:69
reco::Photon::ShowerShape::e3x3
float e3x3
Definition: Photon.h:143
GEDPhotonProducer::preselCutValuesEndcap_
std::vector< double > preselCutValuesEndcap_
Definition: GEDPhotonProducer.cc:161
GEDPhotonProducer::multThresEE_
double multThresEE_
Definition: GEDPhotonProducer.cc:143
reco::Photon::PflowIsolationVariables::sumEcalClusterEt
float sumEcalClusterEt
Definition: Photon.h:526
GEDPhotonProducer::preselCutValuesBarrel_
std::vector< double > preselCutValuesBarrel_
Definition: GEDPhotonProducer.cc:160
electronIdCutBasedExt_cfi.sigmaEtaEta
sigmaEtaEta
Definition: electronIdCutBasedExt_cfi.py:123
reco::Photon::PflowIsolationVariables::sumHcalClusterEt
float sumHcalClusterEt
Definition: Photon.h:527
GEDPhotonProducer::highEt_
double highEt_
Definition: GEDPhotonProducer.cc:146
MaterialEffects_cfi.photonEnergy
photonEnergy
Definition: MaterialEffects_cfi.py:26
edm::helper::Filler
Definition: ValueMap.h:22
EcalClusterToolsT::eLeft
static float eLeft(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:657
edm::isFinite
constexpr bool isFinite(T x)
EgHLTOffHistBins_cfi.e2x5
e2x5
Definition: EgHLTOffHistBins_cfi.py:21
reco::Photon::regression2
Definition: Photon.h:314
GEDPhotonProducer::pfCandidates_
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidates_
Definition: GEDPhotonProducer.cc:112
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
EcalClusterToolsT::e1x3
static float e1x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:641
Cluster2ndMoments
Definition: EcalClusterTools.h:66
GEDPhotonProducer::phoPhotonIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoPhotonIsolationToken_
Definition: GEDPhotonProducer.cc:120
ElectronHcalHelper::Configuration::eThresHE
EgammaHcalIsolation::arrayHE eThresHE
Definition: ElectronHcalHelper.h:37
edm::InputTag
Definition: InputTag.h:15
GEDPhotonProducer::vertexProducer_
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
Definition: GEDPhotonProducer.cc:114
EgammaHcalIsolation::arrayHE
std::array< double, 7 > arrayHE
Definition: EgammaHcalIsolation.h:42
GEDPhotonProducer::runMIPTagger_
bool runMIPTagger_
Definition: GEDPhotonProducer.cc:149
reco::Photon::ShowerShape::e5x5
float e5x5
Definition: Photon.h:144