23 EcalSimComponentShapeProfile()
28 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> > &iovs)
override {
29 auto iov = iovs.front();
31 unsigned int run = std::get<0>(iov);
32 std::vector<TProfile *> profiles;
33 std::vector<int> EBnbins;
34 std::vector<double> EBxmaxs;
38 EBth = (*payload).barrel_thresh;
39 double time = (*payload).time_interval;
40 std::vector<std::vector<float> > EBshapes = (*payload).barrel_shapes;
42 for (
auto EBshape : EBshapes) {
43 EBnbins.push_back(EBshape.size());
44 EBxmaxs.push_back(EBnbins[iShape] *
time);
45 sprintf(nameBuffer,
"EBComponentShape_%d", iShape);
46 profiles.push_back(
new TProfile(nameBuffer,
"", EBnbins[iShape], 0, EBxmaxs[iShape]));
47 for (
int s = 0;
s < EBnbins[iShape];
s++) {
48 double val = EBshape[
s];
49 profiles[iShape]->Fill(
s,
val);
58 gStyle->SetOptStat(0);
59 gStyle->SetPalette(kThermometer);
60 TCanvas
canvas(
"ESPS",
"ESPS", 1000, 500);
65 t1.DrawLatex(0.5, 0.96, Form(
"Sim Component Shapes, IOV %i",
run));
67 TPad *pad =
new TPad(
"p_0",
"p_0", 0.0, 0.0, 1.0, 0.95);
73 profile->SetXTitle(
"time (ns)");
74 profile->SetYTitle(
"normalized amplitude (ADC#)");
75 profile->GetXaxis()->SetRangeUser(0., 275.);
76 profile->GetYaxis()->SetRangeUser(0., 1.25);
78 profile->SetMarkerColor(TColor::GetPalette().At(10 * iShape));
79 profile->SetLineColor(TColor::GetPalette().At(10 * iShape));
89 pad->BuildLegend(.7, .225, .85, .8);
91 t1.DrawLatex(0.4, 0.85, Form(
"EB component shapes, threshold %f", EBth));
94 canvas.SaveAs(ImageName.c_str());
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)