CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
GsfElectronBaseProducer Class Reference

#include <GsfElectronBaseProducer.h>

Inheritance diagram for GsfElectronBaseProducer:
edm::stream::EDProducer< edm::GlobalCache< gsfAlgoHelpers::HeavyObjectCache > > GEDGsfElectronProducer GsfElectronEcalDrivenProducer GsfElectronProducer LowPtGsfElectronProducer

Public Member Functions

 GsfElectronBaseProducer (const edm::ParameterSet &, const gsfAlgoHelpers::HeavyObjectCache *)
 
 ~GsfElectronBaseProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< gsfAlgoHelpers::HeavyObjectCache > >
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
static void globalEndJob (gsfAlgoHelpers::HeavyObjectCache const *)
 
static std::unique_ptr< gsfAlgoHelpers::HeavyObjectCacheinitializeGlobalCache (const edm::ParameterSet &conf)
 

Protected Member Functions

void beginEvent (edm::Event &, const edm::EventSetup &)
 
void fillEvent (reco::GsfElectronCollection &electrons, edm::Event &event)
 
const edm::OrphanHandle< reco::GsfElectronCollection > & orphanHandle () const
 

Protected Attributes

GsfElectronAlgoalgo_
 
const GsfElectronAlgo::CutsConfiguration cutsCfg_
 
const GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
 
ElectronHcalHelper::Configuration hcalCfg_
 
ElectronHcalHelper::Configuration hcalCfgPflow_
 
GsfElectronAlgo::InputTagsConfiguration inputCfg_
 
edm::EDGetTokenT< edm::ValueMap< float > > pfMVA_
 
GsfElectronAlgo::StrategyConfiguration strategyCfg_
 

Private Member Functions

void checkEcalSeedingParameters (edm::ParameterSet const &)
 
bool isPreselected (reco::GsfElectron const &ele) const
 
void setAmbiguityData (reco::GsfElectronCollection &electrons, edm::Event const &event, bool ignoreNotPreselected=true) const
 

Private Attributes

bool ecalSeedingParametersChecked_
 
const edm::EDPutTokenT< reco::GsfElectronCollectionelectronPutToken_
 
edm::OrphanHandle< reco::GsfElectronCollectionorphanHandle_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< gsfAlgoHelpers::HeavyObjectCache > >
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

Definition at line 29 of file GsfElectronBaseProducer.h.

Constructor & Destructor Documentation

GsfElectronBaseProducer::GsfElectronBaseProducer ( const edm::ParameterSet cfg,
const gsfAlgoHelpers::HeavyObjectCache  
)
explicit

Definition at line 240 of file GsfElectronBaseProducer.cc.

References GsfElectronAlgo::StrategyConfiguration::addPflowElectrons, algo_, GsfElectronAlgo::StrategyConfiguration::ambClustersOverlapStrategy, GsfElectronAlgo::StrategyConfiguration::ambSortingStrategy, GsfElectronAlgo::StrategyConfiguration::applyAmbResolution, GsfElectronAlgo::StrategyConfiguration::applyPreselection, GsfElectronAlgo::InputTagsConfiguration::barrelRecHitCollection, GsfElectronAlgo::InputTagsConfiguration::beamSpotTag, ElectronHcalHelper::Configuration::checkHcalStatus, gedGsfElectrons_cfi::combinationRegressionWeightLabels, GsfElectronAlgo::InputTagsConfiguration::conversions, GsfElectronAlgo::InputTagsConfiguration::ctfTracks, GsfElectronAlgo::StrategyConfiguration::ctfTracksCheck, cutsCfg_, cutsCfgPflow_, GsfElectronAlgo::StrategyConfiguration::ecalDrivenEcalEnergyFromClassBasedParameterization, GsfElectronAlgo::StrategyConfiguration::ecalDrivenEcalErrorFromClassBasedParameterization, RegressionHelper::Configuration::ecalRegressionWeightLabels, GsfElectronAlgo::InputTagsConfiguration::edIsoVals, GsfElectronAlgo::InputTagsConfiguration::endcapRecHitCollection, electronEcalRecHitIsolationLcone_cfi::etMinBarrel, GsfElectronAlgo::StrategyConfiguration::fillConvVtxFitProb, GsfElectronAlgo::StrategyConfiguration::gedElectronMode, reco::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), GsfElectronAlgo::InputTagsConfiguration::gsfElectronCores, GsfElectronAlgo::InputTagsConfiguration::gsfPfRecTracksTag, hcalCfg_, hcalCfgPflow_, ElectronHcalHelper::Configuration::hcalTowers, GsfElectronAlgo::InputTagsConfiguration::hcalTowersTag, ElectronHcalHelper::Configuration::hOverEConeSize, ElectronHcalHelper::Configuration::hOverEPtMin, inputCfg_, GsfElectronAlgo::IsolationConfiguration::intRadiusHcal, GsfElectronAlgo::StrategyConfiguration::MaxElePtForOnlyMVA, dataset::name, GsfElectronAlgo::InputTagsConfiguration::pfIsoVals, GsfElectronAlgo::InputTagsConfiguration::pflowGsfElectronsTag, pfMVA_, GsfElectronAlgo::StrategyConfiguration::PreSelectMVA, GsfElectronAlgo::InputTagsConfiguration::previousGsfElectrons, GsfElectronAlgo::StrategyConfiguration::pureTrackerDrivenEcalErrorFromSimpleParameterization, GsfElectronAlgo::InputTagsConfiguration::seedsTag, strategyCfg_, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, funct::true, GsfElectronAlgo::StrategyConfiguration::useCombinationRegression, GsfElectronAlgo::StrategyConfiguration::useEcalRegression, GsfElectronAlgo::StrategyConfiguration::useGsfPfRecTracks, ElectronHcalHelper::Configuration::useTowers, electronEcalRecHitIsolationLcone_cfi::vetoClustered, and GsfElectronAlgo::InputTagsConfiguration::vtxCollectionTag.

