74 virtual void endJob()
override ;
138 dqm_ (iConfig.getUntrackedParameter<bool>(
"dqm")),
139 triggerLabelORIG_ (iConfig.getUntrackedParameter<edm::InputTag>(
"triggerTagORIG")),
140 triggerLabelNEW_ (iConfig.getUntrackedParameter<edm::InputTag>(
"triggerTagNEW")),
149 triggerNames_matched_ (),
150 processNameORIG_ (iConfig.getParameter<std::
string>(
"processNameORIG")),
151 processNameNEW_ (iConfig.getParameter<std::
string>(
"processNameNEW")),
152 Nfiles_ (iConfig.getUntrackedParameter<int>(
"Nfiles",0)),
153 Normalization_ (iConfig.getUntrackedParameter<double>(
"Norm",40.)),
154 isRealData_ (iConfig.getUntrackedParameter<bool>(
"isRealData",
true)),
155 LumiSecNumber_ (iConfig.getUntrackedParameter<int>(
"LumiSecNumber",1)),
157 path_ORIGnotNEW_hist (0),
158 path_NEWnotORIG_hist (0),
159 pathmodule_ORIGnotNEW_hist(0),
160 pathmodule_NEWnotORIG_hist(0),
161 path_ORIG_hist_PD (),
162 path_ORIGnotNEW_hist_PD (),
163 path_NEWnotORIG_hist_PD (),
164 pathmodule_ORIGnotNEW_hist_PD(),
165 pathmodule_NEWnotORIG_hist_PD()
201 trORIG_ = *h_trigResORIG_;
206 trNEW_ = *h_trigResNEW_;
208 vector<string> triggerListORIG_;
210 bool foundNamesORIG_ = tnsORIG_->getTrigPaths(trORIG_,triggerListORIG_);
211 if (!foundNamesORIG_)
LogError(
"DataNotFound")<<
"Could not get ORIG trigger names!";
212 if (trORIG_.size()!=triggerListORIG_.size())
LogError(
"DataNotFound")<<
"Length of names and paths not the same: " << triggerListORIG_.size() <<
"," << trORIG_.size() << endl;
214 vector<string> triggerListNEW_;
216 bool foundNamesNEW_ = tnsNEW_->getTrigPaths(trNEW_,triggerListNEW_);
217 if (!foundNamesNEW_)
LogError(
"DataNotFound")<<
"Could not get trigger names!";
218 if (trNEW_.size()!=triggerListNEW_.size())
LogError(
"DataNotFound")<<
"Length of names and paths not the same: " << triggerListNEW_.size() <<
"," << trNEW_.size() << endl;
221 vector<bool> ORIG_accept_, NEW_accept_, fails_prescaler_;
222 vector<int> module_indexORIG_, module_indexNEW_;
223 vector<string> module_index_labelORIG_, module_index_labelNEW_;
226 ORIG_accept_.push_back(
false);
227 NEW_accept_.push_back(
false);
228 module_indexORIG_.push_back(-1);
229 module_indexNEW_.push_back(-1);
230 module_index_labelORIG_.push_back(
" ");
231 module_index_labelNEW_.push_back(
" ");
232 fails_prescaler_.push_back(
false);
240 LogDebug(
"event")<<
"triggerListORIG and triggerNames matched for 'global' path "<<
x<<
", "<<
triggerNames_.at(
x);
243 if (trORIG_.at(
i).wasrun()==1 && trORIG_.at(
i).accept()==1 && trORIG_.at(
i).error()==0) {
245 ORIG_accept_.at(
x) =
true;
258 if (trORIG_.at(
i).accept() == 0){
268 if ( (trORIG_.at(
i).accept()==0 &&
j==trORIG_.at(
i).index()) && (moduleType==
"HLTPrescaler" || moduleType==
"TriggerResultsFilter") ) fails_prescaler_.at(
x) =
true;
281 if (trNEW_.at(
i).wasrun()==1 && trNEW_.at(
i).accept()==1 && trNEW_.at(
i).error()==0) {
282 NEW_accept_.at(
x) =
true;
287 if (trNEW_.at(
i).accept() == 0) {
296 if ( (trNEW_.at(
i).accept()==0 &&
j==trNEW_.at(
i).index()) && (moduleType==
"HLTPrescaler" || moduleType==
"TriggerResultsFilter") ) fails_prescaler_.at(
x) =
true;
307 if (!fails_prescaler_.at(
x)){
308 if(ORIG_accept_.at(
x) && !NEW_accept_.at(
x)){
311 LogInfo(
"EventNotReproduced")<<
"Fires in ORIG but not NEW!!"<<
" Path is: "<<
triggerNames_.at(
x)<<
", last run module is: "<<module_index_labelNEW_.at(
x);
321 if(!ORIG_accept_.at(
x) && NEW_accept_.at(
x)){
324 LogInfo(
"EventNotReproduced")<<
"Fires in NEW but not ORIG!!"<<
" Path is: "<<
triggerNames_.at(
x)<<
", last run module is: "<<module_index_labelORIG_.at(
x)<<endl;
361 vector<string> triggerNamesORIG_, triggerNamesNEW_;
362 vector<string> temp_;
363 unsigned int max_nModules_=0;
364 vector<unsigned int> max_nModules_PD_, nModules_diff_;
365 bool TriggerModuleNamesOK_ =
true;
371 edm::LogInfo(
"HLTConfigProvider")<<
"hlt_Config_.init returns true for ORIG"<<endl;
401 edm::LogInfo(
"HLTConfigProvider")<<
"hlt_Config_.init returns true for NEW"<<endl;
429 TriggerModuleNamesOK_ =
false;
438 if (triggerNamesORIG_.at(
i)==triggerNamesNEW_.at(
j)){
440 if (
i!=
j)
edm::LogInfo(
"PathInfo")<<
"Path "<<triggerNamesORIG_.at(
i)<<
" corresponds to path number "<<
i<<
" for ORIG and path number "<<
j<<
" for NEW";
445 LogDebug(
"")<<
"moduleLabelORIG<=moduleLabelNEW, so moduleLabelORIG_.at(i).size() is: "<<
moduleLabelORIG_.at(
i).size()<<
" for ORIG path "<<
i;
449 LogDebug(
"")<<
"moduleLabelORIG>moduleLabelNEW, so moduleLabelNEW_.at(j).size() is: "<<
moduleLabelNEW_.at(j).size()<<
" for NEW path "<<
j;
460 LogDebug(
"")<<
"nModules_diff is: "<<nModules_diff_.at(x)<<
" for 'global' path "<<
x;
473 edm::LogInfo(
"PathInfo")<<
"For path "<<triggerNamesORIG_.at(
i)<<
" in ORIG and "<<triggerNamesNEW_.at(j)<<
" in NEW:"<<
" module "<<
moduleLabelORIG_.at(
i).at(
a)<<
" corresponds to module number "<<
a<<
" for ORIG and module number "<<
b<<
" for NEW";
490 if (TriggerModuleNamesOK_){
494 edm::LogInfo(
"PathInfo")<<
"Maximum number of modules over all paths is: "<<max_nModules_;
512 max_nModules_PD_.push_back(0);
522 edm::LogInfo(
"DatasetInfo")<<
" path "<<
b<<
" is "<<datasetcontent_.at(
b);
523 temp_.push_back(datasetcontent_.at(
b));
530 vector <vector<bool> > temp1_;
538 temp2_.push_back(
true);
541 else temp2_.push_back(
false);
543 temp1_.push_back(temp2_);
570 if (not
dqms_)
return;
571 dqms_->setCurrentFolder(
"DQMExample/DQMSource_HLTOfflineReproducibility");
576 pathmodule_ORIGnotNEW_hist = dqms_->book2D(
"pathmodule_ORIGnotNEW_hist",
"Last run module index vs Path for NEW, when ORIG fired but NEW didn't",
nPaths_,0,
nPaths_,max_nModules_,0,max_nModules_)->getTH2F();
577 pathmodule_NEWnotORIG_hist = dqms_->book2D(
"pathmodule_NEWnotORIG_hist",
"Last run module index vs Path for ORIG, when NEW fired but ORIG didn't",
nPaths_,0,
nPaths_,max_nModules_,0,max_nModules_)->getTH2F();
588 char folder_name[500];
589 char path_ORIG_name[100], path_ORIGnotNEW_name[100], path_NEWnotORIG_name[100], pathmodule_ORIGnotNEW_name[100], pathmodule_NEWnotORIG_name[100];
591 snprintf(path_ORIG_name, 100,
"path_ORIG_hist_%s",
datasetNames_.at(
a).c_str());
592 snprintf(path_ORIGnotNEW_name, 100,
"path_ORIGnotNEW_hist_%s",
datasetNames_.at(
a).c_str());
593 snprintf(path_NEWnotORIG_name, 100,
"path_NEWnotORIG_hist_%s",
datasetNames_.at(
a).c_str());
594 snprintf(pathmodule_ORIGnotNEW_name, 100,
"pathmodule_ORIGnotNEW_hist_%s",
datasetNames_.at(
a).c_str());
595 snprintf(pathmodule_NEWnotORIG_name, 100,
"pathmodule_NEWnotORIG_hist_%s",
datasetNames_.at(
a).c_str());
597 TString path_ORIG_title =
"Total Times Path Fires ORIG (" +
datasetNames_.at(
a) +
" dataset)";
598 TString path_ORIGnotNEW_title =
"Path fires in ORIG but not in NEW (" +
datasetNames_.at(
a) +
" dataset)";
599 TString path_NEWnotORIG_title =
"Path fires in NEW but not in ORIG (" +
datasetNames_.at(
a) +
" dataset)";
600 TString pathmodule_ORIGnotNEW_title =
"Last run module index vs Path for NEW, when ORIG fired but NEW didn't (" +
datasetNames_.at(
a) +
" dataset)";
601 TString pathmodule_NEWnotORIG_title =
"Last run module index vs Path for ORIG, when NEW fired but ORIG didn't (" +
datasetNames_.at(
a) +
" dataset)";
604 sprintf(folder_name,
"DQMExample/DQMSource_HLTOfflineReproducibility/%s",
datasetNames_.at(
a).c_str());
unsigned int size() const
number of trigger paths in trigger table
edm::InputTag triggerLabelORIG_
vector< int > trigger_NEW_
virtual void beginRun(edm::Run const &, edm::EventSetup const &) 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.
edm::InputTag triggerLabelNEW_
edm::EDGetTokenT< edm::TriggerResults > triggerTokenORIG_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
vector< TH1F * > path_NEWnotORIG_hist_PD
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::vector< std::string > & triggerNames() const
names of trigger paths
vector< int > trigger_ORIG_
T * make(const Args &...args) const
make new ROOT object
virtual void beginJob() override
vector< unsigned int > nModules_
const std::string & moduleLabel(unsigned int trigger, unsigned int module) const
vector< TH2F * > pathmodule_ORIGnotNEW_hist_PD
edm::EDGetTokenT< edm::TriggerResults > triggerTokenNEW_
unsigned int moduleIndex(unsigned int trigger, const std::string &module) const
slot position of module on trigger path (0 to size-1)
void addDefault(ParameterSetDescription const &psetDescription)
HLTConfigProvider hltConfig_
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
TH1F * path_NEWnotORIG_hist
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
vector< TH2F * > pathmodule_NEWnotORIG_hist_PD
vector< vector< string > > moduleLabel_
vector< TH1F * > path_ORIG_hist_PD
TH1F * path_ORIGnotNEW_hist
vector< TH1F * > path_ORIGnotNEW_hist_PD
vector< string > datasetNames_
vector< vector< string > > datasetContent_
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
~HLTOfflineReproducibility()
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
HLTOfflineReproducibility(const edm::ParameterSet &)
vector< vector< vector< bool > > > triggerNames_matched_
TH2F * getTH2F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
TH2F * pathmodule_ORIGnotNEW_hist
vector< vector< string > > moduleLabelORIG_
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
vector< unsigned int > nPaths_PD_
virtual void endJob() override
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
TH2F * pathmodule_NEWnotORIG_hist
vector< string > triggerNames_
void setCurrentFolder(const std::string &fullpath)
const std::vector< std::string > & datasetNames() const
vector< vector< string > > moduleLabelNEW_