27 candTag_ (iConfig.getParameter<
edm::InputTag > (
"CandTag") ),
28 previousCandTag_ (iConfig.getParameter<
edm::InputTag > (
"PreviousCandTag")),
29 depTag_ (iConfig.getParameter<
std::vector<
edm::InputTag > >(
"DepTag" ) ),
31 rhoTag_ (iConfig.getParameter<
edm::InputTag >(
"RhoTag" ) ),
32 maxIso_ (iConfig.getParameter<double>(
"MaxIso" ) ),
33 min_N_ (iConfig.getParameter<
int> (
"MinN")),
34 onlyCharged_ (iConfig.getParameter<
bool> (
"onlyCharged")),
35 doRho_ (iConfig.getParameter<
bool> (
"applyRhoCorrection")),
36 effArea_ (iConfig.getParameter<double> (
"EffectiveArea"))
47 LogDebug(
"HLTMuonPFIsoFilter").log( [
this](
auto&
l) {
50 for (
unsigned int i=0;
i!=depTag_.size();++
i) {
51 l<<
" PFIsoTag["<<
i<<
"] : "<<depTag_[
i].encode()<<
" \n";
55 produces<edm::ValueMap<bool> >();
70 std::vector<edm::InputTag> depTag(1,
edm::InputTag(
"hltMuPFIsoValueCharged03"));
71 desc.
add<std::vector<edm::InputTag> >(
"DepTag",depTag);
73 desc.
add<
double>(
"MaxIso",1.);
74 desc.
add<
int>(
"MinN",1);
75 desc.
add<
bool>(
"onlyCharged",
false);
76 desc.
add<
bool>(
"applyRhoCorrection",
true);
77 desc.
add<
double>(
"EffectiveArea",1.);
78 descriptions.
add(
"hltMuonPFIsoFilter", desc);
103 vector<RecoChargedCandidateRef> vcands;
107 unsigned int nDep=
depTag_.size();
108 std::vector< Handle<edm::ValueMap<double> > > depMap(nDep);
122 unsigned int nMu=mucands->size();
123 std::vector<bool> isos(nMu,
false);
126 for (; iMu<nMu; iMu++)
128 double MuonDeposits = 0;
141 for(
unsigned int iDep=0;iDep!=nDep;++iDep)
144 LogDebug(
"HLTMuonPFIsoFilter") <<
" Muon with q*pt= " << tk->charge()*tk->pt()
145 <<
" (" << candref->charge()*candref->pt() <<
") " 146 <<
", eta= " << tk->eta() <<
" (" << candref->eta() <<
") " 147 <<
"; has deposit["<<iDep<<
"]: " << muonDeposit;
149 std::size_t foundCharged =
depTag_[iDep].label().find(
"Charged");
150 if (foundCharged!=std::string::npos) MuonDeposits += muonDeposit;
152 MuonDeposits = MuonDeposits/tk->pt();
156 for(
unsigned int iDep=0;iDep!=nDep;++iDep)
159 LogDebug(
"HLTMuonPFIsoFilter") <<
" Muon with q*pt= " << tk->charge()*tk->pt()
160 <<
" (" << candref->charge()*candref->pt() <<
") " 161 <<
", eta= " << tk->eta() <<
" (" << candref->eta() <<
") " 162 <<
"; has deposit["<<iDep<<
"]: " << muonDeposit;
163 MuonDeposits += muonDeposit;
167 MuonDeposits = MuonDeposits/tk->pt();
171 if (MuonDeposits <
maxIso_) isos[iMu] =
true;
173 LogDebug(
"HLTMuonPFIsoFilter") <<
" Muon with q*pt= " << tk->charge()*tk->pt() <<
", eta= " << tk->eta()
174 <<
"; "<<(isos[iMu]?
"Is an isolated muon.":
"Is NOT an isolated muon.");
176 if (!isos[iMu])
continue;
189 isoFiller.
insert(mucands, isos.begin(), isos.end());
195 LogDebug(
"HLTMuonPFIsoFilter") <<
" >>>>> Result of HLTMuonPFIsoFilter is " << accept <<
", number of muons passing isolation cuts= " << nIsolatedMu;
202 unsigned int i_max=vcands.size();
204 if (candref == vcands[i])
return true;
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool isNonnull() const
Checks for non-null.
std::vector< edm::InputTag > depTag_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~HLTMuonPFIsoFilter() override
static bool triggerdByPreviousLevel(const reco::RecoChargedCandidateRef &, const std::vector< reco::RecoChargedCandidateRef > &)
void insert(const H &h, I begin, I end)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
edm::EDGetTokenT< double > rhoToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
Container::value_type value_type
edm::InputTag previousCandTag_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > candToken_
T const * get() const
Returns C++ pointer to the item.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
HLTMuonPFIsoFilter(const edm::ParameterSet &)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
T const * product() const
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > depToken_