241  : cutsCfg_(makeCutsConfiguration(cfg.getParameter<edm::ParameterSet>("preselection")))
242  , cutsCfgPflow_(makeCutsConfiguration(cfg.getParameter<edm::ParameterSet>("preselectionPflow")))
244  , electronPutToken_(produces<GsfElectronCollection>())
245 {
246  inputCfg_.previousGsfElectrons = consumes<reco::GsfElectronCollection>(cfg.getParameter<edm::InputTag>("previousGsfElectronsTag"));
247  inputCfg_.pflowGsfElectronsTag = consumes<reco::GsfElectronCollection>(cfg.getParameter<edm::InputTag>("pflowGsfElectronsTag"));
248  inputCfg_.gsfElectronCores = consumes<reco::GsfElectronCoreCollection>(cfg.getParameter<edm::InputTag>("gsfElectronCoresTag"));
249  inputCfg_.hcalTowersTag = consumes<CaloTowerCollection>(cfg.getParameter<edm::InputTag>("hcalTowers"));
250  inputCfg_.barrelRecHitCollection = consumes<EcalRecHitCollection>(cfg.getParameter<edm::InputTag>("barrelRecHitCollectionTag"));
251  inputCfg_.endcapRecHitCollection = consumes<EcalRecHitCollection>(cfg.getParameter<edm::InputTag>("endcapRecHitCollectionTag"));
252  pfMVA_ = consumes<edm::ValueMap<float> >(cfg.getParameter<edm::InputTag>("pfMvaTag"));
253  inputCfg_.ctfTracks = consumes<reco::TrackCollection>(cfg.getParameter<edm::InputTag>("ctfTracksTag"));
254  inputCfg_.seedsTag = consumes<reco::ElectronSeedCollection>(cfg.getParameter<edm::InputTag>("seedsTag")); // used to check config consistency with seeding
255  inputCfg_.beamSpotTag = consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamSpotTag"));
256  inputCfg_.gsfPfRecTracksTag = consumes<reco::GsfPFRecTrackCollection>(cfg.getParameter<edm::InputTag>("gsfPfRecTracksTag"));
257  inputCfg_.vtxCollectionTag = consumes<reco::VertexCollection>(cfg.getParameter<edm::InputTag>("vtxTag"));
258  if(cfg.getParameter<bool>("fillConvVtxFitProb") ) inputCfg_.conversions = consumes<reco::ConversionCollection>(cfg.getParameter<edm::InputTag>("conversionsTag"));
259 
260  if ( cfg.getParameter<bool>("useIsolationValues") ) {
261  inputCfg_.pfIsoVals = cfg.getParameter<edm::ParameterSet> ("pfIsolationValues");
264  mayConsume<edm::ValueMap<double> >(tag);
265  }
266 
267  inputCfg_.edIsoVals = cfg.getParameter<edm::ParameterSet> ("edIsolationValues");
270  mayConsume<edm::ValueMap<double> >(tag);
271  }
272  }
273 
274  strategyCfg_.useGsfPfRecTracks = cfg.getParameter<bool>("useGsfPfRecTracks") ;
275  strategyCfg_.applyPreselection = cfg.getParameter<bool>("applyPreselection") ;
276  strategyCfg_.ecalDrivenEcalEnergyFromClassBasedParameterization = cfg.getParameter<bool>("ecalDrivenEcalEnergyFromClassBasedParameterization") ;
277  strategyCfg_.ecalDrivenEcalErrorFromClassBasedParameterization = cfg.getParameter<bool>("ecalDrivenEcalErrorFromClassBasedParameterization") ;
278  strategyCfg_.pureTrackerDrivenEcalErrorFromSimpleParameterization = cfg.getParameter<bool>("pureTrackerDrivenEcalErrorFromSimpleParameterization") ;
279  strategyCfg_.applyAmbResolution = cfg.getParameter<bool>("applyAmbResolution") ;
280  strategyCfg_.ambSortingStrategy = cfg.getParameter<unsigned>("ambSortingStrategy") ;
281  strategyCfg_.ambClustersOverlapStrategy = cfg.getParameter<unsigned>("ambClustersOverlapStrategy") ;
282  strategyCfg_.addPflowElectrons = cfg.getParameter<bool>("addPflowElectrons") ;
283  strategyCfg_.ctfTracksCheck = cfg.getParameter<bool>("ctfTracksCheck");
284  strategyCfg_.gedElectronMode = cfg.getParameter<bool>("gedElectronMode");
285  strategyCfg_.PreSelectMVA = cfg.getParameter<double>("PreSelectMVA");
286  strategyCfg_.MaxElePtForOnlyMVA = cfg.getParameter<double>("MaxElePtForOnlyMVA");
287  strategyCfg_.useEcalRegression = cfg.getParameter<bool>("useEcalRegression");
288  strategyCfg_.useCombinationRegression = cfg.getParameter<bool>("useCombinationRegression");
289  strategyCfg_.fillConvVtxFitProb = cfg.getParameter<bool>("fillConvVtxFitProb");
290 
291  // hcal helpers
292  auto const& psetPreselection = cfg.getParameter<edm::ParameterSet>("preselection");
293  hcalCfg_.hOverEConeSize = psetPreselection.getParameter<double>("hOverEConeSize") ;
294  if (hcalCfg_.hOverEConeSize>0)
295  {
297  hcalCfg_.checkHcalStatus = cfg.getParameter<bool>("checkHcalStatus") ;
298  hcalCfg_.hcalTowers = consumes<CaloTowerCollection>(cfg.getParameter<edm::InputTag>("hcalTowers")) ;
299  hcalCfg_.hOverEPtMin = psetPreselection.getParameter<double>("hOverEPtMin") ;
300  }
301  auto const& psetPreselectionPflow = cfg.getParameter<edm::ParameterSet>("preselectionPflow");
302  hcalCfgPflow_.hOverEConeSize = psetPreselectionPflow.getParameter<double>("hOverEConeSize") ;
304  {
306  hcalCfgPflow_.checkHcalStatus = cfg.getParameter<bool>("checkHcalStatus") ;
307  hcalCfgPflow_.hcalTowers = consumes<CaloTowerCollection>(cfg.getParameter<edm::InputTag>("hcalTowers")) ;
308  hcalCfgPflow_.hOverEPtMin = psetPreselectionPflow.getParameter<double>("hOverEPtMin") ;
309  }
310 
311  // Ecal rec hits configuration
313  const std::vector<std::string> flagnamesbarrel = cfg.getParameter<std::vector<std::string> >("recHitFlagsToBeExcludedBarrel");
314  recHitsCfg.recHitFlagsToBeExcludedBarrel = StringToEnumValue<EcalRecHit::Flags>(flagnamesbarrel);
315  const std::vector<std::string> flagnamesendcaps = cfg.getParameter<std::vector<std::string> >("recHitFlagsToBeExcludedEndcaps");
316  recHitsCfg.recHitFlagsToBeExcludedEndcaps = StringToEnumValue<EcalRecHit::Flags>(flagnamesendcaps);
317  const std::vector<std::string> severitynamesbarrel = cfg.getParameter<std::vector<std::string> >("recHitSeverityToBeExcludedBarrel");
318  recHitsCfg.recHitSeverityToBeExcludedBarrel = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesbarrel);
319  const std::vector<std::string> severitynamesendcaps = cfg.getParameter<std::vector<std::string> >("recHitSeverityToBeExcludedEndcaps");
320  recHitsCfg.recHitSeverityToBeExcludedEndcaps = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesendcaps);
321  //recHitsCfg.severityLevelCut = cfg.getParameter<int>("severityLevelCut") ;
322 
323  // isolation
325  .intRadiusHcal = cfg.getParameter<double>("intRadiusHcal"),
326  .etMinHcal = cfg.getParameter<double>("etMinHcal"),
327  .intRadiusEcalBarrel = cfg.getParameter<double>("intRadiusEcalBarrel"),
328  .intRadiusEcalEndcaps = cfg.getParameter<double>("intRadiusEcalEndcaps"),
329  .jurassicWidth = cfg.getParameter<double>("jurassicWidth"),
330  .etMinBarrel = cfg.getParameter<double>("etMinBarrel"),
331  .eMinBarrel = cfg.getParameter<double>("eMinBarrel"),
332  .etMinEndcaps = cfg.getParameter<double>("etMinEndcaps"),
333  .eMinEndcaps = cfg.getParameter<double>("eMinEndcaps"),
334  .vetoClustered = cfg.getParameter<bool>("vetoClustered"),
335  .useNumCrystals = cfg.getParameter<bool>("useNumCrystals")
336  };
337 
338  const RegressionHelper::Configuration regressionCfg{
339  .ecalRegressionWeightLabels = cfg.getParameter<std::vector<std::string> >("ecalRefinedRegressionWeightLabels"),
340  .ecalWeightsFromDB = cfg.getParameter<bool>("ecalWeightsFromDB"),
341  .ecalRegressionWeightFiles = cfg.getParameter<std::vector<std::string> >("ecalRefinedRegressionWeightFiles"),
342  .combinationRegressionWeightLabels = cfg.getParameter<std::vector<std::string> >("combinationRegressionWeightLabels"),
343  .combinationWeightsFromDB = cfg.getParameter<bool>("combinationWeightsFromDB"),
344  .combinationRegressionWeightFiles = cfg.getParameter<std::vector<std::string> >("combinationRegressionWeightFile")
345  };
346 
347  // functions for corrector
348  EcalClusterFunctionBaseClass * const superClusterErrorFunction =
349  EcalClusterFunctionFactory::get()->create(cfg.getParameter<std::string>("superClusterErrorFunction"),cfg);
350  EcalClusterFunctionBaseClass * const crackCorrectionFunction =
351  EcalClusterFunctionFactory::get()->create(cfg.getParameter<std::string>("crackCorrectionFunction"),cfg) ;
352 
353  // create algo
354  algo_ = new GsfElectronAlgo
358  isoCfg,recHitsCfg,
359  superClusterErrorFunction,
360  crackCorrectionFunction,
361  regressionCfg,
362  cfg.getParameter<edm::ParameterSet>("trkIsol03Cfg"),
363  cfg.getParameter<edm::ParameterSet>("trkIsol04Cfg"),
364  cfg.getParameter<edm::ParameterSet>("trkIsolHEEP03Cfg"),
365  cfg.getParameter<edm::ParameterSet>("trkIsolHEEP04Cfg")
366  ) ;
367  }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::GsfElectronCoreCollection > gsfElectronCores
std::vector< std::string > ecalRegressionWeightLabels
edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons
edm::EDGetTokenT< reco::VertexCollection > vtxCollectionTag
edm::EDGetTokenT< EcalRecHitCollection > endcapRecHitCollection
edm::EDGetTokenT< reco::GsfElectronCollection > pflowGsfElectronsTag
edm::EDGetTokenT< EcalRecHitCollection > barrelRecHitCollection
edm::EDGetTokenT< reco::GsfPFRecTrackCollection > gsfPfRecTracksTag
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:169
edm::EDGetTokenT< reco::ConversionCollection > conversions
GsfElectronAlgo::InputTagsConfiguration inputCfg_
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsTag
ElectronHcalHelper::Configuration hcalCfg_
edm::EDGetTokenT< CaloTowerCollection > hcalTowersTag
ElectronHcalHelper::Configuration hcalCfgPflow_
edm::EDGetTokenT< reco::TrackCollection > ctfTracks
GsfElectronAlgo::StrategyConfiguration strategyCfg_
edm::EDGetTokenT< edm::ValueMap< float > > pfMVA_
const edm::EDPutTokenT< reco::GsfElectronCollection > electronPutToken_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers
const GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
T get(const Candidate &c)
Definition: component.h:55
const GsfElectronAlgo::CutsConfiguration cutsCfg_
GsfElectronBaseProducer::~GsfElectronBaseProducer ( )
override

