43 #include "TDirectory.h"
62 virtual void endJob() ;
95 LogTrace (
"HLTMuonVal") <<
"\n\n Inside MuonTriggerRate Constructor\n\n";
122 LogTrace(
"HLTMuonVal") <<
"Finished with the constructor " << endl;
133 vector<edm::ParameterSet>::iterator iPSet;
136 <<
"looping over entries... and storing descriptions in a root file" << std::endl;
151 vector < MuonSelectionStruct > customSelectors;
152 vector < string > customNames;
157 string customCuts = iPSet->getUntrackedParameter<
string> (
"recoCuts");
158 string customName = iPSet->getUntrackedParameter<
string> (
"collectionName");
159 string hltCuts = iPSet->getUntrackedParameter<
string> (
"hltCuts");
160 string targetTrackCollection = iPSet->getUntrackedParameter<
string> (
"trackCollection");
161 double customD0Cut = iPSet->getUntrackedParameter<
double> (
"d0cut");
162 double customZ0Cut = iPSet->getUntrackedParameter<
double> (
"z0cut");
166 double customChi2Cut = iPSet->getUntrackedParameter<
double> (
"chi2cut", 30.0);
167 int customNHitsCut = iPSet->getUntrackedParameter<
int> (
"nHits", 10);
170 vector<string> requiredTriggers = iPSet->getUntrackedParameter< vector<string> > (
"requiredTriggers");
172 LogTrace(
"HLTMuonVal") <<
"customTargetCollection = " << customName << std::endl
173 <<
"customCuts = " << customCuts << std::endl
174 <<
"targetTrackCollection = " << targetTrackCollection << std::endl
175 <<
"d0 cut = " << customD0Cut << std::endl
176 <<
"z0 cut = " << customZ0Cut << std:: endl
177 <<
"nHits cut = " << customNHitsCut << std::endl
178 <<
"chi2 cut = " << customChi2Cut <<std::endl;
182 string description = customName +
", reco cuts = " + customCuts
183 +
", hlt cuts = " + hltCuts +
", trackCollection = " + targetTrackCollection
184 +
", required triggers, ";
187 for (vector <string>::const_iterator trigit = requiredTriggers.begin();
188 trigit != requiredTriggers.end();
190 description += (*trigit) +
", ";
194 ostringstream ossd0, ossz0, osschi2, osshits;
197 ossd0 << customD0Cut;
198 ossz0 << customZ0Cut;
199 osschi2 << customChi2Cut;
200 osshits << customNHitsCut;
202 description +=
"|d0| < " + ossd0.str() +
", |z0| < " + ossz0.str()
203 +
", chi2 < " + osschi2.str() +
", nHits > " + osshits.str();
205 LogTrace (
"HLTMuonVal") <<
"Storing description = " << description << endl;
221 customName, customD0Cut, customZ0Cut,
223 targetTrackCollection, requiredTriggers);
226 customNames.push_back ( customName);
227 customSelectors.push_back(tempStruct);
240 bool hltConfigChanged;
241 bool hltConfigInitSuccess = hltConfig.
init(currentRun, currentEventSetup,
theHltProcessName, hltConfigChanged);
243 vector<string> validTriggerNames;
245 if (hltConfigInitSuccess)
248 if (validTriggerNames.size() < 1) {
249 LogTrace (
"HLTMuonVal") << endl << endl << endl
250 <<
"---> WARNING: The HLT Config Provider gave you an empty list of valid trigger names" << endl
251 <<
"Could be a problem with the HLT Process Name (you provided " <<
theHltProcessName <<
")" << endl
252 <<
"W/o valid triggers we can't produce plots, exiting..."
253 << endl << endl << endl;
257 vector<string>::const_iterator iDumpName;
258 unsigned int numTriggers = 0;
259 for (iDumpName = validTriggerNames.begin();
260 iDumpName != validTriggerNames.end();
263 LogTrace (
"HLTMuonVal") <<
"Trigger " << numTriggers
264 <<
" is called " << (*iDumpName)
276 vector<MuonSelectionStruct>::iterator iMuonSelector;
277 vector<string>::iterator iName = customNames.begin();
278 for ( iMuonSelector = customSelectors.begin();
279 iMuonSelector != customSelectors.end();
283 bool isValidTriggerName =
false;
284 for (
size_t j = 0;
j < validTriggerNames.size();
j++ )
285 if (
triggerNames[
i] == validTriggerNames[
j] ) isValidTriggerName =
true;
286 if ( !isValidTriggerName ) {}
308 vector<HLTTopPlotter *>::iterator thisAnalyzer;
312 LogTrace (
"HLTMuonVal") <<
"Inside begin job " << endl
313 <<
"Looping over analyzers"
320 (*thisAnalyzer)->begin();
341 vector<HLTTopPlotter *>::iterator iTopAna;
373 vector<HLTTopPlotter *>::iterator iTopAna;
378 (*iTopAna)->analyze(iEvent);
394 LogTrace (
"HLTMuonVal") <<
"Inside begin job " << endl
395 <<
"Looping over analyzers"
404 vector<HLTTopPlotter *>::iterator thisAnalyzer;
407 LogTrace (
"HLTMuonVal") <<
"Inside end job, looping over analyzers"
413 (*thisAnalyzer)->endRun(theRun, theEventSetup);
421 vector<HLTTopPlotter *>::iterator thisAnalyzer;
424 LogTrace (
"HLTMuonVal") <<
"Inside end job, looping over analyzers"
430 (*thisAnalyzer)->finish();
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
vector< string > triggerNames
#define DEFINE_FWK_MODULE(type)
const std::vector< std::string > & triggerNames() const
names of trigger paths
bool weHaveProcessedTheFirstRun
std::vector< HLTMuonMatchAndPlot * > theTriggerAnalyzers
MonitorElement * bookString(const char *name, const char *value)
Book string.
virtual void endRun(const edm::Run &r, const edm::EventSetup &c)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void setVerbose(unsigned level)
std::vector< HLTTopPlotter * > theTopPlotters
TopTrigAnalyzer(const edm::ParameterSet &)
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
vector< edm::ParameterSet > customCollection
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
virtual void beginRun(edm::Run const ¤tRun, edm::EventSetup const ¤tEventSetup)
void setCurrentFolder(const std::string &fullpath)
const ParameterSet & initialPset