116 std::cout <<
"Inside Constructor" << std::endl;
130 std::cout <<
"Inside analyze - run, block, event "
132 <<
" , " << iEvent.
id() <<
" , " << std::endl;
138 if (!triggerResults.
isValid()) {
140 std::cout <<
"Trigger results not valid" << std::endl;
145 std::cout <<
"Found triggerResults" << std::endl;
153 bool hasRawTriggerEvent =
true;
154 if( !rawTriggerEvent.
isValid() ){
155 hasRawTriggerEvent =
false;
157 std::cout <<
"No RAW trigger summary found! Returning...";
159 if( !aodTriggerEvent.
isValid() ){
161 std::cout <<
"No AOD trigger summary found! Returning...";
169 for (
unsigned int iPD = 0; iPD < datasetNames.size(); iPD++) {
171 for (
unsigned int iPath = 0;
176 std::cout <<
"Looking at path " << pathName << std::endl;
178 <<
" triggerResults->size() = " << triggerResults->size()
184 std::string fullPathToCPP =
"HLT/GeneralHLTOffline/"
185 + label +
"/cppath_" + label +
hlt_menu_;
187 TH1F * hist_mini_cppath =
NULL;
190 hist_mini_cppath = ME_mini_cppath->
getTH1F();
193 if (hist_mini_cppath) {
194 TAxis * axis = hist_mini_cppath->GetXaxis();
197 int bin_num = axis->FindBin(pathNameNoVer.c_str());
198 int bn = bin_num - 1;
199 hist_mini_cppath->Fill(bn, 0);
200 hist_mini_cppath->SetEntries(hist_mini_cppath->Integral());
204 if( index < triggerResults->
size() ) {
205 bool accept = triggerResults->accept(index);
226 std::cout <<
"Inside beginRun" << std::endl;
246 std::cout <<
"Warning, didn't find process HLT" << std::endl;
269 std::vector<std::string>::const_iterator si = nameStreams.begin();
270 std::vector<std::string>::const_iterator se = nameStreams.end();
271 for ( ; si != se; ++si) {
281 std::cout <<
"Number of Stream A datasets "
282 << datasetNames.size() << std::endl;
284 for (
unsigned int i = 0;
i < datasetNames.size();
i++) {
287 std::cout <<
"This is dataset " << datasetNames[
i]
288 <<
"datasetPaths.size() = " << datasetPaths.size() << std::endl;
289 for (
unsigned int iPath = 0;
290 iPath < datasetPaths.size(); iPath++) {
291 std::cout <<
"Before setupHltMatrix - MET dataset "
292 << datasetPaths[iPath] << std::endl;
297 bool foundDataset =
false;
305 <<
" found in AddedDatasets at position " << d << std::endl;
312 std::cout <<
" Fill trigger paths for dataset "
313 << datasetNames[
i] << std::endl;
325 std::cout <<
" Additional runs : Check for additional"
326 <<
"trigger paths per dataset " << std::endl;
331 for (
unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
333 std::cout <<
"Looping over trigger list in dataset "
335 << datasetPaths[iTrig] << std::endl;
340 std::cout <<
"Looping over existing trigger list " << od
347 std::cout <<
" FOUND " << datasetPaths[iTrig] << std::endl;
356 <<
" NOT FOUND - so we added it to the correct dataset "
357 << datasetNames[
i] << std::endl;
363 std::cout <<
" PDsVectorPathsVector[" << is <<
"] is "
366 std::cout <<
" trigger " << ip <<
" path "
373 std::cout <<
"Found PD: " << datasetNames[
i] << std::endl;
388 PD_Folder = TString(
"HLT/GeneralHLTOffline/"+label);
395 folderz = TString(
"HLT/GeneralHLTOffline/"+label);
400 TH1F * hist_mini_cppath =
NULL;
414 if (hist_mini_cppath) {
415 TAxis * axis = hist_mini_cppath->GetXaxis();
417 axis->SetBinLabel(jPath, pathName.c_str());
422 int NumModules = int( moduleLabels.size() );
424 if( !(pathNameVer.find(
"HLT_") != std::string::npos) )
continue;
425 if( (pathNameVer.find(
"HLT_Physics")!=std::string::npos) ||
426 (pathNameVer.find(
"HLT_Random")!=std::string::npos) )
continue;
430 std::vector<std::string> good_module_names;
431 for(
int iMod=0; iMod<NumModules; iMod++ ){
434 if( !(moduleEDMType ==
"EDFilter") )
continue;
435 if( moduleType.find(
"Selector")!= std::string::npos )
continue;
436 if( moduleType ==
"HLTTriggerTypeFilter" ||
437 moduleType ==
"HLTBool" ||
438 moduleType ==
"PrimaryVertexObjectFilter" ||
439 moduleType ==
"JetVertexChecker" ||
440 moduleType ==
"HLTRHemisphere" ||
441 moduleType ==
"DetectorStateFilter" )
continue;
443 if( moduleLabels[iMod].
compare(0, prefix.length(),
prefix) == 0 )
continue;
444 good_module_names.push_back(moduleLabels[iMod]);
447 int NumGoodModules = int( good_module_names.size() );
449 if( NumGoodModules==0 )
continue;
462 for(
int iMod=0; iMod<NumGoodModules; iMod++ ){
466 axis->SetBinLabel(iMod+1,good_module_names[iMod].c_str());
471 std::cout <<
"book1D for " << pathName << std::endl;
475 std::cout <<
"Success setupHltMatrix( " << label <<
" , "
476 << iPD <<
" )" << std::endl;
483 bool hasRawTriggerEvent,
487 std::cout <<
"Inside fillHltMatrix( " << label <<
" , "
488 << path <<
" ) " << std::endl;
492 fullPathToCPP =
"HLT/GeneralHLTOffline/" + label +
"/cppath_" + label +
"_" +
hlt_menu_;
496 TH1F * hist_mini_cppath =
NULL;
500 hist_mini_cppath = ME_mini_cppath->
getTH1F();
505 if( (path.find(
"HLT_") != std::string::npos) &&
506 !(path.find(
"HLT_Physics")!=std::string::npos) &&
507 !(path.find(
"HLT_Random")!=std::string::npos) ){
509 unsigned int triggerEventSize = 0;
510 if( hasRawTriggerEvent && triggerEventRAW.
isValid() ) triggerEventSize = triggerEventRAW->size();
511 else if( triggerEventAOD.
isValid() ) triggerEventSize = triggerEventAOD->sizeFilters();
514 int NumModules = int( moduleLabels.size() );
516 std::string pathName_dataset =
"cpfilt_" + label +
"_" + pathNameNoVer;
518 TH1F * hist_cpfilt_mini =
NULL;
522 hist_cpfilt_mini = ME_cpfilt_mini->
getTH1F();
527 for(
int iMod=0; iMod<NumModules; iMod++ ){
530 if( !(moduleEDMType ==
"EDFilter") )
continue;
531 if( moduleType.find(
"Selector")!= std::string::npos )
continue;
532 if( moduleType ==
"HLTTriggerTypeFilter" ||
533 moduleType ==
"HLTBool" ||
534 moduleType ==
"PrimaryVertexObjectFilter" ||
535 moduleType ==
"JetVertexChecker" ||
536 moduleType ==
"HLTRHemisphere" ||
537 moduleType ==
"DetectorStateFilter" )
continue;
539 if( moduleLabels[iMod].
compare(0, prefix.length(),
prefix) == 0 )
continue;
545 unsigned int idx_module_trg = 0;
546 if( hasRawTriggerEvent && triggerEventRAW.
isValid() ) idx_module_trg = triggerEventRAW->filterIndex(moduleWhoseResultsWeWant);
547 else if( triggerEventAOD.
isValid() ) idx_module_trg = triggerEventAOD->filterIndex(moduleWhoseResultsWeWant);
549 if( !(idx_module_trg < triggerEventSize) )
continue;
550 if( hist_cpfilt_mini ){
551 TAxis * axis = hist_cpfilt_mini->GetXaxis();
552 int bin_num = axis->FindBin(moduleLabels[iMod].c_str());
553 int bn = bin_num - 1;
555 if( bin_num!=1 && hasRawTriggerEvent ){
556 bool passPreviousFilters =
true;
557 for(
int ibin = bin_num-1; ibin>0; ibin-- ){
558 std::string previousFilter(axis->GetBinLabel(ibin));
559 edm::InputTag previousModuleWhoseResultsWeWant(previousFilter,
562 unsigned int idx_previous_module_trg = 0;
563 if( hasRawTriggerEvent && triggerEventRAW.
isValid() ) idx_previous_module_trg = triggerEventRAW->filterIndex(previousModuleWhoseResultsWeWant);
564 else if( triggerEventAOD.
isValid() ) idx_previous_module_trg = triggerEventAOD->filterIndex(previousModuleWhoseResultsWeWant);
566 if( !(idx_previous_module_trg < triggerEventSize) ){
567 passPreviousFilters =
false;
572 if( passPreviousFilters ) hist_cpfilt_mini->Fill(bn, 1);
574 else hist_cpfilt_mini->Fill(bn, 1);
583 if( accept && hist_mini_cppath ){
584 TAxis * axis = hist_mini_cppath->GetXaxis();
585 int bin_num = axis->FindBin(pathNameNoVer.c_str());
586 int bn = bin_num - 1;
587 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
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenRAW
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
const std::string moduleType(const std::string &module) const
C++ class name of module.
std::map< std::string, TH1F * > hist_cpfilt_mini_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
MonitorElement * bookString(Args &&...args)
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryTokenAOD
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
const std::string & tableName() const
HLT ConfDB table name.
std::string plotDirectoryName
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
LuminosityBlockNumber_t luminosityBlock() const
static const std::string removeVersion(const std::string &trigger)
virtual void setupHltMatrix(DQMStore::IBooker &iBooker, const std::string &, int)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
const std::vector< std::string > & streamNames() const
const std::vector< std::string > & streamContent(unsigned int stream) const
names of datasets in stream with index i
MonitorElement * book1D(Args &&...args)
static std::string const triggerResults
std::map< std::string, MonitorElement * > cppath_mini_
virtual void fillHltMatrix(const std::string &, const std::string &, bool, bool, edm::Handle< trigger::TriggerEventWithRefs >, edm::Handle< trigger::TriggerEvent >)
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::map< std::string, MonitorElement * > cpfilt_mini_
virtual void dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) override
void setCurrentFolder(const std::string &fullpath)
std::vector< std::vector< std::string > > PDsVectorPathsVector
std::vector< std::string > AddedDatasets
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &iRun, edm::EventSetup const &iSetup) override
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
TH1F * getTH1F(void) const
HLTConfigProvider hlt_config_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
GeneralHLTOffline(const edm::ParameterSet &)
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
volatile std::atomic< bool > shutdown_flag false
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
tuple size
Write out results.