78 mvaWeightFileEleID = iConfig.
getParameter<
string>(
"HZZmvaWeightFile");
79 thresholdBarrel = iConfig.
getParameter<
double>(
"thresholdBarrel");
80 thresholdEndcap = iConfig.
getParameter<
double>(
"thresholdEndcap");
81 thresholdIsoBarrel = iConfig.
getParameter<
double>(
"thresholdIsoDR03Barrel");
82 thresholdIsoEndcap = iConfig.
getParameter<
double>(
"thresholdIsoDR03Endcap");
84 produces<reco::GsfElectronCollection>();
85 path_mvaWeightFileEleID =
edm::FileInPath ( mvaWeightFileEleID.c_str() ).fullPath();
86 FILE * fileEleID = fopen(path_mvaWeightFileEleID.c_str(),
"r");
91 string err =
"ElectronIdMVABased: cannot open weight file '";
92 err += path_mvaWeightFileEleID;
94 throw invalid_argument( err );
126 iEvent.
getByToken(electronToken,egCollection);
128 for ( reco::GsfElectronCollection::const_iterator egIter = egCandidates.begin(); egIter != egCandidates.end(); ++egIter) {
129 double mvaVal = mvaID_->mva( *egIter, nVtx );
130 double isoDr03 = egIter->dr03TkSumPt() + egIter->dr03EcalRecHitSumEt() + egIter->dr03HcalTowerSumEt();
131 double eleEta = fabs(egIter->eta());
132 if (eleEta <= 1.485 && mvaVal > thresholdBarrel && isoDr03 < thresholdIsoBarrel) {
133 mvaElectrons->push_back( *egIter );
135 myMvaOutput.
mva = mvaVal;
136 mvaElectrons->back().setMvaOutput(myMvaOutput);
138 else if (eleEta > 1.485 && mvaVal > thresholdEndcap && isoDr03 < thresholdIsoEndcap) {
139 mvaElectrons->push_back( *egIter );
141 myMvaOutput.
mva = mvaVal;
142 mvaElectrons->back().setMvaOutput(myMvaOutput);
149 iEvent.
put(mvaElectrons);
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
ElectronMVAEstimator * mvaID_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
string path_mvaWeightFileEleID
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual bool filter(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::VertexCollection > vertexToken
edm::EDGetTokenT< reco::GsfElectronCollection > electronToken
ElectronIdMVABased(const edm::ParameterSet &)
string mvaWeightFileEleID
double thresholdIsoEndcap
double thresholdIsoBarrel