1 #ifndef CommonTools_ParticleFlow_IsolatedPFCandidateSelectorDefinition
2 #define CommonTools_ParticleFlow_IsolatedPFCandidateSelectorDefinition
27 doDeltaBetaCorrection_(
cfg.getParameter<
bool>(
"doDeltaBetaCorrection")),
28 deltaBetaIsolationValueMapToken_(
29 iC.mayConsume<IsoMap>(
cfg.getParameter<
edm::InputTag>(
"deltaBetaIsolationValueMap"))),
30 deltaBetaFactor_(
cfg.getParameter<
double>(
"deltaBetaFactor")),
31 isRelative_(
cfg.getParameter<
bool>(
"isRelative")),
38 std::vector<edm::Handle<IsoMap> > isoMapsCharged(isolationValueMapChargedTokens_.size());
39 for (
unsigned iMap = 0; iMap < isolationValueMapChargedTokens_.size(); ++iMap) {
40 e.
getByToken(isolationValueMapChargedTokens_[iMap], isoMapsCharged[iMap]);
44 std::vector<edm::Handle<IsoMap> > isoMapsNeutral(isolationValueMapNeutralTokens_.size());
45 for (
unsigned iMap = 0; iMap < isolationValueMapNeutralTokens_.size(); ++iMap) {
46 e.
getByToken(isolationValueMapNeutralTokens_[iMap], isoMapsNeutral[iMap]);
50 if (doDeltaBetaCorrection_) {
51 e.
getByToken(deltaBetaIsolationValueMapToken_, dBetaH);
55 for (collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++
key) {
59 double isoSumCharged = 0.0;
60 double isoSumNeutral = 0.0;
62 for (
unsigned iMap = 0; iMap < isoMapsCharged.size(); ++iMap) {
63 const IsoMap& isoMap = *(isoMapsCharged[iMap]);
64 double val = isoMap[candidate];
68 for (
unsigned iMap = 0; iMap < isoMapsNeutral.size(); ++iMap) {
69 const IsoMap& isoMap = *(isoMapsNeutral[iMap]);
70 double val = isoMap[candidate];
74 if (doDeltaBetaCorrection_) {
75 const IsoMap& isoMap = *dBetaH;
76 double dBetaVal = isoMap[candidate];
77 double dBetaCorIsoSumNeutral = isoSumNeutral + deltaBetaFactor_ * dBetaVal;
78 isoSumNeutral = dBetaCorIsoSumNeutral > 0 ? dBetaCorIsoSumNeutral : 0;
81 double isoSum = isoSumCharged + isoSumNeutral;
84 isoSum /= candidate->pt();
87 if (isoSum > isolationCut_) {
95 selected_.back().setSourceCandidatePtr(ptrToMother);
IsolatedPFCandidateSelectorDefinition(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
edm::ValueMap< double > IsoMap
bool getByToken(EDGetToken token, Handle< PROD > &result) const
isolationCut_(cfg.getParameter< double >("isolationCut"))
tuple isoSum
===> require is not the leading lepton and opposite to the leading lepton
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
edm::EDGetTokenT< IsoMap > deltaBetaIsolationValueMapToken_
std::vector< edm::EDGetTokenT< IsoMap > > isolationValueMapChargedTokens_
tuple key
prepare the HTCondor submission files and eventually submit them
void select(const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s)
std::vector< edm::EDGetTokenT< IsoMap > > isolationValueMapNeutralTokens_
bool doDeltaBetaCorrection_
Particle reconstructed by the particle flow algorithm.