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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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, CaloTowerCollection const *hcalTowers, 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< CaloTowerCollectionhcalTowers_
 
double highEt_
 
double hOverEConeSize_
 
double maxHOverE_
 
double minR9Barrel_
 
double minR9Endcap_
 
double minSCEt_
 
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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 52 of file GEDPhotonProducer.cc.

Constructor & Destructor Documentation

◆ GEDPhotonProducer()

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

Definition at line 200 of file GEDPhotonProducer.cc.

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

Member Function Documentation

◆ beginRun()

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

Definition at line 330 of file GEDPhotonProducer.cc.

330  {
331  if (!recoStep_.isFinal()) {
332  photonEnergyCorrector_->init(eventSetup);
333  }
334 }

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

◆ endRun()

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

Definition at line 57 of file GEDPhotonProducer.cc.

57 {}

◆ 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 851 of file GEDPhotonProducer.cc.

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

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,
CaloTowerCollection const *  hcalTowers,
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 505 of file GEDPhotonProducer.cc.

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

References Cluster2ndMoments::alpha, barrelEcalHits_, caloGeom_, candidateP4type_, checkHcalStatus_, EcalClusterToolsT< noZS >::cluster2ndMoments(), EcalClusterToolsT< noZS >::covariances(), egamma::depth1HcalESum(), egamma::depth2HcalESum(), 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, reco::Photon::ShowerShape::eBottom, EcalClusterToolsT< noZS >::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, reco::Photon::ShowerShape::eTop, EcalClusterToolsT< noZS >::eTop(), flagsexclEB_, flagsexclEE_, HLT_FULL_cff::full5x5_sigmaIetaIeta, EcalClusterLazyToolsBase::ESGetTokens::get(), edm::EventSetup::get(), get, EgammaTowerIsolation::getTowerESum(), egamma::hasActiveHcal(), reco::Photon::ShowerShape::hcalDepth1OverEcal, reco::Photon::ShowerShape::hcalDepth1OverEcalBc, reco::Photon::ShowerShape::hcalDepth2OverEcal, reco::Photon::ShowerShape::hcalDepth2OverEcalBc, conversions_cfi::hcalTowers, hcalTowers_, reco::Photon::ShowerShape::hcalTowersBehindClusters, highEt_, hfClusterShapes_cfi::hits, hOverEConeSize_, 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_, 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, egamma::towersOf(), 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 336 of file GEDPhotonProducer.cc.

