23 EcalSimPulseShapeProfile() :
cond::payloadInspector::PlotImage<
EcalSimPulseShape>(
"ECAL SimPulseShape - Profile ") {
27 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> > &iovs)
override {
28 auto iov = iovs.front();
30 unsigned int run = std::get<0>(iov);
32 int EBnbin = 0, EEnbin = 0, APDnbin = 0;
33 double EBxmax, EExmax, APDxmax, EBth, EEth, APDth;
35 EBth = (*payload).barrel_thresh;
36 EEth = (*payload).endcap_thresh;
37 APDth = (*payload).apd_thresh;
38 double time = (*payload).time_interval;
39 std::vector<double> EBshape = (*payload).barrel_shape;
40 std::vector<double> EEshape = (*payload).endcap_shape;
41 std::vector<double> APDshape = (*payload).apd_shape;
42 EBnbin = EBshape.size();
43 EBxmax = EBnbin *
time;
44 EEnbin = EBshape.size();
45 EExmax = EEnbin *
time;
46 APDnbin = APDshape.size();
47 APDxmax = APDnbin *
time;
53 barrel =
new TProfile(
"EBshape",
"", EBnbin, 0, EBxmax);
54 endcap =
new TProfile(
"EEshape",
"", EEnbin, 0, EExmax);
55 apd =
new TProfile(
"APDshape",
"", APDnbin, 0, APDxmax);
56 for (
int s = 0;
s < EBnbin;
s++) {
57 double val = EBshape[
s];
60 for (
int s = 0;
s < EEnbin;
s++) {
61 double val = EEshape[
s];
64 for (
int s = 0;
s < APDnbin;
s++) {
65 double val = APDshape[
s];
73 gStyle->SetOptStat(0);
74 TCanvas
canvas(
"ESPS",
"ESPS", 1000, 500);
79 t1.DrawLatex(0.5, 0.96, Form(
"Sim Pulse Shape, IOV %i",
run));
81 if (EBnbin == EEnbin && EBnbin == APDnbin) {
82 TPad *pad =
new TPad(
"p_0",
"p_0", 0.0, 0.0, 1.0, 0.95);
85 barrel->SetXTitle(
"time (ns)");
86 barrel->SetYTitle(
"normalized amplitude (ADC#)");
87 barrel->SetMarkerColor(kBlack);
88 barrel->SetMarkerStyle(24);
91 TMarker *EBMarker =
new TMarker(0.58, 0.85, 24);
93 EBMarker->SetMarkerSize(1.0);
94 EBMarker->SetMarkerColor(kBlack);
97 t1.DrawLatex(0.59, 0.85, Form(
"EB pulse, threshold %f", EBth));
99 endcap->SetMarkerColor(kRed);
100 endcap->SetMarkerStyle(24);
103 TMarker *EEMarker =
new TMarker(0.58, 0.78, 24);
105 EEMarker->SetMarkerSize(1.0);
106 EEMarker->SetMarkerColor(kRed);
108 t1.SetTextColor(kRed);
109 t1.DrawLatex(0.59, 0.78, Form(
"EE pulse, threshold %f", EEth));
111 apd->SetMarkerColor(kBlue);
112 apd->SetMarkerStyle(24);
115 TMarker *APDMarker =
new TMarker(0.58, 0.71, 24);
117 APDMarker->SetMarkerSize(1.0);
118 APDMarker->SetMarkerColor(kBlue);
120 t1.SetTextColor(kBlue);
121 t1.DrawLatex(0.59, 0.71, Form(
"APD pulse, threshold %f", APDth));
123 canvas.SetCanvasSize(1000, 1000);
124 TPad **pad =
new TPad *[3];
125 for (
int s = 0;
s < 3;
s++) {
126 float yma = 0.94 - (0.31 *
s);
127 float ymi = yma - 0.29;
128 pad[
s] =
new TPad(Form(
"p_%i",
s), Form(
"p_%i",
s), 0.0, ymi, 1.0, yma);
133 barrel->SetXTitle(
"time (ns)");
134 barrel->SetYTitle(
"normalized amplitude (ADC#)");
135 barrel->SetMarkerColor(kBlack);
136 barrel->SetMarkerStyle(24);
137 TMarker *EBMarker =
new TMarker(0.58, 0.80, 24);
140 EBMarker->SetMarkerSize(1.0);
141 EBMarker->SetMarkerColor(kBlack);
143 t1.DrawLatex(0.59, 0.80, Form(
"EB pulse, threshold %f", EBth));
146 endcap->SetMarkerStyle(24);
147 endcap->SetMarkerColor(kRed);
149 endcap->SetXTitle(
"time (ns)");
150 endcap->SetYTitle(
"normalized amplitude (ADC#)");
151 TMarker *EEMarker =
new TMarker(0.58, 0.8, 24);
154 EEMarker->SetMarkerSize(1.0);
155 EEMarker->SetMarkerColor(kRed);
156 t1.SetTextColor(kRed);
157 t1.DrawLatex(0.59, 0.80, Form(
"EE pulse, threshold %f", EEth));
160 apd->SetMarkerStyle(24);
162 apd->SetMarkerColor(kBlue);
163 apd->SetXTitle(
"time (ns)");
164 apd->SetYTitle(
"normalized amplitude (ADC#)");
165 TMarker *APDMarker =
new TMarker(0.58, 0.8, 24);
168 APDMarker->SetMarkerSize(1.0);
169 APDMarker->SetMarkerColor(kBlue);
170 t1.SetTextColor(kBlue);
171 t1.DrawLatex(0.59, 0.80, Form(
"APD pulse, threshold %f", APDth));
174 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)