Definition at line 369 of file GsfElectronBaseProducer.cc.

References algo_.

369 { delete algo_ ; }

Member Function Documentation

void GsfElectronBaseProducer::beginEvent ( edm::Event event,
const edm::EventSetup setup 
)
protected

Definition at line 371 of file GsfElectronBaseProducer.cc.

References checkEcalSeedingParameters(), ecalSeedingParametersChecked_, inputCfg_, edm::HandleBase::isValid(), edm::parameterSet(), edm::HandleBase::provenance(), GsfElectronAlgo::InputTagsConfiguration::seedsTag, and funct::true.

Referenced by GsfElectronProducer::beginEvent().

372  {
373  // check configuration
375  {
378  event.getByToken(inputCfg_.seedsTag,seeds) ;
379  if (!seeds.isValid())
380  {
381  edm::LogWarning("GsfElectronAlgo|UnreachableSeedsProvenance")
382  <<"Cannot check consistency of parameters with ecal seeding ones,"
383  <<" because the original collection of seeds is not any more available." ;
384  }
385  else
386  {
388  }
389  }
390  }
void checkEcalSeedingParameters(edm::ParameterSet const &)
GsfElectronAlgo::InputTagsConfiguration inputCfg_
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsTag
bool isValid() const
Definition: HandleBase.h:74
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
Provenance const * provenance() const
Definition: HandleBase.h:83
void GsfElectronBaseProducer::checkEcalSeedingParameters ( edm::ParameterSet const &  pset)
private