336  {
337  using namespace edm;
338 
339  auto outputPhotonCollection_p = std::make_unique<reco::PhotonCollection>();
340  edm::ValueMap<reco::PhotonRef> pfEGCandToPhotonMap;
341 
342  // Get the PhotonCore collection
343  bool validPhotonCoreHandle = false;
344  Handle<reco::PhotonCoreCollection> photonCoreHandle;
345  bool validPhotonHandle = false;
346  Handle<reco::PhotonCollection> photonHandle;
347  //value maps for isolation
348  edm::Handle<edm::ValueMap<float>> phoChargedIsolationMap;
349  edm::Handle<edm::ValueMap<float>> phoNeutralHadronIsolationMap;
350  edm::Handle<edm::ValueMap<float>> phoPhotonIsolationMap;
351  edm::Handle<edm::ValueMap<float>> phoChargedWorstVtxIsoMap;
352  edm::Handle<edm::ValueMap<float>> phoChargedWorstVtxGeomVetoIsoMap;
353  edm::Handle<edm::ValueMap<float>> phoChargedPFPVIsoMap;
354 
355  edm::Handle<edm::ValueMap<float>> phoPFECALClusIsolationMap;
356  edm::Handle<edm::ValueMap<float>> phoPFHCALClusIsolationMap;
357 
358  if (recoStep_.isFinal()) {
359  theEvent.getByToken(photonProducerT_, photonHandle);
360  //get isolation objects
361  theEvent.getByToken(phoChargedIsolationToken_, phoChargedIsolationMap);
362  theEvent.getByToken(phoNeutralHadronIsolationToken_, phoNeutralHadronIsolationMap);
363  theEvent.getByToken(phoPhotonIsolationToken_, phoPhotonIsolationMap);
364  theEvent.getByToken(phoChargedWorstVtxIsoToken_, phoChargedWorstVtxIsoMap);
365  theEvent.getByToken(phoChargedWorstVtxGeomVetoIsoToken_, phoChargedWorstVtxGeomVetoIsoMap);
366  theEvent.getByToken(phoChargedPFPVIsoToken_, phoChargedPFPVIsoMap);
367 
368  //OOT photons in legacy 80X re-miniAOD workflow dont have cluster isolation embed in them
370  theEvent.getByToken(phoPFECALClusIsolationToken_, phoPFECALClusIsolationMap);
371  }
373  theEvent.getByToken(phoPFHCALClusIsolationToken_, phoPFHCALClusIsolationMap);
374  }
375 
376  if (photonHandle.isValid()) {
377  validPhotonHandle = true;
378  } else {
379  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the product " << photonProducer_.label() << "\n";
380  }
381  } else {
382  theEvent.getByToken(photonCoreProducerT_, photonCoreHandle);
383  if (photonCoreHandle.isValid()) {
384  validPhotonCoreHandle = true;
385  } else {
386  throw cms::Exception("GEDPhotonProducer")
387  << "Error! Can't get the photonCoreProducer " << photonProducer_.label() << "\n";
388  }
389  }
390 
391  // Get EcalRecHits
392  auto const& barrelRecHits = theEvent.get(barrelEcalHits_);
393  auto const& endcapRecHits = theEvent.get(endcapEcalHits_);
394  auto const& preshowerRecHits = theEvent.get(preshowerHits_);
395 
396  Handle<reco::PFCandidateCollection> pfEGCandidateHandle;
397  // Get the PF refined cluster collection
399  theEvent.getByToken(pfEgammaCandidates_, pfEGCandidateHandle);
400  if (!pfEGCandidateHandle.isValid()) {
401  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the pfEgammaCandidates";
402  }
403  }
404 
405  Handle<reco::PFCandidateCollection> pfCandidateHandle;
406 
407  if (recoStep_.isFinal()) {
408  // Get the PF candidates collection
409  theEvent.getByToken(pfCandidates_, pfCandidateHandle);
410  //OOT photons have no PF candidates so its not an error in this case
411  if (!pfCandidateHandle.isValid() && !recoStep_.isOOT()) {
412  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the pfCandidates";
413  }
414  }
415 
416  // get Hcal towers collection
417  CaloTowerCollection const* hcalTowers = hcalTowers_.isUninitialized() ? nullptr : &theEvent.get(hcalTowers_);
418 
419  // get the geometry from the event setup:
420  caloGeom_ = &eventSetup.getData(caloGeometryToken_);
421 
422  auto const& topology = eventSetup.getData(caloTopologyToken_);
423  auto const& thresholds = eventSetup.getData(ecalPFRechitThresholdsToken_);
424 
425  // Get the primary event vertex
426  const reco::VertexCollection dummyVC;
427  auto const& vertexCollection{usePrimaryVertex_ ? theEvent.get(vertexProducer_) : dummyVC};
428 
429  // math::XYZPoint vtx(0.,0.,0.);
430  //if (vertexCollection.size()>0) vtx = vertexCollection.begin()->position();
431 
432  // get the regression calculator ready
433  photonEnergyCorrector_->init(eventSetup);
434  if (photonEnergyCorrector_->gedRegression()) {
435  photonEnergyCorrector_->gedRegression()->setEvent(theEvent);
436  photonEnergyCorrector_->gedRegression()->setEventContent(eventSetup);
437  }
438 
439  int iSC = 0; // index in photon collection
440  // Loop over barrel and endcap SC collections and fill the photon collection
441  if (validPhotonCoreHandle)
442  fillPhotonCollection(theEvent,
443  eventSetup,
444  photonCoreHandle,
445  &topology,
446  &barrelRecHits,
447  &endcapRecHits,
448  &preshowerRecHits,
449  hcalTowers,
450  //vtx,
452  *outputPhotonCollection_p,
453  iSC,
454  thresholds);
455 
456  iSC = 0;
457  if (validPhotonHandle && recoStep_.isFinal())
458  fillPhotonCollection(theEvent,
459  eventSetup,
460  photonHandle,
461  pfCandidateHandle,
462  pfEGCandidateHandle,
463  theEvent.get(vertexProducer_),
464  *outputPhotonCollection_p,
465  iSC,
466  phoChargedIsolationMap,
467  phoNeutralHadronIsolationMap,
468  phoPhotonIsolationMap,
469  phoChargedWorstVtxIsoMap,
470  phoChargedWorstVtxGeomVetoIsoMap,
471  phoChargedPFPVIsoMap,
472  phoPFECALClusIsolationMap,
473  phoPFHCALClusIsolationMap);
474 
475  // put the product in the event
476  edm::LogInfo("GEDPhotonProducer") << " Put in the event " << iSC << " Photon Candidates \n";
477  const auto photonOrphHandle = theEvent.put(std::move(outputPhotonCollection_p), photonCollection_);
478 
481  auto pfEGCandToPhotonMap_p = std::make_unique<edm::ValueMap<reco::PhotonRef>>();
482  edm::ValueMap<reco::PhotonRef>::Filler filler(*pfEGCandToPhotonMap_p);
483  unsigned nObj = pfEGCandidateHandle->size();
484  std::vector<reco::PhotonRef> values(nObj);
486  for (unsigned int lCand = 0; lCand < nObj; lCand++) {
487  reco::PFCandidateRef pfCandRef(reco::PFCandidateRef(pfEGCandidateHandle, lCand));
488  reco::SuperClusterRef pfScRef = pfCandRef->superClusterRef();
489 
490  for (unsigned int lSC = 0; lSC < photonOrphHandle->size(); lSC++) {
491  reco::PhotonRef photonRef(reco::PhotonRef(photonOrphHandle, lSC));
492  reco::SuperClusterRef scRef = photonRef->superCluster();
493  if (pfScRef != scRef)
494  continue;
495  values[lCand] = photonRef;
496  }
497  }
498 
499  filler.insert(pfEGCandidateHandle, values.begin(), values.end());
500  filler.fill();
501  theEvent.put(std::move(pfEGCandToPhotonMap_p), valueMapPFCandPhoton_);
502  }
503 }

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(), conversions_cfi::hcalTowers, hcalTowers_, 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 109 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ caloGeom_

