00001 #include "RecoEgamma/ElectronIdentification/plugins/ElectronLikelihoodESSource.h"
00002
00003 ElectronLikelihoodESSource::ElectronLikelihoodESSource (const edm::ParameterSet& cfg) :
00004 m_eleWeight (cfg.getParameter<double> ("eleWeight")) ,
00005 m_piWeight (cfg.getParameter<double> ("piWeight")) ,
00006 m_signalWeightSplitting (cfg.getParameter<std::string> ("signalWeightSplitting")) ,
00007 m_backgroundWeightSplitting (cfg.getParameter<std::string> ("backgroundWeightSplitting")) ,
00008 m_splitSignalPdfs (cfg.getParameter<bool> ("splitSignalPdfs")) ,
00009 m_splitBackgroundPdfs (cfg.getParameter<bool> ("splitBackgroundPdfs"))
00010 {
00011 setWhatProduced (this) ;
00012 findingRecord<ElectronLikelihoodRcd> () ;
00013
00014 m_fisherEBLt15.push_back (cfg.getParameter<double> ("fisherCoeffEBLt15_constant")) ;
00015 m_fisherEBLt15.push_back (cfg.getParameter<double> ("fisherCoeffEBLt15_sigmaEtaEta")) ;
00016 m_fisherEBLt15.push_back (cfg.getParameter<double> ("fisherCoeffEBLt15_s9s25")) ;
00017 m_fisherEBLt15.push_back (cfg.getParameter<double> ("fisherCoeffEBLt15_etaLat")) ;
00018 m_fisherEBLt15.push_back (cfg.getParameter<double> ("fisherCoeffEBLt15_a20")) ;
00019 m_fisherEBGt15.push_back (cfg.getParameter<double> ("fisherCoeffEBGt15_constant")) ;
00020 m_fisherEBGt15.push_back (cfg.getParameter<double> ("fisherCoeffEBGt15_sigmaEtaEta")) ;
00021 m_fisherEBGt15.push_back (cfg.getParameter<double> ("fisherCoeffEBGt15_s9s25")) ;
00022 m_fisherEBGt15.push_back (cfg.getParameter<double> ("fisherCoeffEBGt15_etaLat")) ;
00023 m_fisherEBGt15.push_back (cfg.getParameter<double> ("fisherCoeffEBGt15_a20")) ;
00024 m_fisherEELt15.push_back (cfg.getParameter<double> ("fisherCoeffEELt15_constant")) ;
00025 m_fisherEELt15.push_back (cfg.getParameter<double> ("fisherCoeffEELt15_sigmaEtaEta")) ;
00026 m_fisherEELt15.push_back (cfg.getParameter<double> ("fisherCoeffEELt15_s9s25")) ;
00027 m_fisherEELt15.push_back (cfg.getParameter<double> ("fisherCoeffEELt15_etaLat")) ;
00028 m_fisherEELt15.push_back (cfg.getParameter<double> ("fisherCoeffEELt15_a20")) ;
00029 m_fisherEEGt15.push_back (cfg.getParameter<double> ("fisherCoeffEEGt15_constant")) ;
00030 m_fisherEEGt15.push_back (cfg.getParameter<double> ("fisherCoeffEEGt15_sigmaEtaEta")) ;
00031 m_fisherEEGt15.push_back (cfg.getParameter<double> ("fisherCoeffEEGt15_s9s25")) ;
00032 m_fisherEEGt15.push_back (cfg.getParameter<double> ("fisherCoeffEEGt15_etaLat")) ;
00033 m_fisherEEGt15.push_back (cfg.getParameter<double> ("fisherCoeffEEGt15_a20")) ;
00034
00035 m_eleEBFracsLt15.push_back (cfg.getParameter<double> ("eleEBGoldenFracLt15")) ;
00036 m_eleEBFracsLt15.push_back (cfg.getParameter<double> ("eleEBBigbremFracLt15")) ;
00037 m_eleEBFracsLt15.push_back (cfg.getParameter<double> ("eleEBNarrowFracLt15")) ;
00038 m_eleEBFracsLt15.push_back (cfg.getParameter<double> ("eleEBShoweringFracLt15")) ;
00039 m_eleEBFracsGt15.push_back (cfg.getParameter<double> ("eleEBGoldenFracGt15")) ;
00040 m_eleEBFracsGt15.push_back (cfg.getParameter<double> ("eleEBBigbremFracGt15")) ;
00041 m_eleEBFracsGt15.push_back (cfg.getParameter<double> ("eleEBNarrowFracGt15")) ;
00042 m_eleEBFracsGt15.push_back (cfg.getParameter<double> ("eleEBShoweringFracGt15")) ;
00043 m_piEBFracsLt15.push_back (cfg.getParameter<double> ("piEBGoldenFracLt15")) ;
00044 m_piEBFracsLt15.push_back (cfg.getParameter<double> ("piEBBigbremFracLt15")) ;
00045 m_piEBFracsLt15.push_back (cfg.getParameter<double> ("piEBNarrowFracLt15")) ;
00046 m_piEBFracsLt15.push_back (cfg.getParameter<double> ("piEBShoweringFracLt15")) ;
00047 m_piEBFracsGt15.push_back (cfg.getParameter<double> ("piEBGoldenFracGt15")) ;
00048 m_piEBFracsGt15.push_back (cfg.getParameter<double> ("piEBBigbremFracGt15")) ;
00049 m_piEBFracsGt15.push_back (cfg.getParameter<double> ("piEBNarrowFracGt15")) ;
00050 m_piEBFracsGt15.push_back (cfg.getParameter<double> ("piEBShoweringFracGt15")) ;
00051
00052 m_eleEEFracsLt15.push_back (cfg.getParameter<double> ("eleEEGoldenFracLt15")) ;
00053 m_eleEEFracsLt15.push_back (cfg.getParameter<double> ("eleEEBigbremFracLt15")) ;
00054 m_eleEEFracsLt15.push_back (cfg.getParameter<double> ("eleEENarrowFracLt15")) ;
00055 m_eleEEFracsLt15.push_back (cfg.getParameter<double> ("eleEEShoweringFracLt15")) ;
00056 m_piEEFracsLt15.push_back (cfg.getParameter<double> ("piEEGoldenFracLt15")) ;
00057 m_piEEFracsLt15.push_back (cfg.getParameter<double> ("piEEBigbremFracLt15")) ;
00058 m_piEEFracsLt15.push_back (cfg.getParameter<double> ("piEENarrowFracLt15")) ;
00059 m_piEEFracsLt15.push_back (cfg.getParameter<double> ("piEEShoweringFracLt15")) ;
00060 m_eleEEFracsGt15.push_back (cfg.getParameter<double> ("eleEEGoldenFracGt15")) ;
00061 m_eleEEFracsGt15.push_back (cfg.getParameter<double> ("eleEEBigbremFracGt15")) ;
00062 m_eleEEFracsGt15.push_back (cfg.getParameter<double> ("eleEENarrowFracGt15")) ;
00063 m_eleEEFracsGt15.push_back (cfg.getParameter<double> ("eleEEShoweringFracGt15")) ;
00064 m_piEEFracsGt15.push_back (cfg.getParameter<double> ("piEEGoldenFracGt15")) ;
00065 m_piEEFracsGt15.push_back (cfg.getParameter<double> ("piEEBigbremFracGt15")) ;
00066 m_piEEFracsGt15.push_back (cfg.getParameter<double> ("piEENarrowFracGt15")) ;
00067 m_piEEFracsGt15.push_back (cfg.getParameter<double> ("piEEShoweringFracGt15")) ;
00068
00069 m_eleIDSwitches.m_useDeltaEtaCalo = cfg.getParameter<double> ("useDeltaEtaCalo") ;
00070 m_eleIDSwitches.m_useDeltaPhiIn = cfg.getParameter<double> ("useDeltaPhiIn") ;
00071 m_eleIDSwitches.m_useHoverE = cfg.getParameter<double> ("useHoverE") ;
00072 m_eleIDSwitches.m_useEoverPOut = cfg.getParameter<double> ("useEoverPOut") ;
00073 m_eleIDSwitches.m_useShapeFisher = cfg.getParameter<double> ("useShapeFisher") ;
00074 m_eleIDSwitches.m_useSigmaEtaEta = cfg.getParameter<double> ("useSigmaEtaEta") ;
00075 m_eleIDSwitches.m_useE9overE25 = cfg.getParameter<double> ("useE9overE25") ;
00076 }
00077
00078
00079
00080
00081
00082 ElectronLikelihoodESSource::~ElectronLikelihoodESSource() {
00083 }
00084
00085
00086
00087
00088
00089 ElectronLikelihoodESSource::ReturnType
00090 ElectronLikelihoodESSource::produce (const ElectronLikelihoodRcd & iRecord)
00091 {
00092
00093 const ElectronLikelihoodCalibration *calibration = readPdfFromDB (iRecord) ;
00094
00095 ReturnType LHAlgo (new ElectronLikelihood (&(*calibration),
00096 m_fisherEBLt15, m_fisherEBGt15,
00097 m_fisherEELt15, m_fisherEEGt15,
00098 m_eleEBFracsLt15, m_piEBFracsLt15,
00099 m_eleEEFracsLt15, m_piEEFracsLt15,
00100 m_eleEBFracsGt15, m_piEBFracsGt15,
00101 m_eleEEFracsGt15, m_piEEFracsGt15,
00102 m_eleWeight, m_piWeight,
00103 m_eleIDSwitches,
00104 m_signalWeightSplitting, m_backgroundWeightSplitting,
00105 m_splitSignalPdfs, m_splitBackgroundPdfs
00106 ) );
00107
00108 return LHAlgo;
00109 }
00110
00111
00112
00113
00114
00115 void
00116 ElectronLikelihoodESSource::setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
00117 const edm::IOVSyncValue&,
00118 edm::ValidityInterval& oInterval ) {
00119
00120 oInterval = edm::ValidityInterval (edm::IOVSyncValue::beginOfTime (),
00121 edm::IOVSyncValue::endOfTime ()) ;
00122 }
00123
00124
00125
00126
00127 const ElectronLikelihoodCalibration*
00128 ElectronLikelihoodESSource::readPdfFromDB( const ElectronLikelihoodRcd & iRecord ) {
00129
00130
00131 const ElectronLikelihoodCalibration *calibration = 0;
00132 edm::ESHandle<ElectronLikelihoodCalibration> calibHandle;
00133 iRecord.getRecord<ElectronLikelihoodPdfsRcd>().get(calibHandle);
00134 calibration = calibHandle.product();
00135
00136 return calibration;
00137 }