Definition at line 416 of file GsfElectronBaseProducer.cc.

References cutsCfg_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), hcalCfg_, ElectronHcalHelper::Configuration::hOverEConeSize, GsfElectronAlgo::CutsConfiguration::maxHOverEBarrelCone, GsfElectronAlgo::CutsConfiguration::maxHOverEEndcapsCone, GsfElectronAlgo::CutsConfiguration::minSCEtBarrel, and GsfElectronAlgo::CutsConfiguration::minSCEtEndcaps.

Referenced by beginEvent().

417  {
418  if ( !pset.exists("SeedConfiguration") ) { return; }
419  edm::ParameterSet seedConfiguration = pset.getParameter<edm::ParameterSet>("SeedConfiguration") ;
420 
421  if (seedConfiguration.getParameter<bool>("applyHOverECut"))
422  {
423  if ((hcalCfg_.hOverEConeSize!=0)&&(hcalCfg_.hOverEConeSize!=seedConfiguration.getParameter<double>("hOverEConeSize")))
424  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The H/E cone size ("<<hcalCfg_.hOverEConeSize<<") is different from ecal seeding ("<<seedConfiguration.getParameter<double>("hOverEConeSize")<<")." ; }
425  if (cutsCfg_.maxHOverEBarrelCone<seedConfiguration.getParameter<double>("maxHOverEBarrel"))
426  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The max barrel cone H/E is lower than during ecal seeding." ; }
427  if (cutsCfg_.maxHOverEEndcapsCone<seedConfiguration.getParameter<double>("maxHOverEEndcaps"))
428  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The max endcaps cone H/E is lower than during ecal seeding." ; }
429  }
430 
431  if (cutsCfg_.minSCEtBarrel<seedConfiguration.getParameter<double>("SCEtCut"))
432  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The minimum super-cluster Et in barrel is lower than during ecal seeding." ; }
433  if (cutsCfg_.minSCEtEndcaps<seedConfiguration.getParameter<double>("SCEtCut"))
434  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The minimum super-cluster Et in endcaps is lower than during ecal seeding." ; }
435  }
T getParameter(std::string const &) const
ElectronHcalHelper::Configuration hcalCfg_
const GsfElectronAlgo::CutsConfiguration cutsCfg_
void GsfElectronBaseProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 48 of file GsfElectronBaseProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSet::getParameter(), gedGsfElectrons_cfi::maxDeltaEtaEndcaps, gedGsfElectrons_cfi::maxDeltaPhiEndcaps, Reconstruction_hiPF_cff::maxEOverPEndcaps, gedGsfElectrons_cfi::maxHOverEEndcapsCone, gedGsfElectrons_cfi::maxHOverEEndcapsTower, gsfElectrons_cfi::minMVA, GsfElectronAlgo::CutsConfiguration::minSCEtBarrel, gedGsfElectrons_cfi::minSCEtEndcaps, muonDTDigis_cfi::pset, EleTkIsolFromCands::pSetDescript(), and AlCaHLTBitMon_QueryRunRegistry::string.

