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 
23 
31 
32 
33 #include <iostream>
34 
35 using namespace reco;
36 
37 /* void GsfElectronProducer::fillDescriptions( edm::ConfigurationDescriptions & descriptions )
38  {
39  edm::ParameterSetDescription desc ;
40  GsfElectronBaseProducer::fillDescription(desc) ;
41 
42  // input collections
43  desc.add<edm::InputTag>("gsfElectronCoresTag",edm::InputTag("gsfElectronCores")) ;
44  desc.add<edm::InputTag>("ecalDrivenGsfElectronsTag",edm::InputTag("ecalDrivenGsfElectrons")) ;
45  desc.add<edm::InputTag>("pfMvaTag",edm::InputTag("pfElectronTranslator:pf")) ;
46 
47  // steering
48  desc.add<bool>("addPflowElectrons",true) ;
49 
50  // preselection parameters (tracker driven only electrons)
51  desc.add<double>("minSCEtBarrelPflow",0.0) ;
52  desc.add<double>("minSCEtEndcapsPflow",0.0) ;
53  desc.add<double>("minEOverPBarrelPflow",0.0) ;
54  desc.add<double>("maxEOverPBarrelPflow",999999999.) ;
55  desc.add<double>("minEOverPEndcapsPflow",0.0) ;
56  desc.add<double>("maxEOverPEndcapsPflow",999999999.) ;
57  desc.add<double>("maxDeltaEtaBarrelPflow",999999999.) ;
58  desc.add<double>("maxDeltaEtaEndcapsPflow",999999999.) ;
59  desc.add<double>("maxDeltaPhiBarrelPflow",999999999.) ;
60  desc.add<double>("maxDeltaPhiEndcapsPflow",999999999.) ;
61  desc.add<double>("hOverEConeSizePflow",0.15) ;
62  desc.add<double>("hOverEPtMinPflow",0.) ;
63  desc.add<double>("maxHOverEBarrelPflow",999999999.) ;
64  desc.add<double>("maxHOverEEndcapsPflow",999999999.) ;
65  desc.add<double>("maxHBarrelPflow",0.0) ;
66  desc.add<double>("maxHEndcapsPflow",0.0) ;
67  desc.add<double>("maxSigmaIetaIetaBarrelPflow",999999999.) ;
68  desc.add<double>("maxSigmaIetaIetaEndcapsPflow",999999999.) ;
69  desc.add<double>("maxFbremBarrelPflow",999999999.) ;
70  desc.add<double>("maxFbremEndcapsPflow",999999999.) ;
71  desc.add<bool>("isBarrelPflow",false) ;
72  desc.add<bool>("isEndcapsPflow",false) ;
73  desc.add<bool>("isFiducialPflow",false) ;
74  desc.add<double>("maxTIPPflow",999999999.) ;
75  desc.add<double>("minMVAPflow",-0.4) ;
76 
77  descriptions.add("produceGsfElectrons",desc) ;
78  }
79  */
81  : GsfElectronBaseProducer(cfg), pfTranslatorParametersChecked_(false)
82  {}
83 
85  {}
86 
88  {
89  beginEvent(event,setup) ;
91  // don't add pflow only electrons if one so wish
93  { algo_->completeElectrons() ; }
94  algo_->addPflowInfo() ;
95  fillEvent(event) ;
96  endEvent() ;
97  }
98 
100  {
101  // extra configuration checks
103  {
106  event.getByLabel(inputCfg_.pfMVA,pfMva) ;
107  checkPfTranslatorParameters(pfMva.provenance()->psetID()) ;
108  }
109 
110  // call to base class
112  }
113 
115  {
117  edm::pset::Registry::instance()->getMapped(psetid,pset) ;
118  edm::ParameterSet mvaBlock = pset.getParameter<edm::ParameterSet>("MVACutBlock") ;
119  double pfTranslatorMinMva = mvaBlock.getParameter<double>("MVACut") ;
120  double pfTranslatorUndefined = -99. ;
121  if (strategyCfg_.applyPreselection&&(cutsCfgPflow_.minMVA<pfTranslatorMinMva))
122  {
123  // For pure tracker seeded electrons, if MVA is under translatorMinMva, there is no supercluster
124  // of any kind available, so GsfElectronCoreProducer has already discarded the electron.
125  edm::LogWarning("GsfElectronAlgo|MvaCutTooLow")
126  <<"Parameter minMVAPflow ("<<cutsCfgPflow_.minMVA<<") will have no effect on purely tracker seeded electrons."
127  <<" It is inferior to the cut already applied by PFlow translator ("<<pfTranslatorMinMva<<")." ;
128  }
129  if (strategyCfg_.applyPreselection&&(cutsCfg_.minMVA<pfTranslatorMinMva))
130  {
131  // For ecal seeded electrons, there is a cluster and GsfElectronCoreProducer has kept all electrons,
132  // but when MVA is under translatorMinMva, the translator has not stored the supercluster and
133  // forced the MVA value to translatorUndefined
134  if (cutsCfg_.minMVA>pfTranslatorUndefined)
135  {
136  edm::LogWarning("GsfElectronAlgo|IncompletePflowInformation")
137  <<"Parameter minMVA ("<<cutsCfg_.minMVA<<")is inferior to the cut applied by PFlow translator ("<<pfTranslatorMinMva<<")."
138  <<" Some ecal (and eventually tracker) seeded electrons may lack their MVA value and PFlow supercluster." ;
139  }
140  else
141  {
142  // the MVA value has been forced to translatorUndefined, inferior minMVAPflow
143  // so the cut actually applied is the PFlow one
144  throw cms::Exception("GsfElectronAlgo|BadMvaCut")
145  <<"Parameter minMVA is inferior to the lowest possible value."
146  <<" Every electron will be blessed whatever other criteria." ;
147  }
148  }
149  }
150 
151 
void checkPfTranslatorParameters(edm::ParameterSetID const &)
T getParameter(std::string const &) const
void clonePreviousElectrons()
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 &)
static ThreadSafeRegistry * instance()
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
Provenance const * provenance() const
Definition: HandleBase.h:84