CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper GEDGsfElectronProducer GsfElectronEcalDrivenProducer GsfElectronProducer

Public Member Functions

 GsfElectronBaseProducer (const edm::ParameterSet &)
 
virtual ~GsfElectronBaseProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescription (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

void beginEvent (edm::Event &, const edm::EventSetup &)
 
void endEvent ()
 
void fillEvent (edm::Event &)
 
reco::GsfElectronnewElectron ()
 
const edm::OrphanHandle
< reco::GsfElectronCollection > & 
orphanHandle () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Protected Attributes

GsfElectronAlgoalgo_
 
GsfElectronAlgo::CutsConfiguration cutsCfg_
 
GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
 
ElectronHcalHelper::Configuration hcalCfg_
 
ElectronHcalHelper::Configuration hcalCfgPflow_
 
GsfElectronAlgo::InputTagsConfiguration inputCfg_
 
SoftElectronMVAEstimator::Configuration mvaCfg_
 
GsfElectronAlgo::StrategyConfiguration strategyCfg_
 

Private Member Functions

void checkEcalSeedingParameters (edm::ParameterSet const &)
 

Private Attributes

bool ecalSeedingParametersChecked_
 
edm::OrphanHandle
< reco::GsfElectronCollection
orphanHandle_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Detailed Description

Definition at line 28 of file GsfElectronBaseProducer.h.

Constructor & Destructor Documentation

GsfElectronBaseProducer::GsfElectronBaseProducer ( const edm::ParameterSet cfg)
explicit

Definition at line 155 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, GsfElectronAlgo::InputTagsConfiguration::ctfTracks, GsfElectronAlgo::StrategyConfiguration::ctfTracksCheck, cutsCfg_, cutsCfgPflow_, GsfElectronAlgo::StrategyConfiguration::ecalDrivenEcalEnergyFromClassBasedParameterization, GsfElectronAlgo::StrategyConfiguration::ecalDrivenEcalErrorFromClassBasedParameterization, RegressionHelper::Configuration::ecalRegressionWeightLabels, GsfElectronAlgo::InputTagsConfiguration::edIsoVals, GsfElectronAlgo::InputTagsConfiguration::endcapRecHitCollection, edm::hlt::Exception, edm::ParameterSet::exists(), 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::intRadiusBarrelTk, GsfElectronAlgo::CutsConfiguration::isBarrel, GsfElectronAlgo::CutsConfiguration::isEndcaps, GsfElectronAlgo::CutsConfiguration::isFiducial, GsfElectronAlgo::CutsConfiguration::maxDeltaEtaBarrel, GsfElectronAlgo::CutsConfiguration::maxDeltaEtaEndcaps, GsfElectronAlgo::CutsConfiguration::maxDeltaPhiBarrel, GsfElectronAlgo::CutsConfiguration::maxDeltaPhiEndcaps, GsfElectronAlgo::StrategyConfiguration::MaxElePtForOnlyMVA, GsfElectronAlgo::CutsConfiguration::maxEOverPBarrel, GsfElectronAlgo::CutsConfiguration::maxEOverPEndcaps, GsfElectronAlgo::CutsConfiguration::maxFbremBarrel, GsfElectronAlgo::CutsConfiguration::maxFbremEndcaps, GsfElectronAlgo::CutsConfiguration::maxHBarrel, GsfElectronAlgo::CutsConfiguration::maxHEndcaps, GsfElectronAlgo::CutsConfiguration::maxHOverEBarrel, GsfElectronAlgo::CutsConfiguration::maxHOverEEndcaps, GsfElectronAlgo::CutsConfiguration::maxSigmaIetaIetaBarrel, GsfElectronAlgo::CutsConfiguration::maxSigmaIetaIetaEndcaps, GsfElectronAlgo::CutsConfiguration::maxTIP, GsfElectronAlgo::CutsConfiguration::minEOverPBarrel, GsfElectronAlgo::CutsConfiguration::minEOverPEndcaps, GsfElectronAlgo::CutsConfiguration::minMVA, GsfElectronAlgo::CutsConfiguration::minMvaByPassForIsolated, GsfElectronAlgo::CutsConfiguration::minSCEtBarrel, GsfElectronAlgo::CutsConfiguration::minSCEtEndcaps, mvaCfg_, mergeVDriftHistosByStation::name, GsfElectronAlgo::InputTagsConfiguration::pfIsoVals, GsfElectronAlgo::InputTagsConfiguration::pflowGsfElectronsTag, GsfElectronAlgo::InputTagsConfiguration::pfMVA, GsfElectronAlgo::StrategyConfiguration::PreSelectMVA, GsfElectronAlgo::InputTagsConfiguration::previousGsfElectrons, GsfElectronAlgo::StrategyConfiguration::pureTrackerDrivenEcalErrorFromSimpleParameterization, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedEndcaps, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedEndcaps, GsfElectronAlgo::CutsConfiguration::seedFromTEC, 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, GsfElectronAlgo::InputTagsConfiguration::vtxCollectionTag, and SoftElectronMVAEstimator::Configuration::vweightsfiles.

157  {
158  produces<GsfElectronCollection>();
159 
160  inputCfg_.previousGsfElectrons = consumes<reco::GsfElectronCollection>(cfg.getParameter<edm::InputTag>("previousGsfElectronsTag"));
161  inputCfg_.pflowGsfElectronsTag = consumes<reco::GsfElectronCollection>(cfg.getParameter<edm::InputTag>("pflowGsfElectronsTag"));
162  inputCfg_.gsfElectronCores = consumes<reco::GsfElectronCoreCollection>(cfg.getParameter<edm::InputTag>("gsfElectronCoresTag"));
163  inputCfg_.hcalTowersTag = consumes<CaloTowerCollection>(cfg.getParameter<edm::InputTag>("hcalTowers"));
164  //inputCfg_.tracks_ = cfg.getParameter<edm::InputTag>("tracks");
165  inputCfg_.barrelRecHitCollection = consumes<EcalRecHitCollection>(cfg.getParameter<edm::InputTag>("barrelRecHitCollectionTag"));
166  inputCfg_.endcapRecHitCollection = consumes<EcalRecHitCollection>(cfg.getParameter<edm::InputTag>("endcapRecHitCollectionTag"));
167  inputCfg_.pfMVA = consumes<edm::ValueMap<float> >(cfg.getParameter<edm::InputTag>("pfMvaTag"));
168  inputCfg_.ctfTracks = consumes<reco::TrackCollection>(cfg.getParameter<edm::InputTag>("ctfTracksTag"));
169  inputCfg_.seedsTag = consumes<reco::ElectronSeedCollection>(cfg.getParameter<edm::InputTag>("seedsTag")); // used to check config consistency with seeding
170  inputCfg_.beamSpotTag = consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamSpotTag"));
171  inputCfg_.gsfPfRecTracksTag = consumes<reco::GsfPFRecTrackCollection>(cfg.getParameter<edm::InputTag>("gsfPfRecTracksTag"));
172  inputCfg_.vtxCollectionTag = consumes<reco::VertexCollection>(cfg.getParameter<edm::InputTag>("vtxTag"));
173 
174  bool useIsolationValues = cfg.getParameter<bool>("useIsolationValues") ;
175  if ( useIsolationValues ) {
176  if( ! cfg.exists("pfIsolationValues") ) {
177  throw cms::Exception("GsfElectronBaseProducer|InternalError")
178  <<"Missing ParameterSet pfIsolationValues" ;
179  } else {
181  cfg.getParameter<edm::ParameterSet> ("pfIsolationValues");
182  std::vector<std::string> isoNames =
184  for(const std::string& name : isoNames) {
185  edm::InputTag tag =
187  mayConsume<edm::ValueMap<double> >(tag);
188  }
189  }
190 
191  if ( ! cfg.exists("edIsolationValues") ) {
192  throw cms::Exception("GsfElectronBaseProducer|InternalError")
193  <<"Missing ParameterSet edIsolationValues" ;
194  } else {
196  cfg.getParameter<edm::ParameterSet> ("edIsolationValues");
197  std::vector<std::string> isoNames =
199  for(const std::string& name : isoNames) {
200  edm::InputTag tag =
202  mayConsume<edm::ValueMap<double> >(tag);
203  }
204  }
205  }
206 
207  strategyCfg_.useGsfPfRecTracks = cfg.getParameter<bool>("useGsfPfRecTracks") ;
208  strategyCfg_.applyPreselection = cfg.getParameter<bool>("applyPreselection") ;
209  strategyCfg_.ecalDrivenEcalEnergyFromClassBasedParameterization = cfg.getParameter<bool>("ecalDrivenEcalEnergyFromClassBasedParameterization") ;
210  strategyCfg_.ecalDrivenEcalErrorFromClassBasedParameterization = cfg.getParameter<bool>("ecalDrivenEcalErrorFromClassBasedParameterization") ;
211  strategyCfg_.pureTrackerDrivenEcalErrorFromSimpleParameterization = cfg.getParameter<bool>("pureTrackerDrivenEcalErrorFromSimpleParameterization") ;
212  strategyCfg_.applyAmbResolution = cfg.getParameter<bool>("applyAmbResolution") ;
213  strategyCfg_.ambSortingStrategy = cfg.getParameter<unsigned>("ambSortingStrategy") ;
214  strategyCfg_.ambClustersOverlapStrategy = cfg.getParameter<unsigned>("ambClustersOverlapStrategy") ;
215  strategyCfg_.addPflowElectrons = cfg.getParameter<bool>("addPflowElectrons") ;
216  strategyCfg_.ctfTracksCheck = cfg.getParameter<bool>("ctfTracksCheck");
217  strategyCfg_.gedElectronMode = cfg.getParameter<bool>("gedElectronMode");
218  strategyCfg_.PreSelectMVA = cfg.getParameter<double>("PreSelectMVA");
219  strategyCfg_.MaxElePtForOnlyMVA = cfg.getParameter<double>("MaxElePtForOnlyMVA");
220  strategyCfg_.useEcalRegression = cfg.getParameter<bool>("useEcalRegression");
221  strategyCfg_.useCombinationRegression = cfg.getParameter<bool>("useCombinationRegression");
222 
223  cutsCfg_.minSCEtBarrel = cfg.getParameter<double>("minSCEtBarrel") ;
224  cutsCfg_.minSCEtEndcaps = cfg.getParameter<double>("minSCEtEndcaps") ;
225  cutsCfg_.maxEOverPBarrel = cfg.getParameter<double>("maxEOverPBarrel") ;
226  cutsCfg_.maxEOverPEndcaps = cfg.getParameter<double>("maxEOverPEndcaps") ;
227  cutsCfg_.minEOverPBarrel = cfg.getParameter<double>("minEOverPBarrel") ;
228  cutsCfg_.minEOverPEndcaps = cfg.getParameter<double>("minEOverPEndcaps") ;
229 
230  // H/E
231  cutsCfg_.maxHOverEBarrel = cfg.getParameter<double>("maxHOverEBarrel") ;
232  cutsCfg_.maxHOverEEndcaps = cfg.getParameter<double>("maxHOverEEndcaps") ;
233  cutsCfg_.maxHBarrel = cfg.getParameter<double>("maxHBarrel") ;
234  cutsCfg_.maxHEndcaps = cfg.getParameter<double>("maxHEndcaps") ;
235 
236  cutsCfg_.maxDeltaEtaBarrel = cfg.getParameter<double>("maxDeltaEtaBarrel") ;
237  cutsCfg_.maxDeltaEtaEndcaps = cfg.getParameter<double>("maxDeltaEtaEndcaps") ;
238  cutsCfg_.maxDeltaPhiBarrel = cfg.getParameter<double>("maxDeltaPhiBarrel") ;
239  cutsCfg_.maxDeltaPhiEndcaps = cfg.getParameter<double>("maxDeltaPhiEndcaps") ;
240  cutsCfg_.maxSigmaIetaIetaBarrel = cfg.getParameter<double>("maxSigmaIetaIetaBarrel") ;
241  cutsCfg_.maxSigmaIetaIetaEndcaps = cfg.getParameter<double>("maxSigmaIetaIetaEndcaps") ;
242  cutsCfg_.maxFbremBarrel = cfg.getParameter<double>("maxFbremBarrel") ;
243  cutsCfg_.maxFbremEndcaps = cfg.getParameter<double>("maxFbremEndcaps") ;
244  cutsCfg_.isBarrel = cfg.getParameter<bool>("isBarrel") ;
245  cutsCfg_.isEndcaps = cfg.getParameter<bool>("isEndcaps") ;
246  cutsCfg_.isFiducial = cfg.getParameter<bool>("isFiducial") ;
247  cutsCfg_.minMVA = cfg.getParameter<double>("minMVA") ;
248  cutsCfg_.minMvaByPassForIsolated = cfg.getParameter<double>("minMvaByPassForIsolated") ;
249  cutsCfg_.maxTIP = cfg.getParameter<double>("maxTIP") ;
250  cutsCfg_.seedFromTEC = cfg.getParameter<bool>("seedFromTEC") ;
251 
252  cutsCfgPflow_.minSCEtBarrel = cfg.getParameter<double>("minSCEtBarrelPflow") ;
253  cutsCfgPflow_.minSCEtEndcaps = cfg.getParameter<double>("minSCEtEndcapsPflow") ;
254  cutsCfgPflow_.maxEOverPBarrel = cfg.getParameter<double>("maxEOverPBarrelPflow") ;
255  cutsCfgPflow_.maxEOverPEndcaps = cfg.getParameter<double>("maxEOverPEndcapsPflow") ;
256  cutsCfgPflow_.minEOverPBarrel = cfg.getParameter<double>("minEOverPBarrelPflow") ;
257  cutsCfgPflow_.minEOverPEndcaps = cfg.getParameter<double>("minEOverPEndcapsPflow") ;
258 
259  // H/E
260  cutsCfgPflow_.maxHOverEBarrel = cfg.getParameter<double>("maxHOverEBarrelPflow") ;
261  cutsCfgPflow_.maxHOverEEndcaps = cfg.getParameter<double>("maxHOverEEndcapsPflow") ;
262  cutsCfgPflow_.maxHBarrel = cfg.getParameter<double>("maxHBarrelPflow") ;
263  cutsCfgPflow_.maxHEndcaps = cfg.getParameter<double>("maxHEndcapsPflow") ;
264 
265  cutsCfgPflow_.maxDeltaEtaBarrel = cfg.getParameter<double>("maxDeltaEtaBarrelPflow") ;
266  cutsCfgPflow_.maxDeltaEtaEndcaps = cfg.getParameter<double>("maxDeltaEtaEndcapsPflow") ;
267  cutsCfgPflow_.maxDeltaPhiBarrel = cfg.getParameter<double>("maxDeltaPhiBarrelPflow") ;
268  cutsCfgPflow_.maxDeltaPhiEndcaps = cfg.getParameter<double>("maxDeltaPhiEndcapsPflow") ;
269  cutsCfgPflow_.maxDeltaPhiBarrel = cfg.getParameter<double>("maxDeltaPhiBarrelPflow") ;
270  cutsCfgPflow_.maxDeltaPhiEndcaps = cfg.getParameter<double>("maxDeltaPhiEndcapsPflow") ;
271  cutsCfgPflow_.maxDeltaPhiBarrel = cfg.getParameter<double>("maxDeltaPhiBarrelPflow") ;
272  cutsCfgPflow_.maxDeltaPhiEndcaps = cfg.getParameter<double>("maxDeltaPhiEndcapsPflow") ;
273  cutsCfgPflow_.maxSigmaIetaIetaBarrel = cfg.getParameter<double>("maxSigmaIetaIetaBarrelPflow") ;
274  cutsCfgPflow_.maxSigmaIetaIetaEndcaps = cfg.getParameter<double>("maxSigmaIetaIetaEndcapsPflow") ;
275  cutsCfgPflow_.maxFbremBarrel = cfg.getParameter<double>("maxFbremBarrelPflow") ;
276  cutsCfgPflow_.maxFbremEndcaps = cfg.getParameter<double>("maxFbremEndcapsPflow") ;
277  cutsCfgPflow_.isBarrel = cfg.getParameter<bool>("isBarrelPflow") ;
278  cutsCfgPflow_.isEndcaps = cfg.getParameter<bool>("isEndcapsPflow") ;
279  cutsCfgPflow_.isFiducial = cfg.getParameter<bool>("isFiducialPflow") ;
280  cutsCfgPflow_.minMVA = cfg.getParameter<double>("minMVAPflow") ;
281  cutsCfgPflow_.minMvaByPassForIsolated = cfg.getParameter<double>("minMvaByPassForIsolatedPflow") ;
282  cutsCfgPflow_.maxTIP = cfg.getParameter<double>("maxTIPPflow") ;
283  cutsCfgPflow_.seedFromTEC = true ; // not applied for pflow
284 
285  // hcal helpers
286  hcalCfg_.hOverEConeSize = cfg.getParameter<double>("hOverEConeSize") ;
287  if (hcalCfg_.hOverEConeSize>0)
288  {
291  consumes<CaloTowerCollection>(cfg.getParameter<edm::InputTag>("hcalTowers")) ;
292  hcalCfg_.hOverEPtMin = cfg.getParameter<double>("hOverEPtMin") ;
293  }
294  hcalCfgPflow_.hOverEConeSize = cfg.getParameter<double>("hOverEConeSizePflow") ;
296  {
299  consumes<CaloTowerCollection>(cfg.getParameter<edm::InputTag>("hcalTowers")) ;
300  hcalCfgPflow_.hOverEPtMin = cfg.getParameter<double>("hOverEPtMinPflow") ;
301  }
302 
303  // Ecal rec hits configuration
305  const std::vector<std::string> flagnamesbarrel = cfg.getParameter<std::vector<std::string> >("recHitFlagsToBeExcludedBarrel");
306  recHitsCfg.recHitFlagsToBeExcludedBarrel = StringToEnumValue<EcalRecHit::Flags>(flagnamesbarrel);
307  const std::vector<std::string> flagnamesendcaps = cfg.getParameter<std::vector<std::string> >("recHitFlagsToBeExcludedEndcaps");
308  recHitsCfg.recHitFlagsToBeExcludedEndcaps = StringToEnumValue<EcalRecHit::Flags>(flagnamesendcaps);
309  const std::vector<std::string> severitynamesbarrel = cfg.getParameter<std::vector<std::string> >("recHitSeverityToBeExcludedBarrel");
310  recHitsCfg.recHitSeverityToBeExcludedBarrel = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesbarrel);
311  const std::vector<std::string> severitynamesendcaps = cfg.getParameter<std::vector<std::string> >("recHitSeverityToBeExcludedEndcaps");
312  recHitsCfg.recHitSeverityToBeExcludedEndcaps = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesendcaps);
313  //recHitsCfg.severityLevelCut = cfg.getParameter<int>("severityLevelCut") ;
314 
315  // isolation
317  isoCfg.intRadiusBarrelTk = cfg.getParameter<double>("intRadiusBarrelTk") ;
318  isoCfg.intRadiusEndcapTk = cfg.getParameter<double>("intRadiusEndcapTk") ;
319  isoCfg.stripBarrelTk = cfg.getParameter<double>("stripBarrelTk") ;
320  isoCfg.stripEndcapTk = cfg.getParameter<double>("stripEndcapTk") ;
321  isoCfg.ptMinTk = cfg.getParameter<double>("ptMinTk") ;
322  isoCfg.maxVtxDistTk = cfg.getParameter<double>("maxVtxDistTk") ;
323  isoCfg.maxDrbTk = cfg.getParameter<double>("maxDrbTk") ;
324  isoCfg.intRadiusHcal = cfg.getParameter<double>("intRadiusHcal") ;
325  isoCfg.etMinHcal = cfg.getParameter<double>("etMinHcal") ;
326  isoCfg.intRadiusEcalBarrel = cfg.getParameter<double>("intRadiusEcalBarrel") ;
327  isoCfg.intRadiusEcalEndcaps = cfg.getParameter<double>("intRadiusEcalEndcaps") ;
328  isoCfg.jurassicWidth = cfg.getParameter<double>("jurassicWidth") ;
329  isoCfg.etMinBarrel = cfg.getParameter<double>("etMinBarrel") ;
330  isoCfg.eMinBarrel = cfg.getParameter<double>("eMinBarrel") ;
331  isoCfg.etMinEndcaps = cfg.getParameter<double>("etMinEndcaps") ;
332  isoCfg.eMinEndcaps = cfg.getParameter<double>("eMinEndcaps") ;
333  isoCfg.vetoClustered = cfg.getParameter<bool>("vetoClustered") ;
334  isoCfg.useNumCrystals = cfg.getParameter<bool>("useNumCrystals") ;
335 
336 
337  RegressionHelper::Configuration regressionCfg ;
338  regressionCfg.ecalRegressionWeightLabels = cfg.getParameter<std::vector<std::string> >("ecalRefinedRegressionWeightLabels");
339  regressionCfg.combinationRegressionWeightLabels = cfg.getParameter<std::vector<std::string> >("combinationRegressionWeightLabels");
340  regressionCfg.ecalRegressionWeightFiles = cfg.getParameter<std::vector<std::string> >("ecalRefinedRegressionWeightFiles");
341  regressionCfg.combinationRegressionWeightFiles = cfg.getParameter<std::vector<std::string> >("combinationRegressionWeightFile");
342  regressionCfg.ecalWeightsFromDB = cfg.getParameter<bool>("ecalWeightsFromDB");
343  regressionCfg.combinationWeightsFromDB = cfg.getParameter<bool>("combinationWeightsFromDB");
344  // functions for corrector
345  EcalClusterFunctionBaseClass * superClusterErrorFunction = 0 ;
346  std::string superClusterErrorFunctionName
347  = cfg.getParameter<std::string>("superClusterErrorFunction") ;
348  if (superClusterErrorFunctionName!="")
349  {
350  superClusterErrorFunction
351  = EcalClusterFunctionFactory::get()->create(superClusterErrorFunctionName,cfg) ;
352  }
353  else
354  {
355  superClusterErrorFunction
356  = EcalClusterFunctionFactory::get()->create("EcalClusterEnergyUncertaintyObjectSpecific",cfg) ;
357  }
358  EcalClusterFunctionBaseClass * crackCorrectionFunction = 0 ;
359  std::string crackCorrectionFunctionName
360  = cfg.getParameter<std::string>("crackCorrectionFunction") ;
361  if (crackCorrectionFunctionName!="")
362  {
363  crackCorrectionFunction
364  = EcalClusterFunctionFactory::get()->create(crackCorrectionFunctionName,cfg) ;
365  }
366 
367 
368  mvaCfg_.vweightsfiles=cfg.getParameter<std::vector<std::string>>("SoftElecMVAFilesString");
369  // create algo
370  algo_ = new GsfElectronAlgo
374  isoCfg,recHitsCfg,
375  superClusterErrorFunction,
376  crackCorrectionFunction,
377  mvaCfg_,
378  regressionCfg
379  ) ;
380 
381 
382  }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::GsfElectronCoreCollection > gsfElectronCores
std::vector< std::string > ecalRegressionWeightLabels
SoftElectronMVAEstimator::Configuration mvaCfg_
edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons
edm::EDGetTokenT< reco::VertexCollection > vtxCollectionTag
bool exists(std::string const &parameterName) const
checks if a parameter exists
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:192
GsfElectronAlgo::InputTagsConfiguration inputCfg_
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag
GsfElectronAlgo::CutsConfiguration cutsCfg_
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsTag
edm::EDGetTokenT< edm::ValueMap< float > > pfMVA
ElectronHcalHelper::Configuration hcalCfg_
edm::EDGetTokenT< CaloTowerCollection > hcalTowersTag
ElectronHcalHelper::Configuration hcalCfgPflow_
edm::EDGetTokenT< reco::TrackCollection > ctfTracks
GsfElectronAlgo::StrategyConfiguration strategyCfg_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers
T get(const Candidate &c)
Definition: component.h:55
GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
GsfElectronBaseProducer::~GsfElectronBaseProducer ( )
virtual

