3 #include <boost/regex.hpp>
61 if (
taus_.size() > 0 ) {
62 std::multimap<int,std::string>::const_iterator iter =
taus_.end(); --iter;
70 std::multimap<int,std::string>::const_iterator iter =
muons_.end(); --iter;
78 std::multimap<int,std::string>::const_iterator iter =
electrons_.end(); --iter;
85 if (
mets_.size() > 0 ) {
86 std::multimap<int,std::string>::const_iterator iter =
mets_.end(); --iter;
94 std::multimap<int,std::string>::const_iterator iter =
quadjets_.end(); --iter;
101 if (
pfmht_.size() > 0 ) {
102 std::multimap<int,std::string>::const_iterator iter =
pfmht_.end(); --iter;
109 if (
ht_.size() > 0 ) {
110 std::multimap<int,std::string>::const_iterator iter =
ht_.end(); --iter;
135 boost::regex exprTau(
"([a-zA-Z]*?)IsoPFTau([0-9]+)_");
137 std::string::const_iterator
start =
name_.begin();
138 std::string::const_iterator
end =
name_.end();
139 while ( boost::regex_search(start, end, what, exprTau) ) {
142 if (std::string(what[1]) ==
"Double" || std::string(what[1]) ==
"DoubleLoose" || std::string(what[1]) ==
"DoubleMedium" || std::string(what[1]) ==
"DoubleTight") {
143 taus_.insert(std::pair<int,std::string>(energy,
""));
144 taus_.insert(std::pair<int,std::string>(energy,
""));
147 taus_.insert(std::pair<int,std::string>(energy,what[1]));
152 start = what[0].second;
155 boost::regex exprMuon(
"([a-zA-Z]*?)Mu([0-9]+)");
156 start =
name_.begin();
157 while ( boost::regex_search(start, end, what, exprMuon) ) {
160 muons_.insert(std::pair<int,std::string>(energy,what[1]));
164 start = what[0].second;
167 boost::regex exprElectron(
"([a-zA-Z]*?)Ele([0-9]+)");
168 start =
name_.begin();
169 while ( boost::regex_search(start, end, what, exprElectron) ) {
172 electrons_.insert(std::pair<int,std::string>(energy,what[1]));
176 start = what[0].second;
179 boost::regex exprMET(
"([a-zA-Z]*?)MET([0-9]+)");
180 start =
name_.begin();
181 while ( boost::regex_search(start, end, what, exprMET) ) {
184 mets_.insert(std::pair<int,std::string>(energy,what[1]));
188 start = what[0].second;
191 boost::regex exprQuadJet(
"([a-zA-Z]*?)QuadJet([0-9]+)");
192 start =
name_.begin();
193 while ( boost::regex_search(start, end, what, exprQuadJet) ) {
196 quadjets_.insert(std::pair<int,std::string>(energy,what[1]));
200 start = what[0].second;
203 boost::regex exprPFMHT(
"([a-zA-Z]*?)PFMHT([0-9]+)");
204 start =
name_.begin();
205 while ( boost::regex_search(start, end, what, exprPFMHT) ) {
208 pfmht_.insert(std::pair<int,std::string>(energy,what[1]));
212 start = what[0].second;
215 boost::regex exprHT(
"_HT([0-9]+)");
216 start =
name_.begin();
217 while ( boost::regex_search(start, end, what, exprHT) ) {
220 ht_.insert(std::pair<int,std::string>(energy,
""));
224 start = what[0].second;
235 std::multimap<int,std::string>::const_iterator iter =
taus_.end(); --iter;
236 type_ =
"Single" + iter->second +
"Tau";
238 std::multimap<int,std::string>::const_iterator iter =
taus_.end(); --iter;
239 type_ =
"Single" + iter->second +
"Tau_MET";
241 std::multimap<int,std::string>::const_iterator iter =
taus_.end(); --iter;
242 type_ =
"Ele" + iter->second +
"Tau";
244 std::multimap<int,std::string>::const_iterator iter =
taus_.end(); --iter;
245 type_ =
"Mu" + iter->second +
"Tau";
247 std::multimap<int,std::string>::const_iterator iter =
taus_.end(); --iter;
248 type_ =
"QuadJet_Single" + iter->second +
"Tau";
250 type_ =
"HT_DoubleTau_PFMHT";
261 while (*digit >=
'0' && *digit <=
'9') {
262 result = (result * 10) + (*digit -
'0');
275 std::map<int,std::string> modules;
277 boost::regex rePFTau(
".*PFTau.*");
278 boost::regex rePFIsoTau(
".*PFIsoTau.*");
281 for ( std::vector<std::string>::const_iterator imodule = moduleLabels.begin(); imodule != moduleLabels.end(); ++imodule ) {
282 int idx = imodule - moduleLabels.begin();
284 if ( HLTCP.
moduleType(*imodule) ==
"HLTLevel1GTSeed" ) {
286 }
else if ( HLTCP.
moduleType(*imodule) ==
"HLT1Tau" || HLTCP.
moduleType(*imodule) ==
"HLT1PFTau" || HLTCP.
moduleType(*imodule) ==
"HLT1SmartTau" ) {
287 if ( boost::regex_match(*imodule, rePFTau) || boost::regex_match(*imodule, rePFIsoTau) ) {
290 }
else if ( HLTCP.
moduleType(*imodule) ==
"HLT2ElectronTau" || HLTCP.
moduleType(*imodule) ==
"HLT2ElectronPFTau" || HLTCP.
moduleType(*imodule) ==
"HLT2MuonTau" || HLTCP.
moduleType(*imodule) ==
"HLT2MuonPFTau" ) {
291 if ( boost::regex_match(*imodule, rePFTau) || boost::regex_match(*imodule, rePFIsoTau) ) {
295 int idx1 =
std::find(moduleLabels.begin(), moduleLabels.end(),
input1) - moduleLabels.begin();
298 int idx2 =
std::find(moduleLabels.begin(), moduleLabels.end(),
input2) - moduleLabels.begin();
301 if ( boost::regex_match(input1, rePFTau) || boost::regex_match(input1, rePFIsoTau) ) {
309 if ( boost::regex_match(input2, rePFTau) || boost::regex_match(input2, rePFIsoTau) ) {
320 for ( std::map<int,std::string>::iterator iter = modules.begin(); iter != modules.end(); ) {
321 std::map<int,std::string>::iterator tempItr = iter++;
323 if ( value !=
"HLT1Tau" && value !=
"HLT1PFTau" && value !=
"HLT1SmartTau" ) {
324 modules.erase(tempItr);
333 for ( std::map<int,std::string>::const_iterator iter = container.begin(); iter != container.end(); ++iter ) {
334 if ( iter->second == value.second ) {
339 if ( unique ) container.insert(value);
344 std::vector<edm::ParameterSet> psets;
347 boost::regex reElectron(
".*Electron.*");
348 boost::regex reMuon(
".*Muon.*");
350 for ( std::map<int,std::string>::const_iterator imodule = modules.begin(); imodule != modules.end(); ++imodule ) {
354 if ( HLTCP.
moduleType(imodule->second) ==
"HLTLevel1GTSeed" ) {
382 }
else if ( HLTCP.
moduleType(imodule->second) ==
"HLT1Tau" || HLTCP.
moduleType(imodule->second) ==
"HLT1PFTau" || HLTCP.
moduleType(imodule->second) ==
"HLT1SmartTau" ) {
388 }
else if ( HLTCP.
moduleType(imodule->second) ==
"HLT2ElectronTau" || HLTCP.
moduleType(imodule->second) ==
"HLT2ElectronPFTau" ) {
394 }
else if ( HLTCP.
moduleType(imodule->second) ==
"HLT2MuonTau" || HLTCP.
moduleType(imodule->second) ==
"HLT2MuonPFTau" ) {
400 }
else if ( boost::regex_match(HLTCP.
moduleType(imodule->second), reElectron) ) {
406 }
else if ( boost::regex_match(HLTCP.
moduleType(imodule->second), reMuon) ) {
413 psets.push_back(tmp);
429 std::vector<edm::ParameterSet> modules =
getPSets(HLTCP);
430 if (modules.size() > 0) {
431 tmp = modules.back();
unsigned int count_electrons_
unsigned int count_quadjets_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string moduleType(const std::string &module) const
C++ class name of module.
std::map< int, std::string > interestingModules(HLTConfigProvider const &HLTCP)
enum start value shifted to 81 so as to avoid clashes with PDG codes
int NReferenceTaus() const
int leadingElectron() const
std::multimap< int, std::string > quadjets_
edm::ParameterSet getSummaryPSet(HLTConfigProvider const &HLTCP)
const edm::ParameterSet & modulePSet(const std::string &module) const
ParameterSet of module.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::multimap< int, std::string > electrons_
bool insertUniqueValue(std::map< int, std::string > &container, std::pair< int, std::string > const &value)
bool inited() const
Accessors (const methods)
HLTTauDQMFilter const & select(HLTTauDQMFilter const &filter, bool &swapped)
int leadingQuadJet() const
unsigned int count_muons_
std::string hltTauDQMProcess_
HLTTauDQMFilter(std::string const &name, int initialPrescale, std::string hltTauDQMProcess, double L1MatchDeltaR, double HLTMatchDeltaR)
std::multimap< int, std::string > mets_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< edm::ParameterSet > getPSets(HLTConfigProvider const &HLTCP)
std::multimap< int, std::string > pfmht_
unsigned int count_pfmhts_
void addUntrackedParameter(std::string const &name, T const &value)
bool string2int(const char *digit, int &result)
edm::ParameterSet getRefPSet()
std::vector< std::vector< double > > tmp
int initialPrescale() const
int NReferenceLeptons() const
std::multimap< int, std::string > muons_
virtual ~HLTTauDQMFilter()
std::multimap< int, std::string > ht_
std::multimap< int, std::string > taus_