49 {
51  // input collections
52  desc.add<edm::InputTag>("gsfElectronCoresTag", edm::InputTag("gedGsfElectronCores"));
53  desc.add<edm::InputTag>("pflowGsfElectronsTag", edm::InputTag(""));
54  desc.add<edm::InputTag>("pfMvaTag", edm::InputTag(""));
55  desc.add<edm::InputTag>("previousGsfElectronsTag", edm::InputTag(""));
56  desc.add<edm::InputTag>("hcalTowers", edm::InputTag("towerMaker"));
57  desc.add<edm::InputTag>("vtxTag", edm::InputTag("offlinePrimaryVertices"));
58  desc.add<edm::InputTag>("conversionsTag", edm::InputTag("allConversions"));
59  desc.add<edm::InputTag>("gsfPfRecTracksTag", edm::InputTag("pfTrackElec"));
60  desc.add<edm::InputTag>("barrelRecHitCollectionTag", edm::InputTag("ecalRecHit","EcalRecHitsEB"));
61  desc.add<edm::InputTag>("endcapRecHitCollectionTag", edm::InputTag("ecalRecHit","EcalRecHitsEE"));
62  desc.add<edm::InputTag>("seedsTag", edm::InputTag("ecalDrivenElectronSeeds"));
63  desc.add<edm::InputTag>("beamSpotTag", edm::InputTag("offlineBeamSpot"));
64  desc.add<edm::InputTag>("egmPFCandidatesTag", edm::InputTag("particleFlowEGamma"));
65  desc.add<bool>("checkHcalStatus", true);
66 
67  // steering
68  desc.add<bool>("gedElectronMode", true);
69  desc.add<bool>("useCombinationRegression", true);
70  desc.add<bool>("ecalDrivenEcalEnergyFromClassBasedParameterization", false);
71  desc.add<bool>("ecalDrivenEcalErrorFromClassBasedParameterization", false);
72  desc.add<bool>("applyPreselection", true);
73  desc.add<bool>("useEcalRegression", true);
74  desc.add<bool>("applyAmbResolution", false);
75  desc.add<bool>("useGsfPfRecTracks", true);
76  desc.add<bool>("pureTrackerDrivenEcalErrorFromSimpleParameterization", true);
77  desc.add<unsigned int>("ambSortingStrategy", 1);
78  desc.add<unsigned int>("ambClustersOverlapStrategy", 1);
79  desc.add<bool>("addPflowElectrons", true); // this one should be transfered to the "core" level
80  desc.add<bool>("fillConvVtxFitProb", true);
81 
82  // Ecal rec hits configuration
83  desc.add<std::vector<std::string>>("recHitFlagsToBeExcludedBarrel");
84  desc.add<std::vector<std::string>>("recHitFlagsToBeExcludedEndcaps");
85  desc.add<std::vector<std::string>>("recHitSeverityToBeExcludedBarrel");
86  desc.add<std::vector<std::string>>("recHitSeverityToBeExcludedEndcaps");
87 
88  // Isolation algos configuration
89  desc.add("trkIsol03Cfg",EleTkIsolFromCands::pSetDescript());
90  desc.add("trkIsol04Cfg",EleTkIsolFromCands::pSetDescript());
91  desc.add("trkIsolHEEP03Cfg",EleTkIsolFromCands::pSetDescript());
92  desc.add("trkIsolHEEP04Cfg",EleTkIsolFromCands::pSetDescript());
93  desc.add<bool>("useNumCrystals", true);
94  desc.add<double>("etMinBarrel", 0.0);
95  desc.add<double>("etMinEndcaps", 0.11);
96  desc.add<double>("etMinHcal", 0.0);
97  desc.add<double>("eMinBarrel", 0.095);
98  desc.add<double>("eMinEndcaps", 0.0);
99  desc.add<double>("intRadiusEcalBarrel", 3.0);
100  desc.add<double>("intRadiusEcalEndcaps", 3.0);
101  desc.add<double>("intRadiusHcal", 0.15);
102  desc.add<double>("jurassicWidth", 1.5);
103  desc.add<bool>("vetoClustered", false);
104  {
106  psd0.add<std::string>("propagatorAlongTISE", "PropagatorWithMaterial");
107  psd0.add<std::string>("propagatorOppositeTISE", "PropagatorWithMaterialOpposite");
108  desc.add<edm::ParameterSetDescription>("TransientInitialStateEstimatorParameters", psd0);
109  }
110 
111  // backward compatibility mechanism for ctf tracks
112  desc.add<bool>("ctfTracksCheck", true);
113  desc.add<edm::InputTag>("ctfTracksTag", edm::InputTag("generalTracks"));
114 
115  desc.add<double>("MaxElePtForOnlyMVA",50.0);
116  desc.add<double>("PreSelectMVA", -0.1);
117 
118  {
120  psd0.add<double>("minSCEtBarrel", 0.0);
121  psd0.add<double>("minSCEtEndcaps", 0.0);
122  psd0.add<double>("minEOverPBarrel", 0.0);
123  psd0.add<double>("minEOverPEndcaps", 0.0);
124  psd0.add<double>("maxEOverPBarrel", 999999999.0);
125  psd0.add<double>("maxEOverPEndcaps", 999999999.0);
126  psd0.add<double>("maxDeltaEtaBarrel", 999999999.0);
127  psd0.add<double>("maxDeltaEtaEndcaps", 999999999.0);
128  psd0.add<double>("maxDeltaPhiBarrel", 999999999.0);
129  psd0.add<double>("maxDeltaPhiEndcaps", 999999999.0);
130  psd0.add<double>("hOverEConeSize", 0.15);
131  psd0.add<double>("hOverEPtMin", 0.0);
132  psd0.add<double>("maxHOverEBarrelCone", 999999999.0);
133  psd0.add<double>("maxHOverEEndcapsCone", 999999999.0);
134  psd0.add<double>("maxHBarrelCone", 0.0);
135  psd0.add<double>("maxHEndcapsCone", 0.0);
136  psd0.add<double>("maxHOverEBarrelTower", 999999999.0);
137  psd0.add<double>("maxHOverEEndcapsTower", 999999999.0);
138  psd0.add<double>("maxHBarrelTower", 0.0);
139  psd0.add<double>("maxHEndcapsTower", 0.0);
140  psd0.add<double>("maxSigmaIetaIetaBarrel", 999999999.0);
141  psd0.add<double>("maxSigmaIetaIetaEndcaps", 999999999.0);
142  psd0.add<double>("maxFbremBarrel", 999999999.0);
143  psd0.add<double>("maxFbremEndcaps", 999999999.0);
144  psd0.add<bool>("isBarrel", false);
145  psd0.add<bool>("isEndcaps", false);
146  psd0.add<bool>("isFiducial", false);
147  psd0.add<bool>("seedFromTEC", true);
148  psd0.add<double>("maxTIP", 999999999.0);
149  psd0.add<double>("minMVA", -0.4);
150  psd0.add<double>("minMvaByPassForIsolated", -0.4);
151  // preselection parameters (ecal driven electrons)
152  desc.add<edm::ParameterSetDescription>("preselection", psd0);
153  // preselection parameters (tracker driven only electrons)
154  desc.add<edm::ParameterSetDescription>("preselectionPflow", psd0);
155  }
156 
157  // Corrections
158  desc.add<std::string>("superClusterErrorFunction", "EcalClusterEnergyUncertaintyObjectSpecific");
159  desc.add<std::string>("crackCorrectionFunction", "EcalClusterCrackCorrection");
160 
161  desc.add<bool>("ecalWeightsFromDB", true);
162  desc.add<std::vector<std::string>>("ecalRefinedRegressionWeightFiles", {})->setComment(
163  "if not from DB. Otherwise, keep empty");
164  desc.add<bool>("combinationWeightsFromDB", true);
165  desc.add<std::vector<std::string>>("combinationRegressionWeightFile", {})->setComment(
166  "if not from DB. Otherwise, keep empty");
167 
168  // regression. The labels are needed in all cases.
169  desc.add<std::vector<std::string>>("ecalRefinedRegressionWeightLabels", {});
170  desc.add<std::vector<std::string>>("combinationRegressionWeightLabels", {});
171 
172  // Iso values
173  desc.add<bool>("useIsolationValues", false);
174 
175  {
177  psd0.add<edm::InputTag>("edSumPhotonEt", edm::InputTag("elEDIsoValueGamma04"));
178  psd0.add<edm::InputTag>("edSumNeutralHadronEt", edm::InputTag("elEDIsoValueNeutral04"));
179  psd0.add<edm::InputTag>("edSumChargedHadronPt", edm::InputTag("elEDIsoValueCharged04"));
180  desc.add<edm::ParameterSetDescription>("edIsolationValues", psd0);
181  }
182  {
184  psd0.add<edm::InputTag>("pfSumNeutralHadronEt", edm::InputTag("elPFIsoValueNeutral04"));
185  psd0.add<edm::InputTag>("pfSumChargedHadronPt", edm::InputTag("elPFIsoValueCharged04"));
186  psd0.add<edm::InputTag>("pfSumPhotonEt", edm::InputTag("elPFIsoValueGamma04"));
187  desc.add<edm::ParameterSetDescription>("pfIsolationValues", psd0);
188  }
189 
190  desc.add<std::vector<std::string>>("ElecMVAFilesString", {
191  "RecoEgamma/ElectronIdentification/data/TMVA_Category_BDTSimpleCat_10_17Feb2011.weights.xml",
192  "RecoEgamma/ElectronIdentification/data/TMVA_Category_BDTSimpleCat_12_17Feb2011.weights.xml",
193  "RecoEgamma/ElectronIdentification/data/TMVA_Category_BDTSimpleCat_20_17Feb2011.weights.xml",
194  "RecoEgamma/ElectronIdentification/data/TMVA_Category_BDTSimpleCat_22_17Feb2011.weights.xml",
195  });
196  desc.add<std::vector<std::string>>("SoftElecMVAFilesString", {
197  "RecoEgamma/ElectronIdentification/data/TMVA_BDTSoftElectrons_7Feb2014.weights.xml",
198  });
199 
200  descriptions.addDefault(desc);
201 }
void addDefault(ParameterSetDescription const &psetDescription)
static edm::ParameterSetDescription pSetDescript()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void GsfElectronBaseProducer::fillEvent ( reco::GsfElectronCollection electrons,
edm::Event event 
)
protected

