60 #include "TDirectory.h"
64 #include "TObjString.h"
86 dirname_(iConfig.getUntrackedParameter(
"dirname",
87 std::string(
"HLT/SusyExo"))),
88 HistoFileName(iConfig.getUntrackedParameter(
"histoFileName",
89 std::string(
"SusyBsmTriggerValidation.root"))),
90 StatFileName(iConfig.getUntrackedParameter(
"statFileName",
91 std::string(
"SusyBsmTriggerValidation.stat"))),
92 l1Label(iConfig.getParameter<edm::
InputTag>(
"L1Label")),
93 hltLabel(iConfig.getParameter<edm::
InputTag>(
"HltLabel")),
94 mcFlag(iConfig.getUntrackedParameter<bool>(
"mc_flag",
false)),
95 l1Flag(iConfig.getUntrackedParameter<bool>(
"l1_flag",
false)),
96 reco_parametersets(iConfig.getParameter<
VParameterSet>(
"reco_parametersets")),
97 mc_parametersets(iConfig.getParameter<
VParameterSet>(
"mc_parametersets")),
98 turnOn_params(iConfig.getParameter<
ParameterSet>(
"TurnOnParams")),
99 plotMakerL1Input(iConfig.getParameter<
ParameterSet>(
"PlotMakerL1Input")),
100 plotMakerRecoInput(iConfig.getParameter<
ParameterSet>(
"PlotMakerRecoInput")),
101 muonTag_(iConfig.getParameter<edm::
InputTag>(
"muonTag")),
102 triggerTag_(iConfig.getParameter<edm::
InputTag>(
"triggerTag")),
103 processName_(iConfig.getParameter<std::string>(
"hltConfigName")),
104 triggerName_(iConfig.getParameter<std::string>(
"triggerName"))
122 LogDebug(
"TriggerValidator") <<
"constructor...." ;
126 LogInfo(
"TriggerValidator") <<
"unabel to get DQMStore service?";
168 vector<bool> eventRecoSelected, eventMcSelected;
171 for(
unsigned int i=0;
i<eventRecoSelected.size(); ++
i) eventRecoSelected[
i] =
myRecoSelector[
i]->isSelected(iEvent);
172 for(
unsigned int i=0;
i<eventMcSelected.size(); ++
i) eventMcSelected[
i] =
mcFlag ?
myMcSelector[
i]->isSelected(iEvent) :
false;
184 if (!L1GTRR.isValid()) {
edm::LogWarning(
"Readout Error|L1") <<
"L1ParticleMapCollection Not Valid!";}
185 int nL1size = L1GTRR->decisionWord().size();
195 vCorrL1.resize(L1GTRR->decisionWord().size());
196 for(
unsigned int i=0; i<L1GTRR->decisionWord().size(); i++) {
vCorrL1[
i].resize(L1GTRR->decisionWord().size());}
198 for(
unsigned int i=0; i<L1GTRR->decisionWord().size(); i++) {
vCorrNormL1[
i].resize(L1GTRR->decisionWord().size());}
208 const std::vector<L1GlobalTriggerObjectMap>& objMapVec =
209 gtObjectMapRecord->gtObjectMap();
210 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin();
211 itMap != objMapVec.end(); ++itMap) {
212 int algoBit = (*itMap).algoBitNumber();
213 std::string algoNameStr = (*itMap).algoName();
217 l1Names_.resize(L1GTRR->decisionWord().size()+1);
218 for (
unsigned int i=0; i!=L1GTRR->decisionWord().size(); i++) {
221 l1Names_[L1GTRR->decisionWord().size()] =
"Total";
224 for(
unsigned int i=0; i<
l1Names_.size(); ++
i) {
232 for (
int i=0; i<nL1size; ++
i) {
233 l1bits.push_back(L1GTRR->decisionWord()[
i]);
234 if(L1GTRR->decisionWord()[
i]) {
238 for(
unsigned int j=0;
j<eventRecoSelected.size(); ++
j)
239 if(eventRecoSelected[
j]) {
244 for(
unsigned int j=0; j<eventMcSelected.size(); ++
j)
245 if(eventMcSelected[j]) {
254 for(
int i=0; i<nL1size; ++
i) {
255 for(
int j=0;
j<nL1size; ++
j) {
264 for(
unsigned int i=0; i<eventRecoSelected.size(); ++
i)
265 if(eventRecoSelected[i]) {
270 for(
unsigned int i=0; i<eventMcSelected.size(); ++
i)
271 if(eventMcSelected[i]) {
283 if( ! trhv.isValid() ) {
308 for(
unsigned int i=0; i<trhv->size(); i++) {
vCorrHlt[
i].resize(trhv->size());}
310 for(
unsigned int i=0; i<trhv->size(); i++) {
vCorrNormHlt[
i].resize(trhv->size());}
319 for (
unsigned int i=0; i<
hlNames_.size(); ++
i) {
327 for(
unsigned int i=0; i< trhv->size(); i++) {
328 hltbits.push_back(trhv->at(i).accept());
329 if(trhv->at(i).accept()) {
333 for(
unsigned int j=0;
j<eventRecoSelected.size(); ++
j)
334 if(eventRecoSelected[
j]) {
339 for(
unsigned int j=0; j<eventMcSelected.size(); ++
j)
340 if(eventMcSelected[j]) {
349 for(
unsigned int i=0; i< trhv->size(); i++) {
350 for(
unsigned int j=0;
j< trhv->size();
j++) {
365 for(
unsigned int i=0; i<eventRecoSelected.size(); ++
i)
366 if(eventRecoSelected[i]) {
371 for(
unsigned int i=0; i<eventMcSelected.size(); ++
i)
372 if(eventMcSelected[i]) {
499 char histo_name[256], histo_title[256];
501 sprintf(histo_name,
"L1Bits_%s", path_name.c_str());
502 sprintf(histo_title,
"L1 Trigger Bits for %s Selection", path_name.c_str());
506 sprintf(histo_name,
"HltBits_%s", path_name.c_str());
507 sprintf(histo_title,
"HL Trigger Bits for %s Selection", path_name.c_str());
513 char histo_name[256], histo_title[256];
515 sprintf(histo_name,
"L1Bits_%s", path_name.c_str());
516 sprintf(histo_title,
"L1 Trigger Bits for %s Selection", path_name.c_str());
520 sprintf(histo_name,
"HltBits_%s", path_name.c_str());
521 sprintf(histo_title,
"HL Trigger Bits for %s Selection", path_name.c_str());
540 char histo_name[256];
542 sprintf(histo_name,
"L1Paths_%s", path_name.c_str());
547 sprintf(histo_name,
"HltPaths_%s", path_name.c_str());
555 char histo_name[256];
557 sprintf(histo_name,
"L1Paths_%s", path_name.c_str());
562 sprintf(histo_name,
"HltPaths_%s", path_name.c_str());
660 << right << setw(10) <<
"L1T Bit#" <<
" "
662 for (
unsigned int i=0;
i!=
n;
i++) {
671 << right << setw(10) <<
"HLT Bit#" <<
" "
674 for (
unsigned int i=0;
i!=
n;
i++) {
849 LogInfo(
"TriggerValidator") <<
"endJob";
unsigned int size() const
number of trigger paths in trigger table
std::vector< MonitorElement * > hHltBitsAfterRecoCuts
void dump(const std::string &what) const
Dumping config info to cout.
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::vector< double > > vCorrNormL1
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
std::vector< McSelector * > myMcSelector
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
std::vector< MonitorElement * > hL1PathsAfterRecoCuts
void endRun(const edm::Run &run, const edm::EventSetup &c)
std::vector< MonitorElement * > hHltPathsAfterRecoCuts
#define DEFINE_FWK_MODULE(type)
std::vector< ParameterSet > VParameterSet
std::vector< int > numTotHltBitsBeforeCuts
std::vector< MonitorElement * > hHltPathsAfterMcCuts
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MuonAnalyzerSBSM * myMuonAnalyzer
void fillPlots(const edm::Event &)
PlotMakerReco * myPlotMakerReco
std::vector< std::string > l1Names_
void FillPlots(const edm::Event &, const edm::EventSetup &)
Strings const & triggerNames() const
std::vector< MonitorElement * > hL1BitsAfterMcCuts
std::vector< std::vector< int > > vCorrL1
std::vector< int > nEvRecoSelected
std::vector< std::vector< int > > numTotHltBitsAfterMcCuts
std::vector< MonitorElement * > hL1PathsAfterMcCuts
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
std::vector< MonitorElement * > hL1BitsAfterRecoCuts
std::vector< int > nEvMcSelected
std::vector< RecoSelector * > myRecoSelector
MonitorElement * hHltPathsBeforeCuts
void bookHistos(DQMStore *, std::vector< int > *, std::vector< int > *, std::vector< std::string > *, std::vector< std::string > *)
void addParameter(std::string const &name, T const &value)
void fillPlots(const edm::Event &)
void beginRun(const edm::Run &run, const edm::EventSetup &c)
std::string recoSelBitsDir
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
edm::InputTag triggerTag_
void setVerbose(unsigned level)
PlotMakerL1 * myPlotMakerL1
MonitorElement * hL1PathsBeforeCuts
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::string triggerBitsDir
std::vector< std::string > hlNames_
std::vector< std::vector< double > > vCorrNormHlt
std::vector< int > numTotL1BitsBeforeCuts
void bookHistos(DQMStore *, std::vector< int > *, std::vector< int > *, std::vector< std::string > *, std::vector< std::string > *)
std::vector< int > l1bits
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
TH1F * getTH1F(void) const
std::vector< MonitorElement * > hHltBitsAfterMcCuts
std::vector< int > hltbits
std::vector< std::vector< int > > numTotHltBitsAfterRecoCuts
std::vector< edm::ParameterSet > reco_parametersets
edm::ParameterSet plotMakerRecoInput
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< std::vector< int > > numTotL1BitsAfterRecoCuts
HLTConfigProvider hltConfig_
std::vector< std::vector< int > > vCorrHlt
edm::ParameterSet plotMakerL1Input
void InitializePlots(DQMStore *, const std::string)
MonitorElement * hL1BitsBeforeCuts
std::vector< std::vector< int > > numTotL1BitsAfterMcCuts
TriggerValidator(const edm::ParameterSet &)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * hHltBitsBeforeCuts
std::map< int, std::string > l1NameMap
std::vector< edm::ParameterSet > mc_parametersets