56 input_dir =
"L1T/L1THCALTPGXAna/";
71 LogInfo(
"TriggerDQM")<<
"[TriggerDQM]: ending... ";
84 LogInfo(
"TriggerDQM")<<
"[TriggerDQM]: Begin Job";
112 for (
int i=0;
i < 56;
i++)
114 char hname[20],htitle[20];
117 if (
i<28) ieta =
i-28;
119 sprintf(dirname,
"%sEffByChannel/EtaTower%d",
output_dir.c_str(),ieta);
120 dbe->setCurrentFolder(dirname);
121 for (
int j=0;
j < 72;
j++)
124 if (
i<28) ieta =
i-28;
126 sprintf(hname,
"eff_%d_%d",ieta,iphi);
127 sprintf(htitle,
"Eff <%d,%d>",ieta,iphi);
132 for (
int i=0;
i < 8;
i++)
134 char hname[20],htitle[20];
137 if (
i<4) ieta =
i-32;
139 sprintf(dirname,
"%sEffByChannel/EtaTower%d",
output_dir.c_str(),ieta);
140 dbe->setCurrentFolder(dirname);
141 for (
int j=0;
j < 18;
j++)
144 if (
i<4) ieta =
i-32;
146 sprintf(hname,
"eff_%d_%d",ieta,iphi);
147 sprintf(htitle,
"Eff <%d,%d>",ieta,iphi);
158 LogInfo(
"TriggerDQM")<<
"[TriggerDQM]: endJob";
173 TF1 *turnon =
new TF1(
"turnon",
"[0]*0.5*(TMath::Erf((x -[1])*0.5/[2])+1.)",0,30);
178 TH1F *hcalEff_num = this->get1DHisto(input_dir+
"HcalTP1",dbe);
179 if (!hcalEff_num)
std::cout <<
"numerator not found\n";
180 TH1F *hcalEff_den = this->get1DHisto(input_dir+
"HcalAll1",dbe);
181 if (!hcalEff_den)
std::cout <<
"denominator not found\n";
184 calcEff(hcalEff_num, hcalEff_den, hcalEff_1_);
185 if (hcalEff_num->GetEntries() > minEventsforFit &&
nevents%1000 == 0)
187 eff_histo = this->get1DHisto(
output_dir+
"HcalEff1",dbe);
188 turnon->SetParameter(0,1);
189 turnon->SetParameter(1,2);
190 turnon->SetParameter(2,6);
191 eff_histo->Fit(
"turnon",
"LL,E");
193 hcalEff_num = this->get1DHisto(input_dir+
"HcalTP2",dbe);
194 if (!hcalEff_num)
std::cout <<
"numerator not found\n";
195 hcalEff_den = this->get1DHisto(input_dir+
"HcalAll2",dbe);
196 if (!hcalEff_den)
std::cout <<
"denominator not found\n";
199 calcEff(hcalEff_num, hcalEff_den, hcalEff_2_);
200 if (hcalEff_num->GetEntries() > minEventsforFit &&
nevents%1000 == 0)
202 eff_histo = this->get1DHisto(
output_dir+
"HcalEff2",dbe);
203 turnon->SetParameter(0,1);
204 turnon->SetParameter(1,2);
205 turnon->SetParameter(2,6);
206 eff_histo->Fit(
"turnon",
"LL,E");
208 hcalEff_num = this->get1DHisto(input_dir+
"HcalTP3",dbe);
209 if (!hcalEff_num)
std::cout <<
"numerator not found\n";
210 hcalEff_den = this->get1DHisto(input_dir+
"HcalAll3",dbe);
211 if (!hcalEff_den)
std::cout <<
"denominator not found\n";
214 calcEff(hcalEff_num, hcalEff_den, hcalEff_3_);
215 if (hcalEff_num->GetEntries() > minEventsforFit &&
nevents%1000 == 0)
217 eff_histo = this->get1DHisto(
output_dir+
"HcalEff3",dbe);
218 turnon->SetParameter(0,1);
219 turnon->SetParameter(1,3);
220 turnon->SetParameter(2,6);
221 eff_histo->Fit(
"turnon",
"LL,E");
223 hcalEff_num = this->get1DHisto(input_dir+
"HcalTP4",dbe);
224 if (!hcalEff_num)
std::cout <<
"numerator not found\n";
225 hcalEff_den = this->get1DHisto(input_dir+
"HcalAll4",dbe);
226 if (!hcalEff_den)
std::cout <<
"denominator not found\n";
229 calcEff(hcalEff_num, hcalEff_den, hcalEff_4_);
230 if (hcalEff_num->GetEntries() > minEventsforFit &&
nevents%1000 == 0)
232 eff_histo = this->get1DHisto(
output_dir+
"HcalEff4",dbe);
233 turnon->SetParameter(0,1);
234 turnon->SetParameter(1,1);
235 turnon->SetParameter(2,6);
236 eff_histo->Fit(
"turnon",
"LL,E");
243 for (
int i=0;
i < 56;
i++)
245 char hname[20],htitle[30];
248 for (
int j=0;
j < 72;
j++)
251 if (
i<28) ieta =
i-28;
253 sprintf(hname,
"eff_%d_%d",ieta,iphi);
254 sprintf(htitle,
"Eff <%d,%d>",ieta,iphi);
256 sprintf(subdirname,
"%sEffByChannel/EtaTower%d/",input_dir.c_str(),ieta);
257 hcalEff_num = this->get1DHisto((
string)subdirname+(
string)hname+
"_num",dbe);
258 hcalEff_den = this->get1DHisto((
string)subdirname+(
string)hname+
"_den",dbe);
259 if (!hcalEff_num)
std::cout <<(string)subdirname+(
string)hname+
"_num" <<
"numerator not found\n";
260 if (!hcalEff_num)
std::cout <<
"numerator not found\n";
261 if (!hcalEff_den)
std::cout <<
"denominator not found\n";
262 calcEff(hcalEff_num, hcalEff_den, hcalEff_HBHE[
i][
j]);
264 if (hcalEff_num->GetEntries() > minEventsforFit &&
nevents%1000 == 0)
266 sprintf(subdirname,
"%sEffByChannel/EtaTower%d/",
output_dir.c_str(),ieta);
267 eff_histo = this->get1DHisto((
string)subdirname+(
string)hname,dbe);
268 turnon->SetParameter(0,1);
269 turnon->SetParameter(1,3);
270 turnon->SetParameter(2,6);
271 eff_histo->Fit(
"turnon",
"LL,E");
272 plateau = turnon->GetParameter(0);
274 width = turnon->GetParameter(2);
275 hcalPlateau_->Fill(ieta,iphi,plateau);
276 hcalThreshold_->Fill(ieta,iphi,
threshold);
277 hcalWidth_->Fill(ieta,iphi,
width);
282 for (
int i=0;
i < 8;
i++)
284 char hname[20],htitle[30];
287 for (
int j=0;
j < 18;
j++)
290 if (
i<4) ieta =
i-32;
292 sprintf(hname,
"eff_%d_%d",ieta,iphi);
293 sprintf(htitle,
"Eff <%d,%d>",ieta,iphi);
295 sprintf(subdirname,
"%sEffByChannel/EtaTower%d/",input_dir.c_str(),ieta);
296 hcalEff_num = this->get1DHisto((
string)subdirname+(
string)hname+
"_num",dbe);
297 hcalEff_den = this->get1DHisto((
string)subdirname+(
string)hname+
"_den",dbe);
298 if (!hcalEff_num)
std::cout <<(string)subdirname+(
string)hname+
"_num" <<
"numerator not found\n";
299 if (!hcalEff_den)
std::cout <<
"denominator not found\n";
300 calcEff(hcalEff_num, hcalEff_den, hcalEff_HF[
i][
j]);
301 if (hcalEff_num->GetEntries() > minEventsforFit &&
nevents%1000 == 0)
303 sprintf(subdirname,
"%sEffByChannel/EtaTower%d/",
output_dir.c_str(),ieta);
304 eff_histo = this->get1DHisto((
string)subdirname+(
string)hname,dbe);
305 turnon->SetParameter(0,1);
306 turnon->SetParameter(1,1);
307 turnon->SetParameter(2,6);
308 eff_histo->Fit(
"turnon",
"LL,E");
309 plateau = turnon->GetParameter(0);
311 width = turnon->GetParameter(2);
312 hcalPlateau_->Fill(ieta,iphi,plateau);
313 hcalThreshold_->Fill(ieta,iphi,
threshold);
314 hcalWidth_->Fill(ieta,iphi,
width);
323 if (num->GetNbinsX() != den->GetNbinsX())
325 std::cout <<
"numerator and denominator do not have the same number of bins!\n";
329 for (
int bin = 0;
bin <= num->GetNbinsX();
bin++)
331 if (den->GetBinContent(
bin) != 0) eff = num->GetBinContent(
bin)/den->GetBinContent(
bin);
345 TH1F * meHisto =
NULL;
353 LogInfo(
"TriggerDQM") <<
"ME " << meName <<
" NOT FOUND!";
367 TH2F * meHisto =
NULL;
375 LogInfo(
"TriggerDQM") <<
"ME NOT FOUND.";
const unsigned int RTPBINS
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
void calcEff(TH1F *num, TH1F *den, MonitorElement *me)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const unsigned int TPPHIBINS
TH2F * get2DHisto(std::string meName, DQMStore *dbi)
const unsigned int tvsrecbins
const unsigned int TPETABINS
const unsigned int ratiobins
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
virtual void beginJob(void)
const unsigned int effBins
TH1F * getTH1F(void) const
TH1F * get1DHisto(std::string meName, DQMStore *dbi)
const unsigned int effcombo
TH2F * getTH2F(void) const
L1THcalClient(const edm::ParameterSet &)