Definition at line 392 of file GsfElectronBaseProducer.cc.

References reco::GsfElectron::ambiguous(), GsfElectronAlgo::StrategyConfiguration::applyAmbResolution, GsfElectronAlgo::StrategyConfiguration::applyPreselection, electronPutToken_, isPreselected(), eostools::move(), orphanHandle_, setAmbiguityData(), and strategyCfg_.

Referenced by GsfElectronProducer::produce(), GsfElectronEcalDrivenProducer::produce(), GEDGsfElectronProducer::produce(), and LowPtGsfElectronProducer::produce().

393  {
394  // all electrons
395  logElectrons(electrons, event, "GsfElectronAlgo Info (before preselection)") ;
396  // preselection
398  {
399  electrons.erase( std::remove_if(electrons.begin(), electrons.end(),
400  [this](auto const& ele){ return !isPreselected(ele); }), electrons.end() );
401  logElectrons(electrons, event, "GsfElectronAlgo Info (after preselection)") ;
402  }
403  // ambiguity
404  setAmbiguityData(electrons,event) ;
406  {
407  electrons.erase( std::remove_if(electrons.begin(), electrons.end(),
408  std::mem_fn(&reco::GsfElectron::ambiguous)), electrons.end() );
409  logElectrons(electrons, event, "GsfElectronAlgo Info (after amb. solving)") ;
410  }
411  // final filling
413 }
void setAmbiguityData(reco::GsfElectronCollection &electrons, edm::Event const &event, bool ignoreNotPreselected=true) const
bool ambiguous() const
Definition: GsfElectron.h:721
GsfElectronAlgo::StrategyConfiguration strategyCfg_
const edm::EDPutTokenT< reco::GsfElectronCollection > electronPutToken_
bool isPreselected(reco::GsfElectron const &ele) const
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle< reco::GsfElectronCollection > orphanHandle_
static void GsfElectronBaseProducer::globalEndJob ( gsfAlgoHelpers::HeavyObjectCache const *  )
inlinestatic

