79 mvaWeightFileEleID = iConfig.
getParameter<
string>(
"HZZmvaWeightFile");
80 thresholdBarrel = iConfig.
getParameter<
double>(
"thresholdBarrel");
81 thresholdEndcap = iConfig.
getParameter<
double>(
"thresholdEndcap");
82 thresholdIsoBarrel = iConfig.
getParameter<
double>(
"thresholdIsoDR03Barrel");
83 thresholdIsoEndcap = iConfig.
getParameter<
double>(
"thresholdIsoDR03Endcap");
85 produces<reco::GsfElectronCollection>();
86 path_mvaWeightFileEleID =
edm::FileInPath ( mvaWeightFileEleID.c_str() ).fullPath();
87 FILE * fileEleID = fopen(path_mvaWeightFileEleID.c_str(),
"r");
92 string err =
"ElectronIdMVABased: cannot open weight file '";
93 err += path_mvaWeightFileEleID;
95 throw invalid_argument( err );
129 for ( reco::GsfElectronCollection::const_iterator egIter = egCandidates.begin(); egIter != egCandidates.end(); ++egIter) {
130 double mvaVal = mvaID_->mva( *egIter, nVtx );
131 double isoDr03 = egIter->dr03TkSumPt() + egIter->dr03EcalRecHitSumEt() + egIter->dr03HcalTowerSumEt();
132 double eleEta = fabs(egIter->eta());
133 if (eleEta <= 1.485 && mvaVal > thresholdBarrel && isoDr03 < thresholdIsoBarrel) {
134 mvaElectrons->push_back( *egIter );
136 myMvaOutput.
mva = mvaVal;
137 mvaElectrons->back().setMvaOutput(myMvaOutput);
139 else if (eleEta > 1.485 && mvaVal > thresholdEndcap && isoDr03 < thresholdIsoEndcap) {
140 mvaElectrons->push_back( *egIter );
142 myMvaOutput.
mva = mvaVal;
143 mvaElectrons->back().setMvaOutput(myMvaOutput);
150 iEvent.
put(mvaElectrons);
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
ElectronMVAEstimator * mvaID_
virtual bool filter(edm::Event &, const edm::EventSetup &)
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
string path_mvaWeightFileEleID
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag electronTag
ElectronIdMVABased(const edm::ParameterSet &)
string mvaWeightFileEleID
double thresholdIsoEndcap
double thresholdIsoBarrel