CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfElectronProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: EgammaElectronProducers
4 // Class: GsfElectronProducer
5 //
14 #include "GsfElectronProducer.h"
15 
24 
33 
34 
35 #include <iostream>
36 
37 using namespace reco;
38 
39 /* void GsfElectronProducer::fillDescriptions( edm::ConfigurationDescriptions & descriptions )
40  {
41  edm::ParameterSetDescription desc ;
42  GsfElectronBaseProducer::fillDescription(desc) ;
43 
44  // input collections
45  desc.add<edm::InputTag>("gsfElectronCoresTag",edm::InputTag("gsfElectronCores")) ;
46  desc.add<edm::InputTag>("ecalDrivenGsfElectronsTag",edm::InputTag("ecalDrivenGsfElectrons")) ;
47  desc.add<edm::InputTag>("pfMvaTag",edm::InputTag("pfElectronTranslator:pf")) ;
48 
49  // steering
50  desc.add<bool>("addPflowElectrons",true) ;
51 
52  // preselection parameters (tracker driven only electrons)
53  desc.add<double>("minSCEtBarrelPflow",0.0) ;
54  desc.add<double>("minSCEtEndcapsPflow",0.0) ;
55  desc.add<double>("minEOverPBarrelPflow",0.0) ;
56  desc.add<double>("maxEOverPBarrelPflow",999999999.) ;
57  desc.add<double>("minEOverPEndcapsPflow",0.0) ;
58  desc.add<double>("maxEOverPEndcapsPflow",999999999.) ;
59  desc.add<double>("maxDeltaEtaBarrelPflow",999999999.) ;
60  desc.add<double>("maxDeltaEtaEndcapsPflow",999999999.) ;
61  desc.add<double>("maxDeltaPhiBarrelPflow",999999999.) ;
62  desc.add<double>("maxDeltaPhiEndcapsPflow",999999999.) ;
63  desc.add<double>("hOverEConeSizePflow",0.15) ;
64  desc.add<double>("hOverEPtMinPflow",0.) ;
65  desc.add<double>("maxHOverEBarrelPflow",999999999.) ;
66  desc.add<double>("maxHOverEEndcapsPflow",999999999.) ;
67  desc.add<double>("maxHBarrelPflow",0.0) ;
68  desc.add<double>("maxHEndcapsPflow",0.0) ;
69  desc.add<double>("maxSigmaIetaIetaBarrelPflow",999999999.) ;
70  desc.add<double>("maxSigmaIetaIetaEndcapsPflow",999999999.) ;
71  desc.add<double>("maxFbremBarrelPflow",999999999.) ;
72  desc.add<double>("maxFbremEndcapsPflow",999999999.) ;
73  desc.add<bool>("isBarrelPflow",false) ;
74  desc.add<bool>("isEndcapsPflow",false) ;
75  desc.add<bool>("isFiducialPflow",false) ;
76  desc.add<double>("maxTIPPflow",999999999.) ;
77  desc.add<double>("minMVAPflow",-0.4) ;
78 
79  descriptions.add("produceGsfElectrons",desc) ;
80  }
81  */
83  : GsfElectronBaseProducer(cfg), pfTranslatorParametersChecked_(false)
84  {}
85 
87  {}
88 
90  {
91  beginEvent(event,setup) ;
93  // don't add pflow only electrons if one so wish
95  { algo_->completeElectrons() ; }
96  algo_->addPflowInfo() ;
97  fillEvent(event) ;
98  endEvent() ;
99  }
100 
102  {
103  // extra configuration checks
105  {
108  event.getByLabel(inputCfg_.pfMVA,pfMva) ;
109  checkPfTranslatorParameters(pfMva.provenance()->psetID()) ;
110  }
111 
112  // call to base class
114  }
115 
117  {
118  edm::ParameterSet pset ;
119  edm::pset::Registry::instance()->getMapped(psetid,pset) ;
120  edm::ParameterSet mvaBlock = pset.getParameter<edm::ParameterSet>("MVACutBlock") ;
121  double pfTranslatorMinMva = mvaBlock.getParameter<double>("MVACut") ;
122  double pfTranslatorUndefined = -99. ;
123  if (strategyCfg_.applyPreselection&&(cutsCfgPflow_.minMVA<pfTranslatorMinMva))
124  {
125  // For pure tracker seeded electrons, if MVA is under translatorMinMva, there is no supercluster
126  // of any kind available, so GsfElectronCoreProducer has already discarded the electron.
127  edm::LogWarning("GsfElectronAlgo|MvaCutTooLow")
128  <<"Parameter minMVAPflow ("<<cutsCfgPflow_.minMVA<<") will have no effect on purely tracker seeded electrons."
129  <<" It is inferior to the cut already applied by PFlow translator ("<<pfTranslatorMinMva<<")." ;
130  }
131  if (strategyCfg_.applyPreselection&&(cutsCfg_.minMVA<pfTranslatorMinMva))
132  {
133  // For ecal seeded electrons, there is a cluster and GsfElectronCoreProducer has kept all electrons,
134  // but when MVA is under translatorMinMva, the translator has not stored the supercluster and
135  // forced the MVA value to translatorUndefined
136  if (cutsCfg_.minMVA>pfTranslatorUndefined)
137  {
138  edm::LogWarning("GsfElectronAlgo|IncompletePflowInformation")
139  <<"Parameter minMVA ("<<cutsCfg_.minMVA<<")is inferior to the cut applied by PFlow translator ("<<pfTranslatorMinMva<<")."
140  <<" Some ecal (and eventually tracker) seeded electrons may lack their MVA value and PFlow supercluster." ;
141  }
142  else
143  {
144  // the MVA value has been forced to translatorUndefined, inferior minMVAPflow
145  // so the cut actually applied is the PFlow one
146  throw cms::Exception("GsfElectronAlgo|BadMvaCut")
147  <<"Parameter minMVA is inferior to the lowest possible value."
148  <<" Every electron will be blessed whatever other criteria." ;
149  }
150  }
151  }
152 
153 
void checkPfTranslatorParameters(edm::ParameterSetID const &)
T getParameter(std::string const &) const
void clonePreviousElectrons()
static ThreadSafeRegistry * instance()
bool getMapped(key_type const &k, value_type &result) const
GsfElectronAlgo::InputTagsConfiguration inputCfg_
GsfElectronAlgo::CutsConfiguration cutsCfg_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
GsfElectronProducer(const edm::ParameterSet &)
GsfElectronAlgo::StrategyConfiguration strategyCfg_
void beginEvent(edm::Event &, const edm::EventSetup &)
void beginEvent(edm::Event &, const edm::EventSetup &)
virtual void produce(edm::Event &, const edm::EventSetup &)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
Provenance const * provenance() const
Definition: HandleBase.h:84