47 EcalPFRecHitThresholdsEBMap()
57 Base::setSingleIov(
true);
61 bool fill()
override {
62 auto tag = PlotBase::getTag<0>();
63 for (
auto const& iov :
tag.iovs) {
67 if (
payload->barrelItems().empty())
78 if (value_ptr ==
payload->end())
102 int EEhistSplit = 20;
105 EcalPFRecHitThresholdsEEMap()
115 Base::setSingleIov(
true);
118 bool fill()
override {
119 auto tag = PlotBase::getTag<0>();
120 for (
auto const& iov :
tag.iovs) {
123 if (
payload->endcapItems().empty())
135 if (value_ptr ==
payload->end())
140 if (myEEId.zside() == -1)
158 EcalPFRecHitThresholdsPlot()
163 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
168 auto iov = iovs.front();
170 unsigned int run = std::get<0>(iov);
173 if (
payload->barrelItems().empty())
176 fillEBMap_SingleIOV<EcalPFRecHitThresholds>(
payload,
barrel);
178 if (
payload->endcapItems().empty())
181 fillEEMap_SingleIOV<EcalPFRecHitThresholds>(
payload, endc_m, endc_p);
185 gStyle->SetPalette(1);
186 gStyle->SetOptStat(0);
187 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
191 t1.SetTextSize(0.05);
192 t1.DrawLatex(0.5, 0.96, Form(
"Ecal PFRec Hit Thresholds, IOV %i",
run));
194 float xmi[3] = {0.0, 0.24, 0.76};
195 float xma[3] = {0.24, 0.76, 1.00};
196 std::array<std::unique_ptr<TPad>, 3> pad;
198 pad[
obj] = std::make_unique<TPad>(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
213 canvas.SaveAs(ImageName.c_str());
221 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags,
int method>
224 EcalPFRecHitThresholdsBase()
226 "Ecal PFRec Hit Thresholds comparison") {}
228 bool fill()
override {
232 float pEBmin, pEEmin, pEBmax, pEEmax;
241 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
242 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
243 auto firstiov = iovs.front();
244 run[0] = std::get<0>(firstiov);
245 std::tuple<cond::Time_t, cond::Hash> lastiov;
247 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
248 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
249 lastiov = tag2iovs.front();
251 lastiov = iovs.back();
252 l_tagname[1] = l_tagname[0];
254 run[1] = std::get<0>(lastiov);
255 for (
int irun = 0; irun < nIOVs; irun++) {
256 std::shared_ptr<EcalPFRecHitThresholds>
payload;
263 if (
payload->barrelItems().empty())
266 fillEBMap_TwoIOVs<EcalPFRecHitThresholds>(
payload,
barrel, irun, pEB, pEBmin, pEBmax,
method);
268 if (
payload->endcapItems().empty())
271 fillEEMap_TwoIOVs<EcalPFRecHitThresholds>(
payload, endc_m, endc_p, irun, pEE, pEEmin, pEEmax,
method);
276 gStyle->SetPalette(1);
277 gStyle->SetOptStat(0);
278 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
282 int len = l_tagname[0].length() + l_tagname[1].length();
286 t1.SetTextSize(0.05);
290 Form(
"%s %i %s %s %i", l_tagname[1].c_str(),
run[1],
dr[
method].c_str(), l_tagname[0].c_str(),
run[0]));
292 t1.SetTextSize(0.05);
293 t1.DrawLatex(0.5, 0.96, Form(
"Ecal PFRec Hit Thresholds, IOV %i %s %i",
run[1],
dr[
method].c_str(),
run[0]));
296 t1.SetTextSize(0.05);
297 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]));
300 float xmi[3] = {0.0, 0.24, 0.76};
301 float xma[3] = {0.24, 0.76, 1.00};
302 std::array<std::unique_ptr<TPad>, 3> pad;
305 pad[
obj] = std::make_unique<TPad>(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
310 DrawEE(endc_m, pEEmin, pEEmax);
314 DrawEE(endc_p, pEEmin, pEEmax);
317 canvas.SaveAs(ImageName.c_str());
321 using EcalPFRecHitThresholdsDiffOneTag = EcalPFRecHitThresholdsBase<cond::payloadInspector::SINGLE_IOV, 1, 0>;
322 using EcalPFRecHitThresholdsDiffTwoTags = EcalPFRecHitThresholdsBase<cond::payloadInspector::SINGLE_IOV, 2, 0>;
323 using EcalPFRecHitThresholdsRatioOneTag = EcalPFRecHitThresholdsBase<cond::payloadInspector::SINGLE_IOV, 1, 1>;
324 using EcalPFRecHitThresholdsRatioTwoTags = EcalPFRecHitThresholdsBase<cond::payloadInspector::SINGLE_IOV, 2, 1>;
331 EcalPFRecHitThresholdsSummaryPlot()
336 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
337 auto iov = iovs.front();
339 unsigned int run = std::get<0>(iov);
345 align =
new TH2F(
"",
"", 0, 0, 0, 0, 0, 0);
347 float mean_x_EB = 0.0f;
348 float mean_x_EE = 0.0f;
356 payload->summary(mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
358 align,
"Ecal PFRec Hit Thresholds", mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
362 gStyle->SetPalette(1);
363 gStyle->SetOptStat(0);
364 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
368 t1.SetTextSize(0.04);
370 t1.DrawLatex(0.5, 0.96, Form(
"Ecal PFRec Hit Thresholds Summary, IOV %i",
run));
372 TPad pad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
380 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)