45 EcalLaserAPDPNRatiosRefEBMap()
55 Base::setSingleIov(
true);
59 bool fill()
override {
60 auto tag = PlotBase::getTag<0>();
61 for (
auto const& iov :
tag.iovs) {
62 std::shared_ptr<EcalLaserAPDPNRatiosRef>
payload = Base::fetchPayload(std::get<1>(iov));
65 if (
payload->barrelItems().empty())
69 fillWithValue(
iphi, 0, 1);
76 if (value_ptr ==
payload->end())
100 EcalLaserAPDPNRatiosRefEEMap()
110 Base::setSingleIov(
true);
113 bool fill()
override {
114 auto tag = PlotBase::getTag<0>();
115 for (
auto const& iov :
tag.iovs) {
116 std::shared_ptr<EcalLaserAPDPNRatiosRef>
payload = Base::fetchPayload(std::get<1>(iov));
118 if (
payload->endcapItems().empty())
124 fillWithValue(
ix,
iy, 0);
130 if (value_ptr ==
payload->end())
135 if (myEEId.zside() == -1)
136 fillWithValue(myEEId.ix(), myEEId.iy(),
weight);
138 fillWithValue(myEEId.ix() +
IX_MAX + EEhistSplit, myEEId.iy(),
weight);
153 EcalLaserAPDPNRatiosRefPlot()
158 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
166 auto iov = iovs.front();
167 std::shared_ptr<EcalLaserAPDPNRatiosRef>
payload = fetchPayload(std::get<1>(iov));
168 unsigned int run = std::get<0>(iov);
171 if (
payload->barrelItems().empty())
174 fillEBMap_SingleIOV<EcalLaserAPDPNRatiosRef>(
payload,
barrel);
176 if (
payload->endcapItems().empty())
179 fillEEMap_SingleIOV<EcalLaserAPDPNRatiosRef>(
payload, endc_m, endc_p);
183 gStyle->SetPalette(1);
184 gStyle->SetOptStat(0);
185 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
189 t1.SetTextSize(0.04);
190 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Laser APDPN Ratios Ref, IOV %i",
run));
192 float xmi[3] = {0.0, 0.24, 0.76};
193 float xma[3] = {0.24, 0.76, 1.00};
194 std::array<std::unique_ptr<TPad>, 3> pad;
196 pad[
obj] = std::make_unique<TPad>(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
211 canvas.SaveAs(ImageName.c_str());
219 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags,
int method>
222 EcalLaserAPDPNRatiosRefBase()
224 "Ecal Laser APDPN Ratios Ref difference ") {}
226 bool fill()
override {
233 float pEBmin, pEEmin, pEBmax, pEEmax;
242 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
243 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
244 auto firstiov = iovs.front();
245 run[0] = std::get<0>(firstiov);
246 std::tuple<cond::Time_t, cond::Hash> lastiov;
248 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
249 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
250 lastiov = tag2iovs.front();
252 lastiov = iovs.back();
253 l_tagname[1] = l_tagname[0];
255 run[1] = std::get<0>(lastiov);
257 for (
int irun = 0; irun < nIOVs; irun++) {
258 std::shared_ptr<EcalLaserAPDPNRatiosRef>
payload;
260 payload = this->fetchPayload(std::get<1>(firstiov));
262 payload = this->fetchPayload(std::get<1>(lastiov));
265 if (!
payload->barrelItems().empty())
266 fillEBMap_TwoIOVs<EcalLaserAPDPNRatiosRef>(
payload,
barrel, irun, pEB, pEBmin, pEBmax,
method);
267 if (!
payload->endcapItems().empty())
268 fillEEMap_TwoIOVs<EcalLaserAPDPNRatiosRef>(
payload, endc_m, endc_p, irun, pEE, pEEmin, pEEmax,
method);
272 gStyle->SetPalette(1);
273 gStyle->SetOptStat(0);
274 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
278 t1.SetTextSize(0.04);
279 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Laser APDPN Ratios Ref Diff, IOV %i - %i",
run[1],
run[0]));
281 float xmi[3] = {0.0, 0.24, 0.76};
282 float xma[3] = {0.24, 0.76, 1.00};
283 std::array<std::unique_ptr<TPad>, 3> pad;
286 pad[
obj] = std::make_unique<TPad>(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
291 DrawEE(endc_m, pEEmin, pEEmax);
295 DrawEE(endc_p, pEEmin, pEEmax);
298 canvas.SaveAs(ImageName.c_str());
302 using EcalLaserAPDPNRatiosRefDiffOneTag = EcalLaserAPDPNRatiosRefBase<cond::payloadInspector::SINGLE_IOV, 1, 0>;
303 using EcalLaserAPDPNRatiosRefDiffTwoTags = EcalLaserAPDPNRatiosRefBase<cond::payloadInspector::SINGLE_IOV, 2, 0>;
304 using EcalLaserAPDPNRatiosRefRatioOneTag = EcalLaserAPDPNRatiosRefBase<cond::payloadInspector::SINGLE_IOV, 1, 1>;
305 using EcalLaserAPDPNRatiosRefRatioTwoTags = EcalLaserAPDPNRatiosRefBase<cond::payloadInspector::SINGLE_IOV, 2, 1>;
312 EcalLaserAPDPNRatiosRefSummaryPlot()
317 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
318 auto iov = iovs.front();
319 std::shared_ptr<EcalLaserAPDPNRatiosRef>
payload = fetchPayload(std::get<1>(iov));
320 unsigned int run = std::get<0>(iov);
326 align =
new TH2F(
"",
"", 0, 0, 0, 0, 0, 0);
328 float mean_x_EB = 0.0f;
329 float mean_x_EE = 0.0f;
337 payload->summary(mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
339 align,
"Ecal Laser APDPN Ratios Ref", mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
344 gStyle->SetPalette(1);
345 gStyle->SetOptStat(0);
346 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
350 t1.SetTextSize(0.04);
352 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Laser APDPN Ratios Ref Summary, IOV %i",
run));
354 TPad pad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
362 canvas.SaveAs(ImageName.c_str());
void fillTableWithSummary(TH2F *&align, std::string title, const float &mean_x_EB, const float &rms_EB, const int &num_x_EB, const float &mean_x_EE, const float &rms_EE, const int &num_x_EE)
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)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
std::vector< Item >::const_iterator const_iterator
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
void drawTable(int nbRows, int nbColumns)