CMS 3D CMS Logo

ElectronLikelihoodESSource.cc
Go to the documentation of this file.
2 
4  m_signalWeightSplitting (cfg.getParameter<std::string> ("signalWeightSplitting")) ,
5  m_backgroundWeightSplitting (cfg.getParameter<std::string> ("backgroundWeightSplitting")) ,
6  m_splitSignalPdfs (cfg.getParameter<bool> ("splitSignalPdfs")) ,
7  m_splitBackgroundPdfs (cfg.getParameter<bool> ("splitBackgroundPdfs"))
8 {
9  setWhatProduced (this) ;
10  findingRecord<ElectronLikelihoodRcd> () ;
11 
12  m_eleIDSwitches.m_useDeltaEta = cfg.getParameter<bool> ("useDeltaEta") ;
13  m_eleIDSwitches.m_useDeltaPhi = cfg.getParameter<bool> ("useDeltaPhi") ;
14  m_eleIDSwitches.m_useHoverE = cfg.getParameter<bool> ("useHoverE") ;
15  m_eleIDSwitches.m_useEoverP = cfg.getParameter<bool> ("useEoverP") ;
16  m_eleIDSwitches.m_useSigmaEtaEta = cfg.getParameter<bool> ("useSigmaEtaEta") ;
17  m_eleIDSwitches.m_useSigmaPhiPhi = cfg.getParameter<bool> ("useSigmaPhiPhi") ;
18  m_eleIDSwitches.m_useFBrem = cfg.getParameter<bool> ("useFBrem") ;
19  m_eleIDSwitches.m_useOneOverEMinusOneOverP = cfg.getParameter<bool> ("useOneOverEMinusOneOverP") ;
20 
21 }
22 
23 
24 // ----------------------------------------------------
25 
26 
28 }
29 
30 
31 // ----------------------------------------------------
32 
33 
36 {
37 
38  const ElectronLikelihoodCalibration *calibration = readPdfFromDB (iRecord) ;
39 
40  ReturnType LHAlgo (new ElectronLikelihood (&(*calibration),
44  ) );
45 
46  return LHAlgo;
47 }
48 
49 
50 // ----------------------------------------------------
51 
52 
53 void
55  const edm::IOVSyncValue&,
56  edm::ValidityInterval& oInterval ) {
57  // the same PDF's is valid for any time
60 }
61 
62 
63 // ----------------------------------------------------
64 
67 
68  // setup the PDF's from DB
69  const ElectronLikelihoodCalibration *calibration = nullptr;
71  iRecord.getRecord<ElectronLikelihoodPdfsRcd>().get(calibHandle);
72  calibration = calibHandle.product();
73 
74  return calibration;
75 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
std::string m_signalWeightSplitting
signal pdf splitting
~ElectronLikelihoodESSource() override
destructor
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
const ElectronLikelihoodCalibration * readPdfFromDB(const ElectronLikelihoodRcd &)
read PDF&#39;s from CondDB
LikelihoodSwitches m_eleIDSwitches
general parameters of the id algorithm
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
set validity interval
std::unique_ptr< ElectronLikelihood > ReturnType
define the return type
ReturnType produce(const ElectronLikelihoodRcd &)
return the particle table
T const * product() const
Definition: ESHandle.h:86
ElectronLikelihoodESSource(const edm::ParameterSet &)
constructor from parameter set