40 const GsfTrackRef oldElectronGsfTrackRef = oldCoreRef->gsfTrack();
42 for (icore = 0; icore < newCores->size(); ++icore) {
43 if (oldElectronGsfTrackRef == (*newCores)[icore].gsfTrack()) {
45 electrons.emplace_back(oldElectron, coreRef);
71 event.getByToken(
pfMVA_,pfMva) ;
82 double pfTranslatorMinMva = mvaBlock.
getParameter<
double>(
"MVACut") ;
83 double pfTranslatorUndefined = -99. ;
89 <<
"Parameter minMVAPflow ("<<
cutsCfgPflow_.
minMVA<<
") will have no effect on purely tracker seeded electrons." 90 <<
" It is inferior to the cut already applied by PFlow translator ("<<pfTranslatorMinMva<<
")." ;
100 <<
"Parameter minMVA ("<<
cutsCfg_.
minMVA<<
")is inferior to the cut applied by PFlow translator ("<<pfTranslatorMinMva<<
")." 101 <<
" Some ecal (and eventually tracker) seeded electrons may lack their MVA value and PFlow supercluster." ;
108 <<
"Parameter minMVA is inferior to the lowest possible value." 109 <<
" Every electron will be blessed whatever other criteria." ;
119 typedef std::vector<edm::Handle<edm::ValueMap<double> > > IsolationValueMaps;
121 IsolationValueMaps edIsolationValues;
124 std::vector<edm::InputTag> inputTagIsoVals;
130 pfIsolationValues.resize(inputTagIsoVals.size());
132 for (
size_t j = 0; j < inputTagIsoVals.size(); ++j) {
133 event.getByLabel(inputTagIsoVals[j], pfIsolationValues[j]);
138 inputTagIsoVals.clear();
143 edIsolationValues.resize(inputTagIsoVals.size());
145 for (
size_t j = 0; j < inputTagIsoVals.size(); ++j) {
146 event.getByLabel(inputTagIsoVals[j], edIsolationValues[j]);
153 reco::GsfElectronCollection::const_iterator pfElectron, edElectron;
154 unsigned int edIndex, pfIndex;
156 for (
auto& el : electrons) {
159 for (pfIndex = 0, pfElectron = pfElectrons->begin(); pfElectron != pfElectrons->end(); pfIndex++, pfElectron++) {
160 if (pfElectron->gsfTrack() == el.gsfTrack()) {
162 edm::LogWarning(
"GsfElectronProducer") <<
"associated pfGsfElectron already found";
167 if (!(pfIsolationValues).
empty()) {
173 el.setPfIsolationVariables(isoVariables);
177 el.setMvaInput(pfElectron->mvaInput());
178 el.setMvaOutput(pfElectron->mvaOutput());
179 if (el.ecalDrivenSeed()) {
180 el.setP4(GsfElectron::P4_PFLOW_COMBINATION, pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),
181 pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),
false);
183 el.setP4(GsfElectron::P4_PFLOW_COMBINATION, pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),
184 pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),
true);
186 double noCutMin = -999999999.;
187 if (el.mva_e_pi() < noCutMin) {
188 throw cms::Exception(
"GsfElectronAlgo|UnexpectedMvaValue") <<
"unexpected MVA value: " << el.mva_e_pi();
196 if (!(edIsolationValues).
empty()) {
197 edIndex = 0, edElectron = edElectrons->begin();
198 while ((found ==
false) && (edElectron != edElectrons->end())) {
199 if (edElectron->gsfTrack() == el.gsfTrack()) {
208 isoVariables.
sumPhotonEt = (*(edIsolationValues)[1])[edElectronRef];
210 el.setPfIsolationVariables(isoVariables);
228 if (ele.
core()->ecalDrivenSeed()) {
237 LogTrace(
"GsfElectronAlgo") <<
"Main mva criterion is satisfied";
GsfElectronProducer(const edm::ParameterSet &, const gsfAlgoHelpers::HeavyObjectCache *)
T getParameter(std::string const &) const
bool pfTranslatorParametersChecked_
def setup(process, global_tag, zero_tesla=False)
reco::GsfElectronCollection clonePreviousElectrons(edm::Event const &event) const
bool passingMvaPreselection() const
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
void fillEvent(reco::GsfElectronCollection &electrons, edm::Event &event)
void checkPfTranslatorParameters(edm::ParameterSet const &)
void completeElectrons(reco::GsfElectronCollection &electrons, edm::Event const &event, edm::EventSetup const &eventSetup, const gsfAlgoHelpers::HeavyObjectCache *hoc)
GsfElectronAlgo::InputTagsConfiguration inputCfg_
void setPflowPreselectionFlag(reco::GsfElectron &ele) const
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
std::vector< GsfElectronCore > GsfElectronCoreCollection
void setPassMvaPreselection(bool flag)
bool get(ProductID const &oid, Handle< PROD > &result) const
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
void addPflowInfo(reco::GsfElectronCollection &electrons, edm::Event const &event) const
const MvaOutput & mvaOutput() const
GsfElectronAlgo::StrategyConfiguration strategyCfg_
void beginEvent(edm::Event &, const edm::EventSetup &)
virtual GsfElectronCoreRef core() const
edm::EDGetTokenT< edm::ValueMap< float > > pfMVA_
void beginEvent(edm::Event &, const edm::EventSetup &)
void setPassPflowPreselection(bool flag)
const GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
ParameterSet const & parameterSet(Provenance const &provenance)
Provenance const * provenance() const
const GsfElectronAlgo::CutsConfiguration cutsCfg_
void produce(edm::Event &, const edm::EventSetup &) override