Definition at line 384 of file GsfElectronBaseProducer.cc.

References algo_.

385  { delete algo_ ; }

Member Function Documentation

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

Definition at line 387 of file GsfElectronBaseProducer.cc.

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

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

388  {
389  // check configuration
391  {
394  event.getByToken(inputCfg_.seedsTag,seeds) ;
395  if (!seeds.isValid())
396  {
397  edm::LogWarning("GsfElectronAlgo|UnreachableSeedsProvenance")
398  <<"Cannot check consistency of parameters with ecal seeding ones,"
399  <<" because the original collection of seeds is not any more available." ;
400  }
401  else
402  {
404  }
405  }
406 
407  // init the algo
408  algo_->checkSetup(setup) ;
409  algo_->beginEvent(event) ;
410  }
void checkEcalSeedingParameters(edm::ParameterSet const &)
void beginEvent(edm::Event &)
GsfElectronAlgo::InputTagsConfiguration inputCfg_
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsTag
bool isValid() const
Definition: HandleBase.h:76
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
Provenance const * provenance() const
Definition: HandleBase.h:85
void checkSetup(const edm::EventSetup &)
void GsfElectronBaseProducer::checkEcalSeedingParameters ( edm::ParameterSet const &  pset)
private

Definition at line 440 of file GsfElectronBaseProducer.cc.

