41 auto const wpDefs =
cfg.getParameter<std::vector<edm::ParameterSet>>(
"IDWPdefinitions");
43 for (
auto& wpDefsEntry : wpDefs) {
46 if (discriminatorOption_string ==
"loose")
48 else if (discriminatorOption_string ==
"medium")
50 else if (discriminatorOption_string ==
"tight")
52 else if (discriminatorOption_string ==
"custom")
56 <<
" Invalid Configuration parameter 'discriminatorOption' = " << discriminatorOption_string <<
" !!\n";
59 wpDefsEntry.getParameter<
double>(
"HoPMin"),
60 wpDefsEntry.getParameter<
int>(
"maxNumberOfMatches"),
61 wpDefsEntry.getParameter<
bool>(
"doCaloMuonVeto"),
62 wpDefsEntry.getParameter<
int>(
"maxNumberOfHitsLast2Stations")));
65 muons_token = consumes<reco::MuonCollection>(srcMuons_);
66 dRmuonMatch_ =
cfg.getParameter<
double>(
"dRmuonMatch");
67 dRmuonMatchLimitedToJetArea_ =
cfg.getParameter<
bool>(
"dRmuonMatchLimitedToJetArea");
68 minPtMatchedMuon_ =
cfg.getParameter<
double>(
"minPtMatchedMuon");
69 typedef std::vector<int>
vint;
70 maskMatchesDT_ =
cfg.getParameter<
vint>(
"maskMatchesDT");
71 maskMatchesCSC_ =
cfg.getParameter<
vint>(
"maskMatchesCSC");
72 maskMatchesRPC_ =
cfg.getParameter<
vint>(
"maskMatchesRPC");
73 maskHitsDT_ =
cfg.getParameter<
vint>(
"maskHitsDT");
74 maskHitsCSC_ =
cfg.getParameter<
vint>(
"maskHitsCSC");
75 maskHitsRPC_ =
cfg.getParameter<
vint>(
"maskHitsRPC");
76 verbosity_ =
cfg.getParameter<
int>(
"verbosity");
78 ~PFRecoTauDiscriminationAgainstMuon2Container()
override {}
88 std::vector<PFRecoTauDiscriminationAgainstMuonConfigSet> wpDefs_;
93 bool dRmuonMatchLimitedToJetArea_;
94 double minPtMatchedMuon_;
95 std::vector<int> maskMatchesDT_;
96 std::vector<int> maskMatchesCSC_;
97 std::vector<int> maskMatchesRPC_;
98 std::vector<int> maskHitsDT_;
99 std::vector<int> maskHitsCSC_;
100 std::vector<int> maskHitsRPC_;
101 static std::atomic<unsigned int> numWarnings_;
102 static constexpr
unsigned int maxWarnings_ = 3;
106 std::atomic<unsigned int> PFRecoTauDiscriminationAgainstMuon2Container::numWarnings_{0};
109 if (!srcMuons_.label().empty()) {
119 srcMuons_.label().empty(),
122 dRmuonMatchLimitedToJetArea_,
136 for (
auto const& wpDefsEntry : wpDefs_) {
137 result.workingPoints.push_back(
helper.eval(wpDefsEntry, pfTau));
139 edm::LogPrint(
"PFTauAgainstMuon2") <<
"--> returning discriminatorValue = " <<
result.workingPoints.back();
149 desc.add<std::vector<int>>(
"maskHitsRPC",
156 desc.add<std::vector<int>>(
"maskMatchesRPC",
163 desc.add<std::vector<int>>(
"maskMatchesCSC",
171 "flags to mask/unmask DT, CSC and RPC chambers in individual muon stations. Segments and hits that are " 172 "present in that muon station are ignored in case the 'mask' is set to 1. Per default only the innermost CSC " 173 "chamber is ignored, as it is affected by spurious hits in high pile-up events.");
174 desc.add<std::vector<int>>(
"maskHitsCSC",
182 desc.add<
int>(
"verbosity", 0);
183 desc.add<std::vector<int>>(
"maskMatchesDT",
190 desc.add<
double>(
"minPtMatchedMuon", 5.0);
191 desc.add<
bool>(
"dRmuonMatchLimitedToJetArea",
false);
197 psd1.
add<
double>(
"cut", 0.5);
215 desc.add<std::vector<int>>(
"maskHitsDT",
222 desc.add<
double>(
"dRmuonMatch", 0.3);
224 ->setComment(
"optional collection of muons to check for overlap with taus");
229 ->setComment(
"available options are: 'loose', 'medium', 'tight' and 'custom'");
230 desc_wp.
add<
double>(
"HoPMin");
231 desc_wp.
add<
int>(
"maxNumberOfMatches")
232 ->setComment(
"negative value would turn off this cut in case of 'custom' discriminator");
233 desc_wp.
add<
bool>(
"doCaloMuonVeto");
234 desc_wp.
add<
int>(
"maxNumberOfHitsLast2Stations")
235 ->setComment(
"negative value would turn off this cut in case of 'custom' discriminator");
240 pset_wp.addParameter<
int>(
"maxNumberOfMatches", 0);
241 pset_wp.addParameter<
bool>(
"doCaloMuonVeto",
false);
242 pset_wp.addParameter<
int>(
"maxNumberOfHitsLast2Stations", 0);
243 std::vector<edm::ParameterSet> vpsd_wp;
244 vpsd_wp.push_back(pset_wp);
245 desc.addVPSet(
"IDWPdefinitions", desc_wp, vpsd_wp);
249 descriptions.add(
"pfRecoTauDiscriminationAgainstMuon2Container",
desc);
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
#define DEFINE_FWK_MODULE(type)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual TauDiscriminatorDataType discriminate(const TauRef &tau) const =0
void addParameter(std::string const &name, T const &value)
virtual void beginEvent(const edm::Event &, const edm::EventSetup &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Log< level::Warning, true > LogPrint
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)