Definition at line 43 of file GsfElectronBaseProducer.h.

43  {
44  }
static std::unique_ptr<gsfAlgoHelpers::HeavyObjectCache> GsfElectronBaseProducer::initializeGlobalCache ( const edm::ParameterSet conf)
inlinestatic

Definition at line 39 of file GsfElectronBaseProducer.h.

39  {
40  return std::make_unique<gsfAlgoHelpers::HeavyObjectCache>(conf);
41  }
bool GsfElectronBaseProducer::isPreselected ( reco::GsfElectron const &  ele) const
private

Definition at line 542 of file GsfElectronBaseProducer.cc.

References reco::GsfElectron::ecalDrivenSeed(), GsfElectronAlgo::StrategyConfiguration::gedElectronMode, GsfElectronAlgo::StrategyConfiguration::MaxElePtForOnlyMVA, reco::GsfElectron::passingCutBasedPreselection(), reco::GsfElectron::passingMvaPreselection(), reco::GsfElectron::passingPflowPreselection(), reco::LeafCandidate::pt(), and strategyCfg_.

Referenced by fillEvent(), and setAmbiguityData().

543 {
544  bool passCutBased = ele.passingCutBasedPreselection();
545  bool passPF = ele.passingPflowPreselection();
546  // it is worth nothing for gedGsfElectrons, this does nothing as its not set
547  // till GedGsfElectron finaliser, this is always false
549  bool passmva = ele.passingMvaPreselection();
550  if (!ele.ecalDrivenSeed()) {
551  if (ele.pt() > strategyCfg_.MaxElePtForOnlyMVA)
552  return passmva && passCutBased;
553  else
554  return passmva;
555  } else
556  return (passCutBased || passPF || passmva);
557  } else {
558  return passCutBased || passPF;
559  }
560 
561  return true;
562 }
GsfElectronAlgo::StrategyConfiguration strategyCfg_
const edm::OrphanHandle<reco::GsfElectronCollection>& GsfElectronBaseProducer::orphanHandle ( ) const
inlineprotected

Definition at line 52 of file GsfElectronBaseProducer.h.

Referenced by GEDGsfElectronProducer::fillGsfElectronValueMap().

52 { return orphanHandle_;}
edm::OrphanHandle< reco::GsfElectronCollection > orphanHandle_
void GsfElectronBaseProducer::setAmbiguityData ( reco::GsfElectronCollection electrons,
edm::Event const &  event,
bool  ignoreNotPreselected = true 
) const
private

Definition at line 441 of file GsfElectronBaseProducer.cc.

References GsfElectronAlgo::StrategyConfiguration::ambClustersOverlapStrategy, GsfElectronAlgo::StrategyConfiguration::ambSortingStrategy, GsfElectronAlgo::InputTagsConfiguration::barrelRecHitCollection, particleFlowSuperClusterOOTECAL_cff::barrelRecHits, GsfElectronAlgo::InputTagsConfiguration::beamSpotTag, photonPostprocessing_cfi::eMin, GsfElectronAlgo::InputTagsConfiguration::endcapRecHitCollection, particleFlowSuperClusterOOTECAL_cff::endcapRecHits, PVValHelper::eta, Exception, runEdmFileComparison::found, edm::Ref< C, T, F >::get(), gsfElectronCores_cfi::gsfPfRecTracks, GsfElectronAlgo::InputTagsConfiguration::gsfPfRecTracksTag, inputCfg_, EgAmbiguityTools::isBetter(), EgAmbiguityTools::isInnerMost(), isPreselected(), LogDebug, EgAmbiguityTools::sharedEnergy(), strategyCfg_, electronIdCutBased_cfi::threshold, and GsfElectronAlgo::StrategyConfiguration::useGsfPfRecTracks.

Referenced by fillEvent().

