55 virtual void endJob()
override;
65 double,
double,
bool);
101 std::cout <<
"Inside Constructor" << std::endl;
115 std::cout <<
"Inside analyze - run, block, event "
117 <<
" , " << iEvent.
id() <<
" , " << std::endl;
124 if (!triggerResults.
isValid()) {
126 std::cout <<
"Trigger results not valid" << std::endl;
131 std::cout <<
"Found triggerResults" << std::endl;
137 if (!aodTriggerEvent.
isValid()) {
139 std::cout <<
"No AOD trigger summary found! Returning...";
148 for (
unsigned int iPD = 0; iPD < datasetNames.size(); iPD++) {
150 bool first_count =
true;
151 for (
unsigned int iPath = 0;
156 std::cout <<
"Looking at path " << pathName << std::endl;
158 <<
" triggerResults->size() = " << triggerResults->size()
164 std::string fullPathToCPP =
"HLT/GeneralHLTOffline/"
165 + label +
"/cppath_" + label +
hlt_menu_;
167 TH1F * hist_mini_cppath =
NULL;
169 hist_mini_cppath = ME_mini_cppath->
getTH1F();
171 if (hist_mini_cppath) {
172 TAxis * axis = hist_mini_cppath->GetXaxis();
174 int bin_num = axis->FindBin(pathName.c_str());
175 int bn = bin_num - 1;
176 hist_mini_cppath->Fill(bn, 0);
177 hist_mini_cppath->SetEntries(hist_mini_cppath->Integral());
181 if (index < triggerResults->
size()) {
182 if (triggerResults->accept(index)) {
186 <<
" Run " << iEvent.
id().
run()
187 <<
" fired path " << pathName << std::endl;
190 const std::vector<std::string> &modulesThisPath =
194 std::cout <<
"Looping over module labels " << std::endl;
197 for (
int iModule = (modulesThisPath.size() - 1);
198 iModule >= 0; iModule--) {
201 << modulesThisPath[iModule] << std::endl;
206 <<
" this module " << modulesThisPath[iModule]
207 <<
" is a saveTags module of type "
211 ==
"HLTLevel1GTSeed")
213 edm::InputTag moduleWhoseResultsWeWant(modulesThisPath[iModule],
216 unsigned int idx_module_aod_trg =
217 aodTriggerEvent->filterIndex(moduleWhoseResultsWeWant);
218 if (idx_module_aod_trg < aodTriggerEvent->sizeFilters()) {
220 aodTriggerEvent->filterKeys(idx_module_aod_trg);
223 << idx_module_aod_trg
224 <<
", size of keys is " << keys.size()
226 if (keys.size() >= 1000)
228 <<
"WARNING!! size of keys is " << keys.size()
229 <<
" for path " << pathName <<
" and module "
230 << modulesThisPath[iModule]<< std::endl;
240 if (keys.size() > 0) {
243 std::cout <<
"This object has id (pt, eta, phi) = "
244 <<
" " << foundObject.
id() <<
" "
245 << std::setw(10) << foundObject.
pt()
246 <<
", " << std::setw(10) << foundObject.
eta()
247 <<
", " << std::setw(10) << foundObject.
phi()
248 <<
" for path = " << std::setw(20) << pathName
249 <<
" module " << std::setw(40)
250 << modulesThisPath[iModule] << std::endl;
253 << iEvent.
id() <<
" " << pathName <<
" "
254 << modulesThisPath[iModule] <<
" "
255 << datasetNames[iPD] <<
" "
257 <<
" " << keys.size() <<
" "
258 << std::setprecision(4) << foundObject.
pt() <<
" "
259 << foundObject.
eta() <<
" "
260 << foundObject.
phi() << std::endl;
266 foundObject.
eta(), foundObject.
phi(),
288 std::cout <<
"Inside begin job" << std::endl;
305 std::cout <<
"Inside beginRun" << std::endl;
316 std::cout <<
"Warning, didn't find process HLT" << std::endl;
339 std::vector<std::string>::const_iterator si = nameStreams.begin();
340 std::vector<std::string>::const_iterator se = nameStreams.end();
341 for ( ; si != se; ++si) {
351 std::cout <<
"Number of Stream A datasets "
352 << datasetNames.size() << std::endl;
354 for (
unsigned int i = 0;
i < datasetNames.size();
i++) {
357 std::cout <<
"This is dataset " << datasetNames[
i]
358 <<
"datasetPaths.size() = " << datasetPaths.size() << std::endl;
359 for (
unsigned int iPath = 0;
360 iPath < datasetPaths.size(); iPath++) {
361 std::cout <<
"Before setupHltMatrix - MET dataset "
362 << datasetPaths[iPath] << std::endl;
367 bool foundDataset =
false;
375 <<
" found in AddedDatasets at position " << d << std::endl;
382 std::cout <<
" Fill trigger paths for dataset "
383 << datasetNames[
i] << std::endl;
395 std::cout <<
" Additional runs : Check for additional"
396 <<
"trigger paths per dataset " << std::endl;
401 for (
unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
403 std::cout <<
"Looping over trigger list in dataset "
405 << datasetPaths[iTrig] << std::endl;
410 std::cout <<
"Looping over existing trigger list " << od
417 std::cout <<
" FOUND " << datasetPaths[iTrig] << std::endl;
426 <<
" NOT FOUND - so we added it to the correct dataset "
427 << datasetNames[
i] << std::endl;
433 std::cout <<
" PDsVectorPathsVector[" << is <<
"] is "
436 std::cout <<
" trigger " << ip <<
" path "
443 std::cout <<
"Found PD: " << datasetNames[
i] << std::endl;
453 std::cout <<
" endRun called " << std::endl;
472 PD_Folder = TString(
"HLT/GeneralHLTOffline");
473 if (label !=
"SingleMu" && label !=
"SingleElectron" && label !=
"Jet")
474 PD_Folder = TString(
"HLT/GeneralHLTOffline/"+label);
479 h_name =
"HLT_" +label +
"_EtaVsPhi";
480 h_title =
"HLT_" + label +
"_EtaVsPhi";
481 h_name_1dEta =
"HLT_" + label +
"_1dEta";
482 h_name_1dPhi =
"HLT_" + label +
"_1dPhi";
483 h_title_1dEta = label +
" Occupancy Vs Eta";
484 h_title_1dPhi = label +
" Occupancy Vs Phi";
486 Int_t numBinsEta = 30;
487 Int_t numBinsPhi = 34;
488 Int_t numBinsEtaFine = 60;
489 Int_t numBinsPhiFine = 66;
492 Double_t PhiMaxFine = 33.0*
TMath::Pi()/32.0;
498 numBinsPhi, -PhiMax, PhiMax);
499 if (TH1 * service_histo = service_me->
getTH2F())
500 service_histo->SetMinimum(0);
502 if (label !=
"MET" && label !=
"HT") {
503 service_me =
dbe_->
book1D(h_name_1dEta.c_str(),
504 h_title_1dEta.c_str(),
506 if (TH1 * service_histo = service_me->
getTH1F())
507 service_histo->SetMinimum(0);
510 service_me =
dbe_->
book1D(h_name_1dPhi.c_str(),
511 h_title_1dPhi.c_str(),
512 numBinsPhiFine, -PhiMaxFine, PhiMaxFine);
513 if (TH1 * service_histo = service_me->
getTH1F())
514 service_histo->SetMinimum(0);
520 folderz = TString(
"HLT/GeneralHLTOffline/"+label);
525 TH1F * hist_mini_cppath =
NULL;
531 if (hist_mini_cppath_me)
532 hist_mini_cppath = hist_mini_cppath_me->
getTH1F();
537 h_name_1dEtaPath =
"HLT_" + pathName +
"_1dEta";
538 h_name_1dPhiPath =
"HLT_" + pathName +
"_1dPhi";
539 h_title_1dEtaPath = pathName +
" Occupancy Vs Eta";
540 h_title_1dPhiPath = pathName +
"Occupancy Vs Phi";
543 if (hist_mini_cppath) {
544 TAxis * axis = hist_mini_cppath->GetXaxis();
546 axis->SetBinLabel(jPath, pathName.c_str());
549 Path_Folder = TString(
"HLT/GeneralHLTOffline/" + label +
"/Paths");
553 h_title_1dEtaPath.c_str(),
556 h_title_1dPhiPath.c_str(),
557 numBinsPhiFine, -PhiMaxFine, PhiMaxFine);
560 std::cout <<
"book1D for " << pathName << std::endl;
564 std::cout <<
"Success setupHltMatrix( " << label <<
" , "
575 std::cout <<
"Inside fillHltMatrix( " << label <<
" , "
576 << path <<
" ) " << std::endl;
586 fullPathToME =
"HLT/GeneralHLTOffline/HLT_" + label +
"_EtaVsPhi";
587 fullPathToME1dEta =
"HLT/GeneralHLTOffline/HLT_" + label +
"_1dEta";
588 fullPathToME1dPhi =
"HLT/GeneralHLTOffline/HLT_" + label +
"_1dPhi";
589 fullPathToCPP =
"HLT/GeneralHLTOffline/" + label
592 if (label !=
"SingleMu" && label !=
"SingleElectron" && label !=
"Jet") {
593 fullPathToME =
"HLT/GeneralHLTOffline/"
594 + label +
"/HLT_" + label +
"_EtaVsPhi";
595 fullPathToME1dEta =
"HLT/GeneralHLTOffline/"
596 + label +
"/HLT_" + label +
"_1dEta";
597 fullPathToME1dPhi =
"HLT/GeneralHLTOffline/"
598 + label +
"/HLT_" + label +
"_1dPhi";
601 fullPathToME1dEtaPath =
"HLT/GeneralHLTOffline/"
602 + label +
"/Paths/HLT_"
604 fullPathToME1dPhiPath =
"HLT/GeneralHLTOffline/"
605 + label +
"/Paths/HLT_"
608 TH1F * hist_mini_cppath =
NULL;
611 hist_mini_cppath = ME_mini_cppath->
getTH1F();
616 std::cout <<
" label " << label <<
" fullPathToME1dPhi "
617 << fullPathToME1dPhi <<
" path " << path
618 <<
" Phi " << Phi <<
" Eta " << Eta << std::endl;
620 if (label !=
"MET" && label !=
"HT") {
623 TH1F * hist_1dEta = ME_1dEta->
getTH1F();
625 hist_1dEta->Fill(Eta);
631 TH1F * hist_1dPhi = ME_1dPhi->
getTH1F();
633 hist_1dPhi->Fill(Phi);
635 std::cout <<
" **FILLED** label " << label <<
" fullPathToME1dPhi "
636 << fullPathToME1dPhi <<
" path " << path
637 <<
" Phi " << Phi <<
" Eta " << Eta << std::endl;
640 if (label !=
"MET" && label !=
"HT") {
643 TH2F * hist_2d = ME_2d->
getTH2F();
645 hist_2d->Fill(Eta, Phi);
650 if (label !=
"MET" && label !=
"HT") {
653 TH1F * hist_1dEtaPath = ME_1dEtaPath->
getTH1F();
655 hist_1dEtaPath->Fill(Eta);
661 TH1F * hist_1dPhiPath = ME_1dPhiPath->
getTH1F();
663 hist_1dPhiPath->Fill(Phi);
669 std::cout <<
" MET Eta is " << Eta << std::endl;
671 if (hist_mini_cppath) {
672 TAxis * axis = hist_mini_cppath->GetXaxis();
673 int bin_num = axis->FindBin(path.c_str());
674 int bn = bin_num - 1;
675 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)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
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.
virtual void beginJob() override
const double EtaMax[kNumberCalorimeter]
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)
const std::vector< std::string > & streamNames() const
MonitorElement * bookString(const char *name, const char *value)
Book string.
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
const std::vector< std::string > & streamContent(unsigned int stream) const
names of datasets in stream with index i
virtual void endJob() override
virtual void setupHltMatrix(const std::string &, int)
static std::string const triggerResults
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
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
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 beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
GeneralHLTOffline(const edm::ParameterSet &)
volatile std::atomic< bool > shutdown_flag false
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.
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)