75 virtual void endJob() ;
137 dqm_ (iConfig.getUntrackedParameter<bool>(
"dqm")),
138 triggerLabelORIG_ (iConfig.getUntrackedParameter<edm::InputTag>(
"triggerTagORIG")),
139 triggerLabelNEW_ (iConfig.getUntrackedParameter<edm::InputTag>(
"triggerTagNEW")),
148 triggerNames_matched_ (),
149 processNameORIG_ (iConfig.getParameter<std::string>(
"processNameORIG")),
150 processNameNEW_ (iConfig.getParameter<std::string>(
"processNameNEW")),
151 Nfiles_ (iConfig.getUntrackedParameter<int>(
"Nfiles",0)),
152 Normalization_ (iConfig.getUntrackedParameter<double>(
"Norm",40.)),
153 isRealData_ (iConfig.getUntrackedParameter<bool>(
"isRealData",
true)),
154 LumiSecNumber_ (iConfig.getUntrackedParameter<int>(
"LumiSecNumber",1)),
156 path_ORIGnotNEW_hist (0),
157 path_NEWnotORIG_hist (0),
158 pathmodule_ORIGnotNEW_hist(0),
159 pathmodule_NEWnotORIG_hist(0),
160 path_ORIG_hist_PD (),
161 path_ORIGnotNEW_hist_PD (),
162 path_NEWnotORIG_hist_PD (),
163 pathmodule_ORIGnotNEW_hist_PD(),
164 pathmodule_NEWnotORIG_hist_PD()
198 trORIG_ = *h_trigResORIG_;
203 trNEW_ = *h_trigResNEW_;
205 vector<string> triggerListORIG_;
207 bool foundNamesORIG_ = tnsORIG_->getTrigPaths(trORIG_,triggerListORIG_);
208 if (!foundNamesORIG_)
LogError(
"DataNotFound")<<
"Could not get ORIG trigger names!";
209 if (trORIG_.size()!=triggerListORIG_.size())
LogError(
"DataNotFound")<<
"Length of names and paths not the same: " << triggerListORIG_.size() <<
"," << trORIG_.size() << endl;
211 vector<string> triggerListNEW_;
213 bool foundNamesNEW_ = tnsNEW_->getTrigPaths(trNEW_,triggerListNEW_);
214 if (!foundNamesNEW_)
LogError(
"DataNotFound")<<
"Could not get trigger names!";
215 if (trNEW_.size()!=triggerListNEW_.size())
LogError(
"DataNotFound")<<
"Length of names and paths not the same: " << triggerListNEW_.size() <<
"," << trNEW_.size() << endl;
218 vector<bool> ORIG_accept_, NEW_accept_, fails_prescaler_;
219 vector<int> module_indexORIG_, module_indexNEW_;
220 vector<string> module_index_labelORIG_, module_index_labelNEW_;
223 ORIG_accept_.push_back(
false);
224 NEW_accept_.push_back(
false);
225 module_indexORIG_.push_back(-1);
226 module_indexNEW_.push_back(-1);
227 module_index_labelORIG_.push_back(
" ");
228 module_index_labelNEW_.push_back(
" ");
229 fails_prescaler_.push_back(
false);
237 LogDebug(
"event")<<
"triggerListORIG and triggerNames matched for 'global' path "<<
x<<
", "<<
triggerNames_.at(
x);
240 if (trORIG_.at(
i).wasrun()==1 && trORIG_.at(
i).accept()==1 && trORIG_.at(
i).error()==0) {
242 ORIG_accept_.at(
x) =
true;
255 if (trORIG_.at(
i).accept() == 0){
265 if ( (trORIG_.at(
i).accept()==0 &&
j==trORIG_.at(
i).index()) && (moduleType==
"HLTPrescaler" || moduleType==
"TriggerResultsFilter") ) fails_prescaler_.at(
x) =
true;
278 if (trNEW_.at(
i).wasrun()==1 && trNEW_.at(
i).accept()==1 && trNEW_.at(
i).error()==0) {
279 NEW_accept_.at(
x) =
true;
284 if (trNEW_.at(
i).accept() == 0) {
293 if ( (trNEW_.at(
i).accept()==0 &&
j==trNEW_.at(
i).index()) && (moduleType==
"HLTPrescaler" || moduleType==
"TriggerResultsFilter") ) fails_prescaler_.at(
x) =
true;
304 if (!fails_prescaler_.at(
x)){
305 if(ORIG_accept_.at(
x) && !NEW_accept_.at(
x)){
308 LogInfo(
"EventNotReproduced")<<
"Fires in ORIG but not NEW!!"<<
" Path is: "<<
triggerNames_.at(
x)<<
", last run module is: "<<module_index_labelNEW_.at(
x);
318 if(!ORIG_accept_.at(
x) && NEW_accept_.at(
x)){
321 LogInfo(
"EventNotReproduced")<<
"Fires in NEW but not ORIG!!"<<
" Path is: "<<
triggerNames_.at(
x)<<
", last run module is: "<<module_index_labelORIG_.at(
x)<<endl;
358 vector<string> triggerNamesORIG_, triggerNamesNEW_;
359 vector<string> temp_;
360 unsigned int max_nModules_=0;
361 vector<unsigned int> max_nModules_PD_, nModules_diff_;
362 bool TriggerModuleNamesOK_ =
true;
368 edm::LogInfo(
"HLTConfigProvider")<<
"hlt_Config_.init returns true for ORIG"<<endl;
398 edm::LogInfo(
"HLTConfigProvider")<<
"hlt_Config_.init returns true for NEW"<<endl;
426 TriggerModuleNamesOK_ =
false;
435 if (triggerNamesORIG_.at(
i)==triggerNamesNEW_.at(
j)){
437 if (
i!=
j)
edm::LogInfo(
"PathInfo")<<
"Path "<<triggerNamesORIG_.at(
i)<<
" corresponds to path number "<<
i<<
" for ORIG and path number "<<
j<<
" for NEW";
442 LogDebug(
"")<<
"moduleLabelORIG<=moduleLabelNEW, so moduleLabelORIG_.at(i).size() is: "<<
moduleLabelORIG_.at(
i).size()<<
" for ORIG path "<<
i;
446 LogDebug(
"")<<
"moduleLabelORIG>moduleLabelNEW, so moduleLabelNEW_.at(j).size() is: "<<
moduleLabelNEW_.at(j).size()<<
" for NEW path "<<
j;
457 LogDebug(
"")<<
"nModules_diff is: "<<nModules_diff_.at(x)<<
" for 'global' path "<<
x;
470 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";
487 if (TriggerModuleNamesOK_){
491 edm::LogInfo(
"PathInfo")<<
"Maximum number of modules over all paths is: "<<max_nModules_;
509 max_nModules_PD_.push_back(0);
519 edm::LogInfo(
"DatasetInfo")<<
" path "<<
b<<
" is "<<datasetcontent_.at(
b);
520 temp_.push_back(datasetcontent_.at(
b));
527 vector <vector<bool> > temp1_;
535 temp2_.push_back(
true);
538 else temp2_.push_back(
false);
540 temp1_.push_back(temp2_);
567 if (not
dqms_)
return;
568 dqms_->setCurrentFolder(
"DQMExample/DQMSource_HLTOfflineReproducibility");
573 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();
574 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();
585 char folder_name[500];
586 char path_ORIG_name[100], path_ORIGnotNEW_name[100], path_NEWnotORIG_name[100], pathmodule_ORIGnotNEW_name[100], pathmodule_NEWnotORIG_name[100];
588 snprintf(path_ORIG_name, 100,
"path_ORIG_hist_%s",
datasetNames_.at(
a).c_str());
589 snprintf(path_ORIGnotNEW_name, 100,
"path_ORIGnotNEW_hist_%s",
datasetNames_.at(
a).c_str());
590 snprintf(path_NEWnotORIG_name, 100,
"path_NEWnotORIG_hist_%s",
datasetNames_.at(
a).c_str());
591 snprintf(pathmodule_ORIGnotNEW_name, 100,
"pathmodule_ORIGnotNEW_hist_%s",
datasetNames_.at(
a).c_str());
592 snprintf(pathmodule_NEWnotORIG_name, 100,
"pathmodule_NEWnotORIG_hist_%s",
datasetNames_.at(
a).c_str());
594 TString path_ORIG_title =
"Total Times Path Fires ORIG (" +
datasetNames_.at(
a) +
" dataset)";
595 TString path_ORIGnotNEW_title =
"Path fires in ORIG but not in NEW (" +
datasetNames_.at(
a) +
" dataset)";
596 TString path_NEWnotORIG_title =
"Path fires in NEW but not in ORIG (" +
datasetNames_.at(
a) +
" dataset)";
597 TString pathmodule_ORIGnotNEW_title =
"Last run module index vs Path for NEW, when ORIG fired but NEW didn't (" +
datasetNames_.at(
a) +
" dataset)";
598 TString pathmodule_NEWnotORIG_title =
"Last run module index vs Path for ORIG, when NEW fired but ORIG didn't (" +
datasetNames_.at(
a) +
" dataset)";
601 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_
const std::string moduleType(const std::string &module) const
C++ class name of module.
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
edm::InputTag triggerLabelNEW_
#define DEFINE_FWK_MODULE(type)
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_
vector< unsigned int > nModules_
const std::string & moduleLabel(unsigned int trigger, unsigned int module) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
vector< TH2F * > pathmodule_ORIGnotNEW_hist_PD
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_
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
vector< TH1F * > path_ORIGnotNEW_hist_PD
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
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)
TH2F * pathmodule_ORIGnotNEW_hist
T * make() const
make new ROOT object
vector< vector< string > > moduleLabelORIG_
vector< unsigned int > nPaths_PD_
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_
virtual void endRun(edm::Run const &, edm::EventSetup const &)
void setCurrentFolder(const std::string &fullpath)
const std::vector< std::string > & datasetNames() const
vector< vector< string > > moduleLabelNEW_