CaloGeometry const* GEDPhotonProducer::caloGeom_ = nullptr
private

Definition at line 157 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ caloGeometryToken_

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

Definition at line 171 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ caloTopologyToken_

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

Definition at line 170 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ candidateP4type_

std::string GEDPhotonProducer::candidateP4type_
private

Definition at line 166 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ checkHcalStatus_

bool GEDPhotonProducer::checkHcalStatus_
private

Definition at line 168 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ ecalClusterESGetTokens_

const EcalClusterLazyTools::ESGetTokens GEDPhotonProducer::ecalClusterESGetTokens_
private

Definition at line 129 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ ecalPFRechitThresholdsToken_

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

Definition at line 172 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ endcapEcalHits_

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

Definition at line 110 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ flagsexclEB_

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

Definition at line 138 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ flagsexclEE_

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

Definition at line 139 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ hcalTowers_

edm::EDGetTokenT<CaloTowerCollection> GEDPhotonProducer::hcalTowers_
private

Definition at line 114 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ highEt_

double GEDPhotonProducer::highEt_
private

Definition at line 148 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ hOverEConeSize_

double GEDPhotonProducer::hOverEConeSize_
private

Definition at line 145 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ maxHOverE_

double GEDPhotonProducer::maxHOverE_
private

Definition at line 146 of file GEDPhotonProducer.cc.

◆ minR9Barrel_

double GEDPhotonProducer::minR9Barrel_
private

Definition at line 149 of file GEDPhotonProducer.cc.

◆ minR9Endcap_

double GEDPhotonProducer::minR9Endcap_
private

Definition at line 150 of file GEDPhotonProducer.cc.

◆ minSCEt_

double GEDPhotonProducer::minSCEt_
private

Definition at line 147 of file GEDPhotonProducer.cc.

◆ multThresEB_

double GEDPhotonProducer::multThresEB_
private

Definition at line 143 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ multThresEE_

double GEDPhotonProducer::multThresEE_
private

