18 #include <TProfile2D.h>
30 LogInfo(
"TriggerDQM")<<
"[TriggerDQM]: ending... ";
43 monitorName_ = parameters_.getUntrackedParameter<
string>(
"monitorName",
"");
45 prescaleLS_ = parameters_.getUntrackedParameter<
int>(
"prescaleLS", -1);
47 prescaleEvt_ = parameters_.getUntrackedParameter<
int>(
"prescaleEvt", -1);
49 output_dir_ = parameters_.getUntrackedParameter<
string>(
"output_dir",
"");
51 input_dir_ = parameters_.getUntrackedParameter<
string>(
"input_dir",
"");
62 LogInfo(
"TriggerDQM")<<
"[TriggerDQM]: Begin Job";
71 dttpgphmapcorrf =
dbe_->
book2D(
"DT_TPG_phi_map_corr_frac",
72 "Fraction of correlated best triggers per station",20,1,21,12,0,12);
73 dttpgphmap2ndf =
dbe_->
book2D(
"DT_TPG_phi_map_2nd_frac",
74 "Fraction of second tracks per station",20,1,21,12,0,12);
75 dttpgphmapbxf[0] =
dbe_->
book2D(
"DT_TPG_phi_map_bx-1_frac",
76 "Fraction of triggers per station (BX=-1)",20,1,21,12,0,12);
77 dttpgphmapbxf[1] =
dbe_->
book2D(
"DT_TPG_phi_map_bx0_frac",
78 "Fraction of triggers per station (BX=0)",20,1,21,12,0,12);
79 dttpgphmapbxf[2] =
dbe_->
book2D(
"DT_TPG_phi_map_bx+1_frac",
80 "Fraction of triggers per station (BX=1)",20,1,21,12,0,12);
81 setMapPhLabel(dttpgphmapcorrf);
82 setMapPhLabel(dttpgphmap2ndf);
83 setMapPhLabel(dttpgphmapbxf[0]);
84 setMapPhLabel(dttpgphmapbxf[1]);
85 setMapPhLabel(dttpgphmapbxf[2]);
87 dttpgthmaphf =
dbe_->
book2D(
"DT_TPG_theta_map_corr_frac",
88 "Fraction of H quality best triggers per station",15,1,16,12,0,12);
89 dttpgthmapbxf[0] =
dbe_->
book2D(
"DT_TPG_theta_map_bx-1_frac",
90 "Fraction of triggers per station (BX=-1)",15,1,16,12,0,12);
91 dttpgthmapbxf[1] =
dbe_->
book2D(
"DT_TPG_theta_map_bx0_frac",
92 "Fraction of triggers per station (BX=0)",15,1,16,12,0,12);
93 dttpgthmapbxf[2] =
dbe_->
book2D(
"DT_TPG_theta_map_bx+1_frac",
94 "Fraction of triggers per station (BX=1)",15,1,16,12,0,12);
95 setMapThLabel(dttpgthmaphf);
96 setMapThLabel(dttpgthmapbxf[0]);
97 setMapThLabel(dttpgthmapbxf[1]);
98 setMapThLabel(dttpgthmapbxf[2]);
123 if (prescaleEvt_<1)
return;
124 if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0)
return;
126 string nName =
"DT_TPG_phi_best_map_corr";
127 string dName =
"DT_TPG_phi_best_map";
128 makeRatioHisto(dttpgphmapcorrf,nName,dName);
129 dName =
"DT_TPG_phi_map";
130 nName =
"DT_TPG_phi_map_2nd";
131 makeRatioHisto(dttpgphmap2ndf,nName,dName);
132 nName =
"DT_TPG_phi_map_bx-1";
133 makeRatioHisto(dttpgphmapbxf[0],nName,dName);
134 nName =
"DT_TPG_phi_map_bx0";
135 makeRatioHisto(dttpgphmapbxf[1],nName,dName);
136 nName =
"DT_TPG_phi_map_bx+1";
137 makeRatioHisto(dttpgphmapbxf[2],nName,dName);
139 nName =
"DT_TPG_theta_best_map_h";
140 dName =
"DT_TPG_theta_best_map";
141 makeRatioHisto(dttpgthmaphf,nName,dName);
142 dName =
"DT_TPG_theta_map";
143 nName =
"DT_TPG_theta_map_bx-1";
144 makeRatioHisto(dttpgthmapbxf[0],nName,dName);
145 nName =
"DT_TPG_theta_map_bx0";
146 makeRatioHisto(dttpgthmapbxf[1],nName,dName);
147 nName =
"DT_TPG_theta_map_bx+1";
148 makeRatioHisto(dttpgthmapbxf[2],nName,dName);
167 denominator = this->get2DHisto(input_dir_+
"/"+dName,
dbe_);
168 numerator = this->get2DHisto(input_dir_+
"/"+nName,
dbe_);
170 if (numerator && denominator) {
172 TH2F * ratio = ratioME->
getTH2F();
174 ratio->Divide(numerator,denominator);
177 LogInfo(
"TriggerDQM") <<
"[TriggerDQM]: ratio histo named \"" << ratioME->
getName() <<
"\" not found!" << endl;
182 LogInfo(
"TriggerDQM") <<
"[TriggerDQM]: numerator histo \"" << nName <<
"\" not found!" << endl;
184 LogInfo(
"TriggerDQM") <<
"[TriggerDQM]: denominator histo \"" << dName <<
"\" not found!" << endl;
195 LogInfo(
"TriggerDQM") <<
"ME NOT FOUND.";
209 LogInfo(
"TriggerDQM") <<
"ME NOT FOUND.";
225 LogInfo(
"TriggerDQM") <<
"ME NOT FOUND.";
240 LogInfo(
"TriggerDQM") <<
"ME NOT FOUND.";
252 for(
int i=0;
i<5;
i++){
265 for(
int i=0;
i<5;
i++){
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
DQM Client Diagnostic.
const std::string & getName(void) const
get name of ME
void setMapThLabel(MonitorElement *me)
void makeRatioHisto(MonitorElement *ratioME, std::string &nName, std::string &dName)
TProfile2D * getTProfile2D(void) const
TProfile * get1DProfile(std::string meName, DQMStore *dbi)
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)
void analyze(const edm::Event &e, const edm::EventSetup &c)
Fake Analyze.
virtual ~L1TDTTPGClient()
Destructor.
TH2F * get2DHisto(std::string meName, DQMStore *dbi)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
TH1F * get1DHisto(std::string meName, DQMStore *dbi)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
L1TDTTPGClient(const edm::ParameterSet &ps)
Constructor.
TH1F * getTH1F(void) const
TProfile2D * get2DProfile(std::string meName, DQMStore *dbi)
TProfile * getTProfile(void) const
void setMapPhLabel(MonitorElement *me)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
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.
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void beginJob(void)
BeginJob.
void setCurrentFolder(const std::string &fullpath)