References cutsCfg_, edm::ParameterSet::getParameter(), hcalCfg_, ElectronHcalHelper::Configuration::hOverEConeSize, GsfElectronAlgo::CutsConfiguration::maxHOverEBarrel, GsfElectronAlgo::CutsConfiguration::maxHOverEEndcaps, GsfElectronAlgo::CutsConfiguration::minSCEtBarrel, and GsfElectronAlgo::CutsConfiguration::minSCEtEndcaps.

Referenced by beginEvent().

441  {
442  edm::ParameterSet seedConfiguration = pset.getParameter<edm::ParameterSet>("SeedConfiguration") ;
443  //edm::ParameterSet orderedHitsFactoryPSet = seedConfiguration.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet") ;
444  //edm::ParameterSet seedParameters = seedConfiguration.getParameter<edm::ParameterSet>("ecalDrivenElectronSeedsParameters") ;
445 
446  if (seedConfiguration.getParameter<bool>("applyHOverECut"))
447  {
448  if ((hcalCfg_.hOverEConeSize!=0)&&(hcalCfg_.hOverEConeSize!=seedConfiguration.getParameter<double>("hOverEConeSize")))
449  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The H/E cone size ("<<hcalCfg_.hOverEConeSize<<") is different from ecal seeding ("<<seedConfiguration.getParameter<double>("hOverEConeSize")<<")." ; }
450  if (cutsCfg_.maxHOverEBarrel<seedConfiguration.getParameter<double>("maxHOverEBarrel"))
451  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The max barrel H/E is lower than during ecal seeding." ; }
452  if (cutsCfg_.maxHOverEEndcaps<seedConfiguration.getParameter<double>("maxHOverEEndcaps"))
453  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The max endcaps H/E is lower than during ecal seeding." ; }
454  }
455 
456  if (cutsCfg_.minSCEtBarrel<seedConfiguration.getParameter<double>("SCEtCut"))
457  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The minimum super-cluster Et in barrel is lower than during ecal seeding." ; }
458  if (cutsCfg_.minSCEtEndcaps<seedConfiguration.getParameter<double>("SCEtCut"))
459  { edm::LogWarning("GsfElectronAlgo|InconsistentParameters") <<"The minimum super-cluster Et in endcaps is lower than during ecal seeding." ; }
460  }
T getParameter(std::string const &) const
GsfElectronAlgo::CutsConfiguration cutsCfg_
ElectronHcalHelper::Configuration hcalCfg_
void GsfElectronBaseProducer::endEvent ( )
protected
void GsfElectronBaseProducer::fillDescription ( edm::ParameterSetDescription desc)
static

