24 EcalSimPulseShapeProfile() :
cond::payloadInspector::PlotImage<
EcalSimPulseShape>(
"ECAL SimPulseShape - Profile ") {
28 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
30 auto iov = iovs.front();
32 unsigned int run = std::get<0>(iov);
34 int EBnbin = 0, EEnbin = 0, APDnbin = 0;
35 double EBxmax, EExmax, APDxmax, EBth, EEth, APDth;
37 EBth = (*payload).barrel_thresh;
38 EEth = (*payload).endcap_thresh;
39 APDth = (*payload).apd_thresh;
40 double time = (*payload).time_interval;
41 std::vector<double> EBshape = (*payload).barrel_shape;
42 std::vector<double> EEshape = (*payload).endcap_shape;
43 std::vector<double> APDshape = (*payload).apd_shape;
44 EBnbin = EBshape.size();
45 EBxmax = EBnbin *
time;
46 EEnbin = EBshape.size();
47 EExmax = EEnbin *
time;
48 APDnbin = APDshape.size();
49 APDxmax = APDnbin *
time;
55 barrel =
new TProfile(
"EBshape",
"", EBnbin, 0, EBxmax);
56 endcap =
new TProfile(
"EEshape",
"", EEnbin, 0, EExmax);
57 apd =
new TProfile(
"APDshape",
"", APDnbin, 0, APDxmax);
58 for(
int s = 0;
s < EBnbin;
s++) {
59 double val = EBshape[
s];
62 for(
int s = 0;
s < EEnbin;
s++) {
63 double val = EEshape[
s];
66 for(
int s = 0;
s < APDnbin;
s++) {
67 double val = APDshape[
s];
74 gStyle->SetOptStat(0);
75 TCanvas
canvas(
"ESPS",
"ESPS", 1000, 500);
80 t1.DrawLatex(0.5, 0.96, Form(
"Sim Pulse Shape, IOV %i", run));
82 if(EBnbin == EEnbin && EBnbin == APDnbin) {
83 TPad* pad =
new TPad(
"p_0",
"p_0", 0.0, 0.0, 1.0, 0.95);
86 barrel->SetXTitle(
"time (ns)");
87 barrel->SetYTitle(
"normalized amplitude (ADC#)");
88 barrel->SetMarkerColor(kBlack);
89 barrel->SetMarkerStyle(24);
92 TMarker *EBMarker =
new TMarker(0.58, 0.85, 24);
94 EBMarker->SetMarkerSize(1.0);
95 EBMarker->SetMarkerColor(kBlack);
98 t1.DrawLatex(0.59, 0.85, Form(
"EB pulse, threshold %f",EBth));
100 endcap->SetMarkerColor(kRed);
101 endcap->SetMarkerStyle(24);
103 endcap->Draw(
"PSAME");
104 TMarker *EEMarker =
new TMarker(0.58, 0.78, 24);
106 EEMarker->SetMarkerSize(1.0);
107 EEMarker->SetMarkerColor(kRed);
109 t1.SetTextColor(kRed);
110 t1.DrawLatex(0.59, 0.78, Form(
"EE pulse, threshold %f",EEth));
112 apd->SetMarkerColor(kBlue);
113 apd->SetMarkerStyle(24);
116 TMarker *APDMarker =
new TMarker(0.58, 0.71, 24);
118 APDMarker->SetMarkerSize(1.0);
119 APDMarker->SetMarkerColor(kBlue);
121 t1.SetTextColor(kBlue);
122 t1.DrawLatex(0.59, 0.71, Form(
"APD pulse, threshold %f",APDth));
125 canvas.SetCanvasSize (1000, 1000);
126 TPad** pad =
new TPad*[3];
127 for (
int s = 0;
s < 3;
s++) {
128 float yma = 0.94 - (0.31 *
s);
129 float ymi = yma - 0.29;
130 pad[
s] =
new TPad(Form(
"p_%i",
s),Form(
"p_%i",
s), 0.0, ymi, 1.0, yma);
135 barrel->SetXTitle(
"time (ns)");
136 barrel->SetYTitle(
"normalized amplitude (ADC#)");
137 barrel->SetMarkerColor(kBlack);
138 barrel->SetMarkerStyle(24);
139 TMarker *EBMarker =
new TMarker(0.58, 0.80, 24);
142 EBMarker->SetMarkerSize(1.0);
143 EBMarker->SetMarkerColor(kBlack);
145 t1.DrawLatex(0.59, 0.80, Form(
"EB pulse, threshold %f",EBth));
148 endcap->SetMarkerStyle(24);
149 endcap->SetMarkerColor(kRed);
151 endcap->SetXTitle(
"time (ns)");
152 endcap->SetYTitle(
"normalized amplitude (ADC#)");
153 TMarker *EEMarker =
new TMarker(0.58, 0.8, 24);
156 EEMarker->SetMarkerSize(1.0);
157 EEMarker->SetMarkerColor(kRed);
158 t1.SetTextColor(kRed);
159 t1.DrawLatex(0.59, 0.80, Form(
"EE pulse, threshold %f",EEth));
162 apd->SetMarkerStyle(24);
164 apd->SetMarkerColor(kBlue);
165 apd->SetXTitle(
"time (ns)");
166 apd->SetYTitle(
"normalized amplitude (ADC#)");
167 TMarker *APDMarker =
new TMarker(0.58, 0.8, 24);
170 APDMarker->SetMarkerSize(1.0);
171 APDMarker->SetMarkerColor(kBlue);
172 t1.SetTextColor(kBlue);
173 t1.DrawLatex(0.59, 0.80, Form(
"APD pulse, threshold %f",APDth));
176 canvas.SaveAs(ImageName.c_str());
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
void setSingleIov(bool flag)