45 EcalIntercalibConstantsEBMap()
55 Base::setSingleIov(
true);
59 bool fill()
override {
60 auto tag = PlotBase::getTag<0>();
61 for (
auto const& iov :
tag.iovs) {
65 if (
payload->barrelItems().empty())
76 if (value_ptr ==
payload->end())
95 EcalIntercalibConstantsEEMap()
105 Base::setSingleIov(
true);
108 bool fill()
override {
109 auto tag = PlotBase::getTag<0>();
110 for (
auto const& iov :
tag.iovs) {
113 if (
payload->endcapItems().empty())
125 if (value_ptr ==
payload->end())
129 if (myEEId.zside() == -1)
146 EcalIntercalibConstantsPlot()
151 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
156 auto iov = iovs.front();
158 unsigned int run = std::get<0>(iov);
161 if (
payload->barrelItems().empty())
164 fillEBMap_SingleIOV<EcalIntercalibConstants>(
payload,
barrel);
166 if (
payload->endcapItems().empty())
169 fillEEMap_SingleIOV<EcalIntercalibConstants>(
payload, endc_m, endc_p);
173 gStyle->SetPalette(1);
174 gStyle->SetOptStat(0);
175 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
179 t1.SetTextSize(0.05);
180 t1.DrawLatex(0.5, 0.96, Form(
"Ecal IntercalibConstants, IOV %i",
run));
182 float xmi[3] = {0.0, 0.24, 0.76};
183 float xma[3] = {0.24, 0.76, 1.00};
184 std::array<std::unique_ptr<TPad>, 3> pad;
186 pad[
obj] = std::make_unique<TPad>(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
201 canvas.SaveAs(ImageName.c_str());
209 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags,
int method>
212 EcalIntercalibConstantsBase()
214 "ECAL Intercalib Constants comparison") {}
216 bool fill()
override {
220 float pEBmin, pEEmin, pEBmax, pEEmax;
229 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
230 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
231 auto firstiov = iovs.front();
232 run[0] = std::get<0>(firstiov);
233 std::tuple<cond::Time_t, cond::Hash> lastiov;
235 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
236 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
237 lastiov = tag2iovs.front();
239 lastiov = iovs.back();
240 l_tagname[1] = l_tagname[0];
242 run[1] = std::get<0>(lastiov);
243 for (
int irun = 0; irun < nIOVs; irun++) {
244 std::shared_ptr<EcalIntercalibConstants>
payload;
251 if (
payload->barrelItems().empty())
253 fillEBMap_TwoIOVs<EcalIntercalibConstants>(
payload,
barrel, irun, pEB, pEBmin, pEBmax,
method);
255 if (
payload->endcapItems().empty())
257 fillEEMap_TwoIOVs<EcalIntercalibConstants>(
payload, endc_m, endc_p, irun, pEE, pEEmin, pEEmax,
method);
261 gStyle->SetPalette(1);
262 gStyle->SetOptStat(0);
263 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
267 int len = l_tagname[0].length() + l_tagname[1].length();
271 t1.SetTextSize(0.05);
274 Form(
"%s IOV %i %s %s IOV %i",
275 l_tagname[1].c_str(),
278 l_tagname[0].c_str(),
281 t1.SetTextSize(0.05);
282 t1.DrawLatex(0.5, 0.96, Form(
"Ecal IntercalibConstants, IOV %i %s %i",
run[1],
dr[
method].c_str(),
run[0]));
285 t1.SetTextSize(0.05);
286 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]));
288 float xmi[3] = {0.0, 0.24, 0.76};
289 float xma[3] = {0.24, 0.76, 1.00};
290 std::array<std::unique_ptr<TPad>, 3> pad;
292 pad[
obj] = std::make_unique<TPad>(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
296 DrawEE(endc_m, pEEmin, pEEmax);
300 DrawEE(endc_p, pEEmin, pEEmax);
303 canvas.SaveAs(ImageName.c_str());
307 using EcalIntercalibConstantsDiffOneTag = EcalIntercalibConstantsBase<cond::payloadInspector::SINGLE_IOV, 1, 0>;
308 using EcalIntercalibConstantsDiffTwoTags = EcalIntercalibConstantsBase<cond::payloadInspector::SINGLE_IOV, 2, 0>;
309 using EcalIntercalibConstantsRatioOneTag = EcalIntercalibConstantsBase<cond::payloadInspector::SINGLE_IOV, 1, 1>;
310 using EcalIntercalibConstantsRatioTwoTags = EcalIntercalibConstantsBase<cond::payloadInspector::SINGLE_IOV, 2, 1>;
317 EcalIntercalibConstantsSummaryPlot()
322 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
323 auto iov = iovs.front();
325 unsigned int run = std::get<0>(iov);
331 align =
new TH2F(
"",
"", 0, 0, 0, 0, 0, 0);
333 float mean_x_EB = 0.0f;
334 float mean_x_EE = 0.0f;
342 payload->summary(mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
344 align,
"Ecal Intercalib Constants", mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
348 gStyle->SetPalette(1);
349 gStyle->SetOptStat(0);
350 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
354 t1.SetTextSize(0.04);
356 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Intercalib Constants Summary, IOV %i",
run));
358 TPad pad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
362 TLine*
l =
new TLine;
368 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)
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)
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
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
void drawTable(int nbRows, int nbColumns)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)