Definition at line 28 of file GsfElectronBaseProducer.cc.

References edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

29  {
30  // input collections
31  desc.add<edm::InputTag>("previousGsfElectronsTag",edm::InputTag("ecalDrivenGsfElectrons")) ;
32  desc.add<edm::InputTag>("pflowGsfElectronsTag",edm::InputTag("pflowGsfElectrons")) ;
33  desc.add<edm::InputTag>("gsfElectronCoresTag",edm::InputTag("gsfElectronCores")) ;
34  desc.add<edm::InputTag>("hcalTowers",edm::InputTag("towerMaker")) ;
35  desc.add<edm::InputTag>("barrelRecHitCollectionTag",edm::InputTag("ecalRecHit","EcalRecHitsEB")) ;
36  desc.add<edm::InputTag>("endcapRecHitCollectionTag",edm::InputTag("ecalRecHit","EcalRecHitsEE")) ;
37  //desc.add<edm::InputTag>("pfMvaTag",edm::InputTag("pfElectronTranslator:pf")) ;
38  desc.add<edm::InputTag>("seedsTag",edm::InputTag("ecalDrivenElectronSeeds")) ;
39  desc.add<edm::InputTag>("beamSpotTag",edm::InputTag("offlineBeamSpot")) ;
40  desc.add<edm::InputTag>("gsfPfRecTracksTag",edm::InputTag("pfTrackElec")) ;
41  //desc.add<std::vector<std::string>>("SoftElecMVAFilesString",std::vector<std::string> ("SoftElecMVAFile"));
42 
43 
44  // backward compatibility mechanism for ctf tracks
45  desc.add<bool>("ctfTracksCheck",true) ;
46  desc.add<edm::InputTag>("ctfTracksTag",edm::InputTag("generalTracks")) ;
47 
48  desc.add<bool>("gedElectronMode",true) ;
49  desc.add<double>("PreSelectMVA",-0.1) ;
50  desc.add<double>("MaxElePtForOnlyMVA",50.0) ;
51 
52  // steering
53  desc.add<bool>("useGsfPfRecTracks",true) ;
54  desc.add<bool>("applyPreselection",false) ;
55  desc.add<bool>("ecalDrivenEcalEnergyFromClassBasedParameterization",false) ;
56  desc.add<bool>("ecalDrivenEcalErrorFromClassBasedParameterization",false) ;
57  desc.add<bool>("pureTrackerDrivenEcalErrorFromSimpleParameterization",false) ;
58  desc.add<bool>("applyAmbResolution",false) ;
59  desc.add<unsigned>("ambSortingStrategy",1) ;
60  desc.add<unsigned>("ambClustersOverlapStrategy",1) ;
61  //desc.add<bool>("addPflowElectrons",true) ;
62 
63 // // preselection parameters (ecal driven electrons)
64 // desc.add<bool>("seedFromTEC",true) ;
65 // desc.add<double>("minSCEtBarrel",4.0) ;
66 // desc.add<double>("minSCEtEndcaps",4.0) ;
67 // desc.add<double>("minEOverPBarrel",0.0) ;
68 // desc.add<double>("maxEOverPBarrel",999999999.) ;
69 // desc.add<double>("minEOverPEndcaps",0.0) ;
70 // desc.add<double>("maxEOverPEndcaps",999999999.) ;
71 // desc.add<double>("maxDeltaEtaBarrel",0.02) ;
72 // desc.add<double>("maxDeltaEtaEndcaps",0.02) ;
73 // desc.add<double>("maxDeltaPhiBarrel",0.15) ;
74 // desc.add<double>("maxDeltaPhiEndcaps",0.15) ;
75 // desc.add<double>("hOverEConeSize",0.15) ;
76 // desc.add<double>("hOverEPtMin",0.) ;
77 // desc.add<double>("maxHOverEBarrel",0.15) ;
78 // desc.add<double>("maxHOverEEndcaps",0.15) ;
79 // desc.add<double>("maxHBarrel",0.0) ;
80 // desc.add<double>("maxHEndcaps",0.0) ;
81 // desc.add<double>("maxSigmaIetaIetaBarrel",999999999.) ;
82 // desc.add<double>("maxSigmaIetaIetaEndcaps",999999999.) ;
83 // desc.add<double>("maxFbremBarrel",999999999.) ;
84 // desc.add<double>("maxFbremEndcaps",999999999.) ;
85 // desc.add<bool>("isBarrel",false) ;
86 // desc.add<bool>("isEndcaps",false) ;
87 // desc.add<bool>("isFiducial",false) ;
88 // desc.add<double>("maxTIP",999999999.) ;
89 // desc.add<double>("minMVA",-0.4) ;
90 //
91 // // preselection parameters (tracker driven only electrons)
92 // desc.add<double>("minSCEtBarrelPflow",0.0) ;
93 // desc.add<double>("minSCEtEndcapsPflow",0.0) ;
94 // desc.add<double>("minEOverPBarrelPflow",0.0) ;
95 // desc.add<double>("maxEOverPBarrelPflow",999999999.) ;
96 // desc.add<double>("minEOverPEndcapsPflow",0.0) ;
97 // desc.add<double>("maxEOverPEndcapsPflow",999999999.) ;
98 // desc.add<double>("maxDeltaEtaBarrelPflow",999999999.) ;
99 // desc.add<double>("maxDeltaEtaEndcapsPflow",999999999.) ;
100 // desc.add<double>("maxDeltaPhiBarrelPflow",999999999.) ;
101 // desc.add<double>("maxDeltaPhiEndcapsPflow",999999999.) ;
102 // desc.add<double>("hOverEConeSizePflow",0.15) ;
103 // desc.add<double>("hOverEPtMinPflow",0.) ;
104 // desc.add<double>("maxHOverEBarrelPflow",999999999.) ;
105 // desc.add<double>("maxHOverEEndcapsPflow",999999999.) ;
106 // desc.add<double>("maxHBarrelPflow",0.0) ;
107 // desc.add<double>("maxHEndcapsPflow",0.0) ;
108 // desc.add<double>("maxSigmaIetaIetaBarrelPflow",999999999.) ;
109 // desc.add<double>("maxSigmaIetaIetaEndcapsPflow",999999999.) ;
110 // desc.add<double>("maxFbremBarrelPflow",999999999.) ;
111 // desc.add<double>("maxFbremEndcapsPflow",999999999.) ;
112 // desc.add<bool>("isBarrelPflow",false) ;
113 // desc.add<bool>("isEndcapsPflow",false) ;
114 // desc.add<bool>("isFiducialPflow",false) ;
115 // desc.add<double>("maxTIPPflow",999999999.) ;
116 // desc.add<double>("minMVAPflow",-0.4) ;
117 
118  // Ecal rec hits configuration
119  desc.add<std::vector<int> >("recHitFlagsToBeExcludedBarrel") ;
120  desc.add<std::vector<int> >("recHitFlagsToBeExcludedEndcaps") ;
121  desc.add<std::vector<int> >("recHitSeverityToBeExcludedBarrel") ;
122  desc.add<std::vector<int> >("recHitSeverityToBeExcludedEndcaps") ;
123  //desc.add<int>("severityLevelCut",4) ;
124 
125  // Isolation algos configuration
126  desc.add<double>("intRadiusBarrelTk",0.015) ;
127  desc.add<double>("intRadiusEndcapTk",0.015) ;
128  desc.add<double>("stripBarrelTk",0.015) ;
129  desc.add<double>("stripEndcapTk",0.015) ;
130  desc.add<double>("ptMinTk",0.7) ;
131  desc.add<double>("maxVtxDistTk",0.2) ;
132  desc.add<double>("maxDrbTk",999999999.) ;
133  desc.add<double>("intRadiusHcal",0.15) ;
134  desc.add<double>("etMinHcal",0.0) ;
135  desc.add<double>("intRadiusEcalBarrel",3.0) ;
136  desc.add<double>("intRadiusEcalEndcaps",3.0) ;
137  desc.add<double>("jurassicWidth",1.5) ;
138  desc.add<double>("etMinBarrel",0.0) ;
139  desc.add<double>("eMinBarrel",0.08) ;
140  desc.add<double>("etMinEndcaps",0.1) ;
141  desc.add<double>("eMinEndcaps",0.0) ;
142  desc.add<bool>("vetoClustered",false) ;
143  desc.add<bool>("useNumCrystals",true) ;
144 
145  edm::ParameterSetDescription descNested ;
146  descNested.add<std::string>("propagatorAlongTISE","PropagatorWithMaterial") ;
147  descNested.add<std::string>("propagatorOppositeTISE","PropagatorWithMaterialOpposite") ;
148  desc.add<edm::ParameterSetDescription>("TransientInitialStateEstimatorParameters",descNested) ;
149 
150  // Corrections
151  desc.add<std::string>("superClusterErrorFunction","EcalClusterEnergyUncertaintyObjectSpecific") ;
152  desc.add<std::string>("crackCorrectionFunction","EcalClusterCrackCorrection") ;
153  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void GsfElectronBaseProducer::fillEvent ( edm::Event event)
protected

Definition at line 412 of file GsfElectronBaseProducer.cc.

References algo_, GsfElectronAlgo::StrategyConfiguration::applyAmbResolution, GsfElectronAlgo::StrategyConfiguration::applyPreselection, GsfElectronAlgo::copyElectrons(), GsfElectronAlgo::displayInternalElectrons(), orphanHandle_, GsfElectronAlgo::removeAmbiguousElectrons(), GsfElectronAlgo::removeNotPreselectedElectrons(), GsfElectronAlgo::setAmbiguityData(), and strategyCfg_.

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

413  {
414  // all electrons
415  algo_->displayInternalElectrons("GsfElectronAlgo Info (before preselection)") ;
416  // preselection
418  {
420  algo_->displayInternalElectrons("GsfElectronAlgo Info (after preselection)") ;
421  }
422  // ambiguity
425  {
427  algo_->displayInternalElectrons("GsfElectronAlgo Info (after amb. solving)") ;
428  }
429  // final filling
430  std::auto_ptr<GsfElectronCollection> finalCollection( new GsfElectronCollection ) ;
431  algo_->copyElectrons(*finalCollection) ;
432  orphanHandle_ = event.put(finalCollection) ;
433 }
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
GsfElectronAlgo::StrategyConfiguration strategyCfg_
void removeAmbiguousElectrons()
void displayInternalElectrons(const std::string &title) const
void removeNotPreselectedElectrons()
void copyElectrons(reco::GsfElectronCollection &)
void setAmbiguityData(bool ignoreNotPreselected=true)
edm::OrphanHandle< reco::GsfElectronCollection > orphanHandle_
reco::GsfElectron* GsfElectronBaseProducer::newElectron ( )
inlineprotected

Definition at line 45 of file GsfElectronBaseProducer.h.

45 { return 0 ; }
const edm::OrphanHandle<reco::GsfElectronCollection>& GsfElectronBaseProducer::orphanHandle ( ) const
inlineprotected

Definition at line 46 of file GsfElectronBaseProducer.h.

References orphanHandle_.

Referenced by GEDGsfElectronProducer::fillGsfElectronValueMap().

46 { return orphanHandle_;}
edm::OrphanHandle< reco::GsfElectronCollection > orphanHandle_

Member Data Documentation

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

Definition at line 59 of file GsfElectronBaseProducer.h.

Referenced by beginEvent().

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

Definition at line 54 of file GsfElectronBaseProducer.h.

Referenced by GsfElectronBaseProducer().

GsfElectronAlgo::InputTagsConfiguration GsfElectronBaseProducer::inputCfg_
protected
SoftElectronMVAEstimator::Configuration GsfElectronBaseProducer::mvaCfg_
protected

Definition at line 55 of file GsfElectronBaseProducer.h.

Referenced by GsfElectronBaseProducer().

edm::OrphanHandle<reco::GsfElectronCollection> GsfElectronBaseProducer::orphanHandle_
private

Definition at line 61 of file GsfElectronBaseProducer.h.

Referenced by fillEvent(), and orphanHandle().

GsfElectronAlgo::StrategyConfiguration GsfElectronBaseProducer::strategyCfg_
protected