28 EcalFloatCondObjectContainerPlot()
33 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
37 double EBmean = 0., EBrms = 0., EEmean = 0., EErms = 0.;
38 int EBtot = 0, EEtot = 0;
40 auto iov = iovs.front();
42 unsigned int run = std::get<0>(iov);
53 Double_t
phi = (Double_t)
iphi - 0.5;
55 double val = (*payload)[
id.rawId()];
57 EBmean = EBmean +
val;
64 int thesign =
sign == 1 ? 1 : -1;
70 double val = (*payload)[
id.rawId()];
71 EEmean = EEmean +
val;
82 double vt = (double)EBtot;
84 EBrms = EBrms / vt - (EBmean * EBmean);
88 double pEBmin = EBmean - kRMS * EBrms;
89 double pEBmax = EBmean + kRMS * EBrms;
93 EErms = EErms / vt - (EEmean * EEmean);
97 double pEEmin = EEmean - kRMS * EErms;
98 double pEEmax = EEmean + kRMS * EErms;
101 gStyle->SetPalette(1);
102 gStyle->SetOptStat(0);
103 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
107 t1.SetTextSize(0.05);
108 t1.DrawLatex(0.5, 0.96, Form(
"Ecal FloatCondObjectContainer, IOV %i",
run));
110 float xmi[3] = {0.0, 0.24, 0.76};
111 float xma[3] = {0.24, 0.76, 1.00};
112 TPad** pad =
new TPad*[3];
114 pad[
obj] =
new TPad(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
119 DrawEE(endc_m, pEEmin, pEEmax);
123 DrawEE(endc_p, pEEmin, pEEmax);
126 canvas.SaveAs(ImageName.c_str());
134 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
135 class EcalFloatCondObjectContainerDiffBase
138 EcalFloatCondObjectContainerDiffBase()
140 "ECAL FloatCondObjectContainer difference") {}
142 bool fill()
override {
146 double EBmean = 0., EBrms = 0., EEmean = 0., EErms = 0.;
147 int EBtot = 0, EEtot = 0;
152 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
153 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
154 auto firstiov = iovs.front();
155 run[0] = std::get<0>(firstiov);
156 std::tuple<cond::Time_t, cond::Hash> lastiov;
158 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
159 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
160 lastiov = tag2iovs.front();
162 lastiov = iovs.back();
163 l_tagname[1] = l_tagname[0];
165 run[1] = std::get<0>(lastiov);
166 for (
int irun = 0; irun < nIOVs; irun++) {
167 std::shared_ptr<EcalFloatCondObjectContainer>
payload;
183 Double_t
phi = (Double_t)
iphi - 0.5;
185 int channel =
id.hashedIndex();
186 double val = (*payload)[
id.rawId()];
190 double diff =
val - vEB[channel];
192 EBmean = EBmean +
diff;
201 int thesign =
sign == 1 ? 1 : -1;
207 int channel =
id.hashedIndex();
208 double val = (*payload)[
id.rawId()];
212 double diff =
val - vEE[channel];
213 EEmean = EEmean +
diff;
229 double vt = (double)EBtot;
230 EBmean = EBmean / vt;
231 EBrms = EBrms / vt - (EBmean * EBmean);
235 double pEBmin = EBmean - kRMS * EBrms;
236 double pEBmax = EBmean + kRMS * EBrms;
239 EEmean = EEmean / vt;
240 EErms = EErms / vt - (EEmean * EEmean);
244 double pEEmin = EEmean - kRMS * EErms;
245 double pEEmax = EEmean + kRMS * EErms;
248 gStyle->SetPalette(1);
249 gStyle->SetOptStat(0);
250 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
254 int len = l_tagname[0].length() + l_tagname[1].length();
255 if (ntags == 2 && len < 150) {
256 t1.SetTextSize(0.04);
258 0.5, 0.96, Form(
"%s IOV %i - %s IOV %i", l_tagname[1].c_str(),
run[1], l_tagname[0].c_str(),
run[0]));
260 t1.SetTextSize(0.05);
261 t1.DrawLatex(0.5, 0.96, Form(
"%s, IOV %i - %i", l_tagname[0].c_str(),
run[1],
run[0]));
263 float xmi[3] = {0.0, 0.24, 0.76};
264 float xma[3] = {0.24, 0.76, 1.00};
265 TPad** pad =
new TPad*[3];
267 pad[
obj] =
new TPad(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
272 DrawEE(endc_m, pEEmin, pEEmax);
276 DrawEE(endc_p, pEEmin, pEEmax);
279 canvas.SaveAs(ImageName.c_str());
283 using EcalFloatCondObjectContainerDiffOneTag =
284 EcalFloatCondObjectContainerDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
285 using EcalFloatCondObjectContainerDiffTwoTags =
286 EcalFloatCondObjectContainerDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
void DrawEE(TH2F *endc, float min, float max)
void DrawEB(TH2F *ebmap, float min, float max)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)