46 EcalLaserAPDPNRatiosEBMap()
56 Base::setSingleIov(
true);
60 bool fill()
override {
61 auto tag = PlotBase::getTag<0>();
62 for (
auto const& iov :
tag.iovs) {
87 EcalLaserAPDPNRatiosEEMap()
97 Base::setSingleIov(
true);
100 bool fill()
override {
101 auto tag = PlotBase::getTag<0>();
102 for (
auto const& iov :
tag.iovs) {
116 if (myEEId.zside() == -1)
132 EcalLaserAPDPNRatiosPlot()
137 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
138 TH2F**
barrel =
new TH2F*[3];
139 TH2F** endc_p =
new TH2F*[3];
140 TH2F** endc_m =
new TH2F*[3];
141 float pEBmin[3], pEEmin[3];
143 for (
int i = 0;
i < 3;
i++) {
154 auto iov = iovs.front();
156 unsigned long IOV = std::get<0>(iov);
158 if (IOV < 4294967296)
159 run = std::get<0>(iov);
201 if (myEEId.zside() == 1) {
202 endc_p[0]->Fill(myEEId.ix(), myEEId.iy(),
p1);
203 endc_p[1]->Fill(myEEId.ix(), myEEId.iy(),
p2);
204 endc_p[2]->Fill(myEEId.ix(), myEEId.iy(),
p3);
206 endc_m[0]->Fill(myEEId.ix(), myEEId.iy(),
p1);
207 endc_m[1]->Fill(myEEId.ix(), myEEId.iy(),
p2);
208 endc_m[2]->Fill(myEEId.ix(), myEEId.iy(),
p3);
215 gStyle->SetPalette(1);
216 gStyle->SetOptStat(0);
217 TCanvas
canvas(
"CC map",
"CC map", 2800, 2600);
221 t1.SetTextSize(0.05);
222 if (IOV < 4294967296)
223 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Laser APD/PN, IOV %i",
run));
228 localtime_r(&
t, <);
229 strftime(
buf,
sizeof(
buf),
"%F %R:%S", <);
231 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Laser APD/PN, IOV %s",
buf));
234 float xmi[3] = {0.0, 0.26, 0.74};
235 float xma[3] = {0.26, 0.74, 1.00};
236 TPad*** pad =
new TPad**[3];
237 for (
int i = 0;
i < 3;
i++) {
238 pad[
i] =
new TPad*[3];
240 float yma = 0.94 - (0.32 *
i);
241 float ymi = yma - 0.28;
242 pad[
i][
obj] =
new TPad(Form(
"p_%i_%i",
obj,
i), Form(
"p_%i_%i",
obj,
i), xmi[
obj], ymi, xma[
obj], yma);
247 for (
int i = 0;
i < 3;
i++) {
250 float xmin = pEBmin[
i] * 10.;
254 xmin = pEEmin[
i] * 10.;
267 canvas.SaveAs(ImageName.c_str());
275 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags,
int method>
278 EcalLaserAPDPNRatiosBase()
281 bool fill()
override {
282 TH2F**
barrel =
new TH2F*[3];
283 TH2F** endc_p =
new TH2F*[3];
284 TH2F** endc_m =
new TH2F*[3];
285 float pEBmin[3], pEEmin[3], pEBmax[3], pEEmax[3];
286 for (
int i = 0;
i < 3;
i++) {
298 unsigned int run[2] = {0, 0};
300 unsigned long IOV = 0;
302 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
303 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
304 auto firstiov = iovs.front();
305 IOV = std::get<0>(firstiov);
306 if (IOV < 4294967296)
307 run[0] = std::get<0>(firstiov);
310 std::tuple<cond::Time_t, cond::Hash> lastiov;
312 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
313 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
314 lastiov = tag2iovs.front();
316 lastiov = iovs.back();
317 l_tagname[1] = l_tagname[0];
319 IOV = std::get<0>(lastiov);
320 if (IOV < 4294967296)
321 run[1] = std::get<0>(lastiov);
325 for (
int irun = 0; irun < nIOVs; irun++) {
326 std::shared_ptr<EcalLaserAPDPNRatios>
payload;
337 pEB[0][cellid] = (
payload->getLaserMap())[rawid].
p1;
338 pEB[1][cellid] = (
payload->getLaserMap())[rawid].
p2;
339 pEB[2][cellid] = (
payload->getLaserMap())[rawid].
p3;
349 dr = (
payload->getLaserMap())[rawid].
p1 - pEB[0][cellid];
351 if (pEB[0][cellid] == 0.) {
352 if ((
payload->getLaserMap())[rawid].
p1 == 0.)
357 dr = (
payload->getLaserMap())[rawid].
p1 / pEB[0][cellid];
365 dr = (
payload->getLaserMap())[rawid].
p2 - pEB[1][cellid];
367 if (pEB[1][cellid] == 0.) {
368 if ((
payload->getLaserMap())[rawid].
p2 == 0.)
373 dr = (
payload->getLaserMap())[rawid].
p2 / pEB[1][cellid];
381 dr = (
payload->getLaserMap())[rawid].
p3 - pEB[2][cellid];
383 if (pEB[2][cellid] == 0.) {
384 if ((
payload->getLaserMap())[rawid].
p3 == 0.)
389 dr = (
payload->getLaserMap())[rawid].
p3 / pEB[2][cellid];
406 pEE[0][cellid] = (
payload->getLaserMap())[rawid].
p1;
407 pEE[1][cellid] = (
payload->getLaserMap())[rawid].
p2;
408 pEE[2][cellid] = (
payload->getLaserMap())[rawid].
p3;
410 double dr1, dr2, dr3;
412 dr1 = (
payload->getLaserMap())[rawid].
p1 - pEE[0][cellid];
414 if (pEE[0][cellid] == 0.) {
415 if ((
payload->getLaserMap())[rawid].
p1 == 0.)
420 dr1 = (
payload->getLaserMap())[rawid].
p1 / pEE[0][cellid];
427 dr2 = (
payload->getLaserMap())[rawid].
p2 - pEE[1][cellid];
429 if (pEE[1][cellid] == 0.) {
430 if ((
payload->getLaserMap())[rawid].
p2 == 0.)
435 dr2 = (
payload->getLaserMap())[rawid].
p2 / pEE[1][cellid];
442 dr3 = (
payload->getLaserMap())[rawid].
p3 - pEE[2][cellid];
444 if (pEE[0][cellid] == 0.) {
445 if ((
payload->getLaserMap())[rawid].
p3 == 0.)
450 dr3 = (
payload->getLaserMap())[rawid].
p3 / pEE[2][cellid];
456 if (myEEId.zside() == 1) {
457 endc_p[0]->Fill(myEEId.ix(), myEEId.iy(), dr1);
458 endc_p[1]->Fill(myEEId.ix(), myEEId.iy(), dr2);
459 endc_p[2]->Fill(myEEId.ix(), myEEId.iy(), dr3);
461 endc_m[0]->Fill(myEEId.ix(), myEEId.iy(), dr1);
462 endc_m[1]->Fill(myEEId.ix(), myEEId.iy(), dr2);
463 endc_m[2]->Fill(myEEId.ix(), myEEId.iy(), dr3);
472 gStyle->SetPalette(1);
473 gStyle->SetOptStat(0);
474 TCanvas
canvas(
"CC map",
"CC map", 2800, 2600);
478 int len = l_tagname[0].length() + l_tagname[1].length();
480 if (IOV < 4294967296) {
483 t1.SetTextSize(0.02);
486 Form(
"%s IOV %i %s %s IOV %i",
487 l_tagname[1].c_str(),
490 l_tagname[0].c_str(),
493 t1.SetTextSize(0.03);
494 t1.DrawLatex(0.5, 0.96, Form(
"Ecal LaserAPDPNRatios, IOV %i %s %i",
run[1],
dr[
method].c_str(),
run[0]));
497 t1.SetTextSize(0.03);
498 t1.DrawLatex(0.5, 0.96, Form(
"%s, IOV %i %s %i", l_tagname[0].c_str(),
run[1],
dr[
method].c_str(),
run[0]));
502 char buf0[256], buf1[256];
504 localtime_r(&
t, <);
505 strftime(buf0,
sizeof(buf0),
"%F %R:%S", <);
506 buf0[
sizeof(buf0) - 1] = 0;
508 localtime_r(&
t, <);
509 strftime(buf1,
sizeof(buf1),
"%F %R:%S", <);
510 buf1[
sizeof(buf1) - 1] = 0;
513 t1.SetTextSize(0.02);
516 Form(
"%s IOV %i %s %s IOV %i",
517 l_tagname[1].c_str(),
520 l_tagname[0].c_str(),
523 t1.SetTextSize(0.03);
524 t1.DrawLatex(0.5, 0.96, Form(
"Ecal LaserAPDPNRatios, IOV %i %s %i",
run[1],
dr[
method].c_str(),
run[0]));
527 t1.SetTextSize(0.03);
528 t1.DrawLatex(0.5, 0.96, Form(
"%s, IOV %i %s %i", l_tagname[0].c_str(),
run[1],
dr[
method].c_str(),
run[0]));
531 float xmi[3] = {0.0, 0.24, 0.76};
532 float xma[3] = {0.24, 0.76, 1.00};
533 TPad*** pad =
new TPad**[3];
534 for (
int i = 0;
i < 3;
i++) {
535 pad[
i] =
new TPad*[3];
537 float yma = 0.94 - (0.32 *
i);
538 float ymi = yma - 0.28;
539 pad[
i][
obj] =
new TPad(Form(
"p_%i_%i",
obj,
i), Form(
"p_%i_%i",
obj,
i), xmi[
obj], ymi, xma[
obj], yma);
544 for (
int i = 0;
i < 3;
i++) {
547 float xmin = (pEBmin[
i] - 0.009) * 100.;
550 float xmax = (pEBmax[
i] + 0.009) * 100.;
554 xmin = (pEEmin[
i] + 0.009) * 100.;
557 xmax = (pEEmax[
i] + 0.009) * 100.;
563 endc_m[
i]->GetZaxis()->SetLabelSize(0.02);
568 endc_p[
i]->GetZaxis()->SetLabelSize(0.02);
572 canvas.SaveAs(ImageName.c_str());
576 using EcalLaserAPDPNRatiosDiffOneTag = EcalLaserAPDPNRatiosBase<cond::payloadInspector::SINGLE_IOV, 1, 0>;
577 using EcalLaserAPDPNRatiosDiffTwoTags = EcalLaserAPDPNRatiosBase<cond::payloadInspector::SINGLE_IOV, 2, 0>;
578 using EcalLaserAPDPNRatiosRatioOneTag = EcalLaserAPDPNRatiosBase<cond::payloadInspector::SINGLE_IOV, 1, 1>;
579 using EcalLaserAPDPNRatiosRatioTwoTags = EcalLaserAPDPNRatiosBase<cond::payloadInspector::SINGLE_IOV, 2, 1>;
void fillWithValue(float xvalue, float yvalue, float weight=1)
static EEDetId unhashIndex(int hi)
static bool validHashIndex(int i)
void DrawEE(TH2F *endc, float min, float max)
void DrawEB(TH2F *ebmap, float min, float max)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
static const int MIN_HASH
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)