444 {
445  // Getting required event data
446  auto const& beamspot = event.get(inputCfg_.beamSpotTag);
449  auto const& barrelRecHits = event.get(inputCfg_.barrelRecHitCollection);
450  auto const& endcapRecHits = event.get(inputCfg_.endcapRecHitCollection);
451 
452  if (strategyCfg_.ambSortingStrategy == 0) {
453  std::sort(electrons.begin(), electrons.end(), EgAmbiguityTools::isBetter);
454  } else if (strategyCfg_.ambSortingStrategy == 1) {
455  std::sort(electrons.begin(), electrons.end(), EgAmbiguityTools::isInnerMost);
456  } else {
457  throw cms::Exception("GsfElectronAlgo|UnknownAmbiguitySortingStrategy")
458  << "value of strategyCfg_.ambSortingStrategy is : " << strategyCfg_.ambSortingStrategy;
459  }
460 
461  // init
462  for (auto e1 = electrons.begin(); e1 != electrons.end(); ++e1) {
463  e1->clearAmbiguousGsfTracks();
464  e1->setAmbiguous(false);
465  }
466 
467  // get ambiguous from GsfPfRecTracks
469  for (auto& e1 : electrons) {
470  bool found = false;
471  for (auto const& gsfPfRecTrack : *gsfPfRecTracks.product()) {
472  if (gsfPfRecTrack.gsfTrackRef() == e1.gsfTrack()) {
473  if (found) {
474  edm::LogWarning("GsfElectronAlgo") << "associated gsfPfRecTrack already found";
475  } else {
476  found = true;
477  for (auto const& duplicate : gsfPfRecTrack.convBremGsfPFRecTrackRef()) {
478  e1.addAmbiguousGsfTrack(duplicate->gsfTrackRef());
479  }
480  }
481  }
482  }
483  }
484  }
485  // or search overlapping clusters
486  else {
487  for (auto e1 = electrons.begin(); e1 != electrons.end(); ++e1) {
488  if (e1->ambiguous())
489  continue;
490  if (ignoreNotPreselected && !isPreselected(*e1))
491  continue;
492 
493  SuperClusterRef scRef1 = e1->superCluster();
494  CaloClusterPtr eleClu1 = e1->electronCluster();
495  LogDebug("GsfElectronAlgo") << "Blessing electron with E/P " << e1->eSuperClusterOverP() << ", cluster "
496  << scRef1.get() << " & track " << e1->gsfTrack().get();
497 
498  for (auto e2 = e1 + 1; e2 != electrons.end(); ++e2) {
499  if (e2->ambiguous())
500  continue;
501  if (ignoreNotPreselected && !isPreselected(*e2))
502  continue;
503 
504  SuperClusterRef scRef2 = e2->superCluster();
505  CaloClusterPtr eleClu2 = e2->electronCluster();
506 
507  // search if same cluster
508  bool sameCluster = false;
510  sameCluster = (scRef1 == scRef2);
511  } else if (strategyCfg_.ambClustersOverlapStrategy == 1) {
512  float eMin = 1.;
513  float threshold = eMin * cosh(EleRelPoint(scRef1->position(), beamspot.position()).eta());
514  sameCluster =
516  (EgAmbiguityTools::sharedEnergy(*scRef1->seed(), *eleClu2, barrelRecHits, endcapRecHits) >= threshold) ||
517  (EgAmbiguityTools::sharedEnergy(*eleClu1, *scRef2->seed(), barrelRecHits, endcapRecHits) >= threshold) ||
518  (EgAmbiguityTools::sharedEnergy(*scRef1->seed(), *scRef2->seed(), barrelRecHits, endcapRecHits) >=
519  threshold));
520  } else {
521  throw cms::Exception("GsfElectronAlgo|UnknownAmbiguityClustersOverlapStrategy")
522  << "value of strategyCfg_.ambClustersOverlapStrategy is : " << strategyCfg_.ambClustersOverlapStrategy;
523  }
524 
525  // main instructions
526  if (sameCluster) {
527  LogDebug("GsfElectronAlgo") << "Discarding electron with E/P " << e2->eSuperClusterOverP() << ", cluster "
528  << scRef2.get() << " and track " << e2->gsfTrack().get();
529  e1->addAmbiguousGsfTrack(e2->gsfTrack());
530  e2->setAmbiguous(true);
531  } else if (e1->gsfTrack() == e2->gsfTrack()) {
532  edm::LogWarning("GsfElectronAlgo") << "Forgetting electron with E/P " << e2->eSuperClusterOverP()
533  << ", cluster " << scRef2.get() << " and track " << e2->gsfTrack().get();
534  e2->setAmbiguous(true);
535  }
536  }
537  }
538  }
539 }
#define LogDebug(id)
bool isBetter(reco::GsfElectron const &, reco::GsfElectron const &)
edm::EDGetTokenT< EcalRecHitCollection > endcapRecHitCollection
edm::EDGetTokenT< EcalRecHitCollection > barrelRecHitCollection
edm::EDGetTokenT< reco::GsfPFRecTrackCollection > gsfPfRecTracksTag
float sharedEnergy(reco::CaloCluster const &clu1, reco::CaloCluster const &clu2, EcalRecHitCollection const &barrelRecHits, EcalRecHitCollection const &endcapRecHits)
GsfElectronAlgo::InputTagsConfiguration inputCfg_
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
GsfElectronAlgo::StrategyConfiguration strategyCfg_
bool isInnerMost(reco::GsfElectron const &, reco::GsfElectron const &)
bool isPreselected(reco::GsfElectron const &ele) const

Member Data Documentation

GsfElectronAlgo* GsfElectronBaseProducer::algo_
protected
const GsfElectronAlgo::CutsConfiguration GsfElectronBaseProducer::cutsCfg_
protected
const GsfElectronAlgo::CutsConfiguration GsfElectronBaseProducer::cutsCfgPflow_
protected
bool GsfElectronBaseProducer::ecalSeedingParametersChecked_
private

Definition at line 71 of file GsfElectronBaseProducer.h.

Referenced by beginEvent().

const edm::EDPutTokenT<reco::GsfElectronCollection> GsfElectronBaseProducer::electronPutToken_
private

Definition at line 75 of file GsfElectronBaseProducer.h.

Referenced by fillEvent().

ElectronHcalHelper::Configuration GsfElectronBaseProducer::hcalCfg_
protected
ElectronHcalHelper::Configuration GsfElectronBaseProducer::hcalCfgPflow_
protected

Definition at line 60 of file GsfElectronBaseProducer.h.

Referenced by GsfElectronBaseProducer().

GsfElectronAlgo::InputTagsConfiguration GsfElectronBaseProducer::inputCfg_
protected
edm::OrphanHandle<reco::GsfElectronCollection> GsfElectronBaseProducer::orphanHandle_
private

Definition at line 73 of file GsfElectronBaseProducer.h.

Referenced by fillEvent().

edm::EDGetTokenT<edm::ValueMap<float> > GsfElectronBaseProducer::pfMVA_
protected
GsfElectronAlgo::StrategyConfiguration GsfElectronBaseProducer::strategyCfg_
protected