Definition at line 144 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ particleBasedIsolationToken

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

Definition at line 117 of file GEDPhotonProducer.cc.

◆ pfCandidates_

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

Definition at line 113 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ pfEgammaCandidates_

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

Definition at line 112 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoChargedIsolationToken_

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

Definition at line 119 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoChargedPFPVIsoToken_

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

Definition at line 124 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoChargedWorstVtxGeomVetoIsoToken_

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

Definition at line 123 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoChargedWorstVtxIsoToken_

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

Definition at line 122 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoNeutralHadronIsolationToken_

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

Definition at line 120 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ phoPFECALClusIsolationToken_

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

Definition at line 126 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ phoPFHCALClusIsolationToken_

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

Definition at line 127 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ phoPhotonIsolationToken_

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

Definition at line 121 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ photonCollection_

std::string GEDPhotonProducer::photonCollection_
private

Definition at line 104 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ photonCoreProducerT_

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

Definition at line 107 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ photonEnergyCorrector_

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

Definition at line 165 of file GEDPhotonProducer.cc.

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

◆ photonIsoCalculator_

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

Definition at line 133 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ photonMIPHaloTagger_

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

Definition at line 160 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ photonProducer_

const edm::InputTag GEDPhotonProducer::photonProducer_
private

Definition at line 105 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ photonProducerT_

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

Definition at line 108 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ preselCutValuesBarrel_

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

Definition at line 162 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ preselCutValuesEndcap_

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

Definition at line 163 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ preshowerHits_

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

Definition at line 111 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection(), and produce().

◆ recoStep_

RecoStepInfo GEDPhotonProducer::recoStep_
private

Definition at line 153 of file GEDPhotonProducer.cc.

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

◆ runMIPTagger_

bool GEDPhotonProducer::runMIPTagger_
private

Definition at line 151 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ severitiesexclEB_

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

Definition at line 140 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ severitiesexclEE_

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

Definition at line 141 of file GEDPhotonProducer.cc.

Referenced by fillPhotonCollection().

◆ usePrimaryVertex_

bool GEDPhotonProducer::usePrimaryVertex_
private

Definition at line 155 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ valueMapPFCandPhoton_

std::string GEDPhotonProducer::valueMapPFCandPhoton_
private

Definition at line 131 of file GEDPhotonProducer.cc.

Referenced by produce().

◆ vertexProducer_

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

Definition at line 115 of file GEDPhotonProducer.cc.

Referenced by produce().

