66 double,
double,
bool);
102 std::cout <<
"Inside Constructor" << std::endl;
116 std::cout <<
"Inside analyze - run, block, event "
118 <<
" , " << iEvent.
id() <<
" , " << std::endl;
125 if (!triggerResults.
isValid()) {
127 std::cout <<
"Trigger results not valid" << std::endl;
132 std::cout <<
"Found triggerResults" << std::endl;
138 if (!aodTriggerEvent.
isValid()) {
140 std::cout <<
"No AOD trigger summary found! Returning...";
149 for (
unsigned int iPD = 0; iPD < datasetNames.size(); iPD++) {
151 bool first_count =
true;
152 for (
unsigned int iPath = 0;
157 std::cout <<
"Looking at path " << pathName << std::endl;
159 <<
" triggerResults->size() = " << triggerResults->size()
164 const std::string &
label = datasetNames[iPD];
165 std::string fullPathToCPP =
"HLT/GeneralHLTOffline/"
166 + label +
"/cppath_" + label +
hlt_menu_;
168 TH1F * hist_mini_cppath =
NULL;
170 hist_mini_cppath = ME_mini_cppath->
getTH1F();
172 if (hist_mini_cppath) {
173 TAxis * axis = hist_mini_cppath->GetXaxis();
175 int bin_num = axis->FindBin(pathName.c_str());
176 int bn = bin_num - 1;
177 hist_mini_cppath->Fill(bn, 0);
178 hist_mini_cppath->SetEntries(hist_mini_cppath->Integral());
182 if (index < triggerResults->
size()) {
183 if (triggerResults->accept(index)) {
187 <<
" Run " << iEvent.
id().
run()
188 <<
" fired path " << pathName << std::endl;
191 const std::vector<std::string> &modulesThisPath =
195 std::cout <<
"Looping over module labels " << std::endl;
198 for (
int iModule = (modulesThisPath.size() - 1);
199 iModule >= 0; iModule--) {
202 << modulesThisPath[iModule] << std::endl;
207 <<
" this module " << modulesThisPath[iModule]
208 <<
" is a saveTags module of type "
212 ==
"HLTLevel1GTSeed")
214 edm::InputTag moduleWhoseResultsWeWant(modulesThisPath[iModule],
217 unsigned int idx_module_aod_trg =
218 aodTriggerEvent->filterIndex(moduleWhoseResultsWeWant);
219 if (idx_module_aod_trg < aodTriggerEvent->sizeFilters()) {
221 aodTriggerEvent->filterKeys(idx_module_aod_trg);
224 << idx_module_aod_trg
225 <<
", size of keys is " << keys.size()
227 if (keys.size() >= 1000)
229 <<
"WARNING!! size of keys is " << keys.size()
230 <<
" for path " << pathName <<
" and module "
231 << modulesThisPath[iModule]<< std::endl;
241 if (keys.size() > 0) {
244 std::cout <<
"This object has id (pt, eta, phi) = "
245 <<
" " << foundObject.
id() <<
" "
246 << std::setw(10) << foundObject.
pt()
247 <<
", " << std::setw(10) << foundObject.
eta()
248 <<
", " << std::setw(10) << foundObject.
phi()
249 <<
" for path = " << std::setw(20) << pathName
250 <<
" module " << std::setw(40)
251 << modulesThisPath[iModule] << std::endl;
254 << iEvent.
id() <<
" " << pathName <<
" "
255 << modulesThisPath[iModule] <<
" "
256 << datasetNames[iPD] <<
" "
258 <<
" " << keys.size() <<
" "
259 << std::setprecision(4) << foundObject.
pt() <<
" "
260 << foundObject.
eta() <<
" "
261 << foundObject.
phi() << std::endl;
267 foundObject.
eta(), foundObject.
phi(),
289 std::cout <<
"Inside begin job" << std::endl;
306 std::cout <<
"Inside beginRun" << std::endl;
317 std::cout <<
"Warning, didn't find process HLT" << std::endl;
340 std::vector<std::string>::const_iterator si = nameStreams.begin();
341 std::vector<std::string>::const_iterator se = nameStreams.end();
342 for ( ; si != se; ++si) {
352 std::cout <<
"Number of Stream A datasets "
353 << datasetNames.size() << std::endl;
355 for (
unsigned int i = 0;
i < datasetNames.size();
i++) {
358 std::cout <<
"This is dataset " << datasetNames[
i]
359 <<
"datasetPaths.size() = " << datasetPaths.size() << std::endl;
360 for (
unsigned int iPath = 0;
361 iPath < datasetPaths.size(); iPath++) {
362 std::cout <<
"Before setupHltMatrix - MET dataset "
363 << datasetPaths[iPath] << std::endl;
368 bool foundDataset =
false;
376 <<
" found in AddedDatasets at position " << d << std::endl;
383 std::cout <<
" Fill trigger paths for dataset "
384 << datasetNames[
i] << std::endl;
396 std::cout <<
" Additional runs : Check for additional"
397 <<
"trigger paths per dataset " << std::endl;
402 for (
unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
404 std::cout <<
"Looping over trigger list in dataset "
406 << datasetPaths[iTrig] << std::endl;
411 std::cout <<
"Looping over existing trigger list " << od
418 std::cout <<
" FOUND " << datasetPaths[iTrig] << std::endl;
427 <<
" NOT FOUND - so we added it to the correct dataset "
428 << datasetNames[
i] << std::endl;
434 std::cout <<
" PDsVectorPathsVector[" << is <<
"] is "
437 std::cout <<
" trigger " << ip <<
" path "
444 std::cout <<
"Found PD: " << datasetNames[
i] << std::endl;
454 std::cout <<
" endRun called " << std::endl;
461 std::string h_name_1dEta;
462 std::string h_name_1dPhi;
463 std::string h_title_1dEta;
464 std::string h_title_1dPhi;
465 std::string h_name_1dEtaPath;
466 std::string h_name_1dPhiPath;
467 std::string h_title_1dEtaPath;
468 std::string h_title_1dPhiPath;
470 std::string PD_Folder;
471 std::string Path_Folder;
473 PD_Folder = TString(
"HLT/GeneralHLTOffline");
474 if (label !=
"SingleMu" && label !=
"SingleElectron" && label !=
"Jet")
475 PD_Folder = TString(
"HLT/GeneralHLTOffline/"+label);
480 h_name =
"HLT_" +label +
"_EtaVsPhi";
481 h_title =
"HLT_" + label +
"_EtaVsPhi";
482 h_name_1dEta =
"HLT_" + label +
"_1dEta";
483 h_name_1dPhi =
"HLT_" + label +
"_1dPhi";
484 h_title_1dEta = label +
" Occupancy Vs Eta";
485 h_title_1dPhi = label +
" Occupancy Vs Phi";
487 Int_t numBinsEta = 30;
488 Int_t numBinsPhi = 34;
489 Int_t numBinsEtaFine = 60;
490 Int_t numBinsPhiFine = 66;
493 Double_t PhiMaxFine = 33.0*
TMath::Pi()/32.0;
499 numBinsPhi, -PhiMax, PhiMax);
500 if (TH1 * service_histo = service_me->
getTH2F())
501 service_histo->SetMinimum(0);
503 if (label !=
"MET" && label !=
"HT") {
504 service_me =
dbe_->
book1D(h_name_1dEta.c_str(),
505 h_title_1dEta.c_str(),
507 if (TH1 * service_histo = service_me->
getTH1F())
508 service_histo->SetMinimum(0);
511 service_me =
dbe_->
book1D(h_name_1dPhi.c_str(),
512 h_title_1dPhi.c_str(),
513 numBinsPhiFine, -PhiMaxFine, PhiMaxFine);
514 if (TH1 * service_histo = service_me->
getTH1F())
515 service_histo->SetMinimum(0);
521 folderz = TString(
"HLT/GeneralHLTOffline/"+label);
524 std::string dnamez =
"cppath_" + label +
"_" +
hlt_menu_;
526 TH1F * hist_mini_cppath =
NULL;
532 if (hist_mini_cppath_me)
533 hist_mini_cppath = hist_mini_cppath_me->
getTH1F();
538 h_name_1dEtaPath =
"HLT_" + pathName +
"_1dEta";
539 h_name_1dPhiPath =
"HLT_" + pathName +
"_1dPhi";
540 h_title_1dEtaPath = pathName +
" Occupancy Vs Eta";
541 h_title_1dPhiPath = pathName +
"Occupancy Vs Phi";
544 if (hist_mini_cppath) {
545 TAxis * axis = hist_mini_cppath->GetXaxis();
547 axis->SetBinLabel(jPath, pathName.c_str());
550 Path_Folder = TString(
"HLT/GeneralHLTOffline/" + label +
"/Paths");
554 h_title_1dEtaPath.c_str(),
557 h_title_1dPhiPath.c_str(),
558 numBinsPhiFine, -PhiMaxFine, PhiMaxFine);
561 std::cout <<
"book1D for " << pathName << std::endl;
565 std::cout <<
"Success setupHltMatrix( " << label <<
" , "
571 const std::string &
path,
576 std::cout <<
"Inside fillHltMatrix( " << label <<
" , "
577 << path <<
" ) " << std::endl;
579 std::string fullPathToME;
580 std::string fullPathToME1dEta;
581 std::string fullPathToME1dPhi;
582 std::string fullPathToME1dEtaPath;
583 std::string fullPathToME1dPhiPath;
584 std::string fullPathToCPP;
587 fullPathToME =
"HLT/GeneralHLTOffline/HLT_" + label +
"_EtaVsPhi";
588 fullPathToME1dEta =
"HLT/GeneralHLTOffline/HLT_" + label +
"_1dEta";
589 fullPathToME1dPhi =
"HLT/GeneralHLTOffline/HLT_" + label +
"_1dPhi";
590 fullPathToCPP =
"HLT/GeneralHLTOffline/" + label
593 if (label !=
"SingleMu" && label !=
"SingleElectron" && label !=
"Jet") {
594 fullPathToME =
"HLT/GeneralHLTOffline/"
595 + label +
"/HLT_" + label +
"_EtaVsPhi";
596 fullPathToME1dEta =
"HLT/GeneralHLTOffline/"
597 + label +
"/HLT_" + label +
"_1dEta";
598 fullPathToME1dPhi =
"HLT/GeneralHLTOffline/"
599 + label +
"/HLT_" + label +
"_1dPhi";
602 fullPathToME1dEtaPath =
"HLT/GeneralHLTOffline/"
603 + label +
"/Paths/HLT_"
605 fullPathToME1dPhiPath =
"HLT/GeneralHLTOffline/"
606 + label +
"/Paths/HLT_"
609 TH1F * hist_mini_cppath =
NULL;
612 hist_mini_cppath = ME_mini_cppath->
getTH1F();
617 std::cout <<
" label " << label <<
" fullPathToME1dPhi "
618 << fullPathToME1dPhi <<
" path " << path
619 <<
" Phi " << Phi <<
" Eta " << Eta << std::endl;
621 if (label !=
"MET" && label !=
"HT") {
624 TH1F * hist_1dEta = ME_1dEta->
getTH1F();
626 hist_1dEta->Fill(Eta);
632 TH1F * hist_1dPhi = ME_1dPhi->
getTH1F();
634 hist_1dPhi->Fill(Phi);
636 std::cout <<
" **FILLED** label " << label <<
" fullPathToME1dPhi "
637 << fullPathToME1dPhi <<
" path " << path
638 <<
" Phi " << Phi <<
" Eta " << Eta << std::endl;
641 if (label !=
"MET" && label !=
"HT") {
644 TH2F * hist_2d = ME_2d->
getTH2F();
646 hist_2d->Fill(Eta, Phi);
651 if (label !=
"MET" && label !=
"HT") {
654 TH1F * hist_1dEtaPath = ME_1dEtaPath->
getTH1F();
656 hist_1dEtaPath->Fill(Eta);
662 TH1F * hist_1dPhiPath = ME_1dPhiPath->
getTH1F();
664 hist_1dPhiPath->Fill(Phi);
670 std::cout <<
" MET Eta is " << Eta << std::endl;
672 if (hist_mini_cppath) {
673 TAxis * axis = hist_mini_cppath->GetXaxis();
674 int bin_num = axis->FindBin(path.c_str());
675 int bn = bin_num - 1;
676 hist_mini_cppath->Fill(bn, 1);
unsigned int size() const
number of trigger paths in trigger table
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool saveTags(const std::string &module) const
Is module an L3 filter (ie, tracked saveTags=true)
const std::string moduleType(const std::string &module) const
C++ class name of module.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
#define DEFINE_FWK_MODULE(type)
const std::string & tableName() const
HLT ConfDB table name.
const double EtaMax[kNumberCalorimeter]
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::string plotDirectoryName
LuminosityBlockNumber_t luminosityBlock() const
static const std::string removeVersion(const std::string &trigger)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
const std::vector< std::string > & streamNames() const
MonitorElement * bookString(const char *name, const char *value)
Book string.
const std::vector< std::string > & streamContent(unsigned int stream) const
names of datasets in stream with index i
virtual void setupHltMatrix(const std::string &, int)
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const std::string & processName() const
process name
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
const std::vector< std::string > & datasetContent(unsigned int dataset) const
names of trigger paths in dataset with index i
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
std::vector< std::vector< std::string > > PDsVectorPathsVector
std::vector< std::string > AddedDatasets
std::vector< size_type > Keys
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
virtual void fillHltMatrix(const std::string &, const std::string &, double, double, bool)
TH1F * getTH1F(void) const
HLTConfigProvider hlt_config_
virtual void endRun(edm::Run const &, edm::EventSetup const &)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
GeneralHLTOffline(const edm::ParameterSet &)
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)