EgHLTOffHistBins_cfi.e1x5
e1x5
Definition: EgHLTOffHistBins_cfi.py:22
reco::Photon::ShowerShape::eTop
float eTop
Definition: Photon.h:155
reco::Photon::ShowerShape::sigmaIphiIphi
float sigmaIphiIphi
Definition: Photon.h:153
reco::Photon::ShowerShape::maxEnergyXtal
float maxEnergyXtal
Definition: Photon.h:144
GEDPhotonProducer::preshowerHits_
edm::EDGetTokenT< EcalRecHitCollection > preshowerHits_
Definition: GEDPhotonProducer.cc:111
reco::Photon::ShowerShape::hcalDepth2OverEcalBc
float hcalDepth2OverEcalBc
Definition: Photon.h:148
reco::Photon::ShowerShape::eRight
float eRight
Definition: Photon.h:157
GEDPhotonProducer::valueMapPFCandPhoton_
std::string valueMapPFCandPhoton_
Definition: GEDPhotonProducer.cc:131
reco::Photon::ShowerShape::e2x5Left
float e2x5Left
Definition: Photon.h:162
reco::Photon::ShowerShape::sigmaEtaEta
float sigmaEtaEta
Definition: Photon.h:138
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:259
reco::Photon::ShowerShape::e1x5
float e1x5
Definition: Photon.h:140
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:172
HcalChannelQualityRcd
Definition: HcalChannelQualityRcd.h:8
reco::Photon::ShowerShape::e1x3
float e1x3
Definition: Photon.h:159
GEDPhotonProducer::caloTopologyToken_
const edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopologyToken_
Definition: GEDPhotonProducer.cc:170
reco::Photon::FiducialFlags::isEE
bool isEE
Definition: Photon.h:96
HLT_FULL_cff.endcapRecHits
endcapRecHits
Definition: HLT_FULL_cff.py:14920
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
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:154
edm
HLT enums.
Definition: AlignableModifier.h:19
GEDPhotonProducer::multThresEB_
double multThresEB_
Definition: GEDPhotonProducer.cc:143
gedPhotons_cfi.mipVariableSet
mipVariableSet
Definition: gedPhotons_cfi.py:36
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:165
HLT_FULL_cff.barrelRecHits
barrelRecHits
Definition: HLT_FULL_cff.py:14923
reco::Photon::ShowerShape::e2x2
float e2x2
Definition: Photon.h:160
reco::Photon::ShowerShape::invalidHcal
bool invalidHcal
Definition: Photon.h:150
reco::Photon::SaturationInfo
Definition: Photon.h:258
reco::Photon::PflowIsolationVariables::chargedHadronPFPVIso
float chargedHadronPFPVIso
Definition: Photon.h:463
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:124
reco::Photon::PflowIsolationVariables::chargedHadronIso
float chargedHadronIso
Definition: Photon.h:460
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
reco::Photon::ShowerShape::eBottom
float eBottom
Definition: Photon.h:158
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
egamma::depth2HcalESum
double depth2HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
Definition: EgammaHadTower.cc:83
edm::Handle
Definition: AssociativeIterator.h:50
GEDPhotonProducer::photonCollection_
std::string photonCollection_
Definition: GEDPhotonProducer.cc:104
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
GEDPhotonProducer::flagsexclEB_
std::vector< int > flagsexclEB_
Definition: GEDPhotonProducer.cc:138
reco::Photon::PflowIsolationVariables::neutralHadronIso
float neutralHadronIso
Definition: Photon.h:464
EcalBarrel
Definition: EcalSubdetector.h:10
edm::Ref< PhotonCollection >
reco::Photon::ShowerShape::e2x5Bottom
float e2x5Bottom
Definition: Photon.h:165
reco::Photon::PflowIsolationVariables::chargedHadronWorstVtxGeomVetoIso
float chargedHadronWorstVtxGeomVetoIso
Definition: Photon.h:462
config
Definition: config.py:1
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
DetId
Definition: DetId.h:17
GEDPhotonProducer::caloGeom_
CaloGeometry const * caloGeom_
Definition: GEDPhotonProducer.cc:157
GEDPhotonProducer::photonCoreProducerT_
edm::EDGetTokenT< reco::PhotonCoreCollection > photonCoreProducerT_
Definition: GEDPhotonProducer.cc:107
reco::Photon::PflowIsolationVariables
Definition: Photon.h:459
reco::Photon::ShowerShape::sigmaIetaIphi
float sigmaIetaIphi
Definition: Photon.h:152
GEDPhotonProducer::flagsexclEE_
std::vector< int > flagsexclEE_
Definition: GEDPhotonProducer.cc:139
reco::Photon::ecal_photons
Definition: Photon.h:273
GEDPhotonProducer::recoStep_
RecoStepInfo recoStep_
Definition: GEDPhotonProducer.cc:153
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:156
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:110
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:168
GEDPhotonProducer::pfEgammaCandidates_
edm::EDGetTokenT< reco::PFCandidateCollection > pfEgammaCandidates_
Definition: GEDPhotonProducer.cc:112
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
edm::ESHandle< CaloTowerConstituentsMap >
reco::Photon::ShowerShape::smMajor
float smMajor
Definition: Photon.h:166
GEDPhotonProducer::severitiesexclEE_
std::vector< int > severitiesexclEE_
Definition: GEDPhotonProducer.cc:141
GEDPhotonProducer::minR9Endcap_
double minR9Endcap_
Definition: GEDPhotonProducer.cc:150
Cluster2ndMoments::alpha
float alpha
Definition: EcalClusterTools.h:71
reco::Photon::ShowerShape::hcalDepth1OverEcalBc
float hcalDepth1OverEcalBc
Definition: Photon.h:147
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:163
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
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:123
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEDPhotonProducer::photonIsoCalculator_
std::unique_ptr< PhotonIsolationCalculator > photonIsoCalculator_
Definition: GEDPhotonProducer.cc:133
GEDPhotonProducer::phoChargedIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedIsolationToken_
Definition: GEDPhotonProducer.cc:119
EcalEndcap
Definition: EcalSubdetector.h:10
EgammaLocalCovParamDefaults::kRelEnCut
static constexpr float kRelEnCut
Definition: EgammaLocalCovParamDefaults.h:5
reco::Photon::ShowerShape::effSigmaRR
float effSigmaRR
Definition: Photon.h:151
GEDPhotonProducer::phoPFHCALClusIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoPFHCALClusIsolationToken_
Definition: GEDPhotonProducer.cc:127
egamma::towersOf
std::vector< CaloTowerDetId > towersOf(reco::SuperCluster const &sc, CaloTowerConstituentsMap const &towerMap, HoeMode mode=HoeMode::SingleTower)
Definition: EgammaHadTower.cc:25
IOMC_cff.ecalRecHit
ecalRecHit
Definition: IOMC_cff.py:103
GEDPhotonProducer::photonProducerT_
edm::EDGetTokenT< reco::PhotonCollection > photonProducerT_
Definition: GEDPhotonProducer.cc:108
reco::Photon::PflowIsolationVariables::chargedHadronWorstVtxIso
float chargedHadronWorstVtxIso
Definition: Photon.h:461
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:161
reco::Photon::ShowerShape::hcalDepth2OverEcal
float hcalDepth2OverEcal
Definition: Photon.h:146
GEDPhotonProducer::barrelEcalHits_
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
Definition: GEDPhotonProducer.cc:109
reco::Photon::ShowerShape::e2x5Top
float e2x5Top
Definition: Photon.h:164
GEDPhotonProducer::RecoStepInfo::isOOT
bool isOOT() const
Definition: GEDPhotonProducer.cc:66
reco::Photon::ShowerShape::sigmaIetaIeta
float sigmaIetaIeta
Definition: Photon.h:139
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:166
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:141
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
reco::Photon::ShowerShape::smMinor
float smMinor
Definition: Photon.h:167
reco::Photon::FiducialFlags
Definition: Photon.h:93
EgammaTowerIsolation
Definition: EgammaTowerIsolation.h:197
GEDPhotonProducer::severitiesexclEB_
std::vector< int > severitiesexclEB_
Definition: GEDPhotonProducer.cc:140
GEDPhotonProducer::hOverEConeSize_
double hOverEConeSize_
Definition: GEDPhotonProducer.cc:145
createfilelist.int
int
Definition: createfilelist.py:10
p4
double p4[4]
Definition: TauolaWrapper.h:92
GEDPhotonProducer::minR9Barrel_
double minR9Barrel_
Definition: GEDPhotonProducer.cc:149
DetId::Detector
Detector
Definition: DetId.h:24
EcalClusterToolsT::e2nd
static float e2nd(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
Definition: EcalClusterTools.h:560
gedPhotons_cfi.isolationSumsCalculatorSet
isolationSumsCalculatorSet
Definition: gedPhotons_cfi.py:34
GEDPhotonProducer::ecalClusterESGetTokens_
const EcalClusterLazyTools::ESGetTokens ecalClusterESGetTokens_
Definition: GEDPhotonProducer.cc:129
get
#define get
reco::Photon::IsolationVariables
Definition: Photon.h:358
reco::CaloCluster::seed
DetId seed() const
return DetId of seed
Definition: CaloCluster.h:219
GEDPhotonProducer::photonProducer_
const edm::InputTag photonProducer_
Definition: GEDPhotonProducer.cc:105
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:126
GEDPhotonProducer::phoNeutralHadronIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoNeutralHadronIsolationToken_
Definition: GEDPhotonProducer.cc:120
EcalClusterToolsT::e2x5Right
static float e2x5Right(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:574
conversions_cfi.hcalTowers
hcalTowers
Definition: conversions_cfi.py:21
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:171
gedPhotonSequence_cff.pfIsolCfg
pfIsolCfg
Definition: gedPhotonSequence_cff.py:29
reco::Photon
Definition: Photon.h:21
reco::Photon::ShowerShape::hcalTowersBehindClusters
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: Photon.h:149
GEDPhotonProducer::phoChargedWorstVtxIsoToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedWorstVtxIsoToken_
Definition: GEDPhotonProducer.cc:122
reco::Photon::ShowerShape
Definition: Photon.h:137
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
GEDPhotonProducer::checkHcalStatus_
bool checkHcalStatus_
Definition: GEDPhotonProducer.cc:168
reco::Photon::PflowIDVariables
Definition: Photon.h:499
GEDPhotonProducer::photonMIPHaloTagger_
std::unique_ptr< PhotonMIPHaloTagger > photonMIPHaloTagger_
Definition: GEDPhotonProducer.cc:160
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
gedPhotons_cfi.outputPhotonCollection
outputPhotonCollection
Definition: gedPhotons_cfi.py: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
egamma::depth1HcalESum
double depth1HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
Definition: EgammaHadTower.cc:73
GEDPhotonProducer::usePrimaryVertex_
bool usePrimaryVertex_
Definition: GEDPhotonProducer.cc:155
HLT_FULL_cff.full5x5_sigmaIetaIeta
full5x5_sigmaIetaIeta
Definition: HLT_FULL_cff.py:13706
reco::Photon::ShowerShape::hcalDepth1OverEcal
float hcalDepth1OverEcal
Definition: Photon.h:145
ptFast
double ptFast(const double energy, const math::XYZPoint &position, const math::XYZPoint &origin)
Definition: SuperClusterImporter.cc:13
reco::Photon::regression1
Definition: Photon.h:273
reco::Photon::SaturationInfo::isSeedSaturated
bool isSeedSaturated
Definition: Photon.h:260
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:67
reco::Photon::PflowIsolationVariables::photonIso
float photonIso
Definition: Photon.h:465
reco::Photon::MIPVariables
Definition: Photon.h:324
Cluster2ndMoments::sMin
float sMin
Definition: EcalClusterTools.h:69
reco::Photon::ShowerShape::e3x3
float e3x3
Definition: Photon.h:142
GEDPhotonProducer::preselCutValuesEndcap_
std::vector< double > preselCutValuesEndcap_
Definition: GEDPhotonProducer.cc:163
GEDPhotonProducer::multThresEE_
double multThresEE_
Definition: GEDPhotonProducer.cc:144
reco::Photon::PflowIsolationVariables::sumEcalClusterEt
float sumEcalClusterEt
Definition: Photon.h:466
GEDPhotonProducer::preselCutValuesBarrel_
std::vector< double > preselCutValuesBarrel_
Definition: GEDPhotonProducer.cc:162
egamma::hasActiveHcal
bool hasActiveHcal(std::vector< CaloTowerDetId > const &towers, CaloTowerConstituentsMap const &towerMap, HcalChannelQuality const &hcalQuality, HcalTopology const &hcalTopology)
Definition: EgammaHadTower.cc:93
electronIdCutBasedExt_cfi.sigmaEtaEta
sigmaEtaEta
Definition: electronIdCutBasedExt_cfi.py:123
reco::Photon::PflowIsolationVariables::sumHcalClusterEt
float sumHcalClusterEt
Definition: Photon.h:467
GEDPhotonProducer::highEt_
double highEt_
Definition: GEDPhotonProducer.cc:148
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, CaloTowerCollection const *hcalTowers, const reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC, EcalPFRecHitThresholds const &thresholds)
Definition: GEDPhotonProducer.cc:505
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:273
GEDPhotonProducer::pfCandidates_
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidates_
Definition: GEDPhotonProducer.cc:113
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
GEDPhotonProducer::hcalTowers_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
Definition: GEDPhotonProducer.cc:114
Cluster2ndMoments
Definition: EcalClusterTools.h:66
GEDPhotonProducer::phoPhotonIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoPhotonIsolationToken_
Definition: GEDPhotonProducer.cc:121
edm::InputTag
Definition: InputTag.h:15
GEDPhotonProducer::vertexProducer_
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
Definition: GEDPhotonProducer.cc:115
GEDPhotonProducer::runMIPTagger_
bool runMIPTagger_
Definition: GEDPhotonProducer.cc:151
reco::Photon::ShowerShape::e5x5
float e5x5
Definition: Photon.h:143