28 EcalPulseCovariancesPlot()
33 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
34 TH2F**
barrel =
new TH2F*[TEMPLATESAMPLES];
35 TH2F** endc_p =
new TH2F*[TEMPLATESAMPLES];
36 TH2F** endc_m =
new TH2F*[TEMPLATESAMPLES];
39 double pEBmin[TEMPLATESAMPLES], pEBmax[TEMPLATESAMPLES], pEEmin[TEMPLATESAMPLES], pEEmax[TEMPLATESAMPLES];
40 for (
int s = 0;
s < TEMPLATESAMPLES; ++
s) {
59 auto iov = iovs.front();
61 unsigned int run = std::get<0>(iov);
73 Double_t
phi = (Double_t)
iphi - 0.5;
91 for (
int s = 0;
s < TEMPLATESAMPLES; ++
s) {
92 double val = (*payload)[
id.rawId()].covval[0][
s];
106 int thesign =
sign == 1 ? 1 : -1;
107 for (
int ix = 1; ix <=
IX_MAX; ix++) {
108 for (
int iy = 1; iy <=
IY_MAX; iy++) {
112 for (
int s = 0;
s < TEMPLATESAMPLES; ++
s) {
113 double val = (*payload)[
id.rawId()].covval[0][
s];
122 endc_p[
s]->Fill(ix, iy,
val);
124 endc_m[
s]->Fill(ix, iy,
val);
156 gStyle->SetPalette(1);
157 gStyle->SetOptStat(0);
158 TCanvas
canvas(
"CC map",
"CC map", 1600, 2800);
162 t1.SetTextSize(0.05);
163 t1.DrawLatex(0.5, 0.96, Form(
"Ecal PulseCovariances, IOV %i",
run));
165 float xmi[3] = {0.0, 0.24, 0.76};
166 float xma[3] = {0.24, 0.76, 1.00};
167 TPad*** pad =
new TPad**[6];
168 for (
int s = 0;
s < 6;
s++) {
169 pad[
s] =
new TPad*[3];
171 float yma = 0.94 - (0.16 *
s);
172 float ymi = yma - 0.14;
173 pad[
s][
obj] =
new TPad(Form(
"p_%i_%i",
obj,
s), Form(
"p_%i_%i",
obj,
s), xmi[
obj], ymi, xma[
obj], yma);
179 for (
int s = 0;
s < 7; ++
s) {
184 if (pEBmin[
s] == pEBmax[
s]) {
185 pEBmin[
s] = pEBmin[
s] - 1.e-06;
186 pEBmax[
s] = pEBmax[
s] + 1.e-06;
188 if (pEEmin[
s] == pEEmax[
s]) {
189 pEEmin[
s] = pEEmin[
s] - 1.e-06;
190 pEEmax[
s] = pEEmax[
s] + 1.e-06;
204 canvas.SaveAs(ImageName.c_str());
214 EcalPulseCovariancesMatrix()
219 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
220 double EBmean[TEMPLATESAMPLES][TEMPLATESAMPLES], EBrms[TEMPLATESAMPLES][TEMPLATESAMPLES],
221 EEmean[TEMPLATESAMPLES][TEMPLATESAMPLES], EErms[TEMPLATESAMPLES][TEMPLATESAMPLES];
222 for (
int i = 0;
i < TEMPLATESAMPLES;
i++) {
223 for (
int j = 0;
j < TEMPLATESAMPLES;
j++) {
231 auto iov = iovs.front();
233 unsigned int run = std::get<0>(iov);
238 for (
int i = 0;
i < TEMPLATESAMPLES; ++
i) {
239 for (
int j = 0;
j < TEMPLATESAMPLES; ++
j) {
240 double val = (*payload)[
id.rawId()].covval[
i][
j];
241 EBmean[
i][
j] = EBmean[
i][
j] +
val;
249 int thesign =
sign == 1 ? 1 : -1;
250 for (
int ix = 1; ix <=
IX_MAX; ix++) {
251 for (
int iy = 1; iy <=
IY_MAX; iy++) {
255 for (
int i = 0;
i < TEMPLATESAMPLES;
i++) {
256 for (
int j = 0;
j < TEMPLATESAMPLES;
j++) {
257 double val = (*payload)[
id.rawId()].covval[
i][
j];
258 EEmean[
i][
j] = EEmean[
i][
j] +
val;
268 new TH2F(
"EBm",
"EB mean", TEMPLATESAMPLES, 0, TEMPLATESAMPLES, TEMPLATESAMPLES, 0., TEMPLATESAMPLES);
270 new TH2F(
"EBr",
"EB rms", TEMPLATESAMPLES, 0, TEMPLATESAMPLES, TEMPLATESAMPLES, 0., TEMPLATESAMPLES);
272 new TH2F(
"EEm",
"EE mean", TEMPLATESAMPLES, 0, TEMPLATESAMPLES, TEMPLATESAMPLES, 0., TEMPLATESAMPLES);
274 new TH2F(
"EEr",
"EE rms", TEMPLATESAMPLES, 0, TEMPLATESAMPLES, TEMPLATESAMPLES, 0., TEMPLATESAMPLES);
275 for (
int i = 0;
i < TEMPLATESAMPLES;
i++) {
278 for (
int j = 0;
j < TEMPLATESAMPLES;
j++) {
280 EBmean[
i][
j] = EBmean[
i][
j] / vt;
281 barrel_m->Fill(
i,
j, EBmean[
i][
j]);
282 EBrms[
i][
j] = EBrms[
i][
j] / vt - (EBmean[
i][
j] * EBmean[
i][
j]);
283 if (EBrms[
i][
j] >= 0)
287 barrel_r->Fill(
i,
j, EBrms[
i][
j]);
291 EEmean[
i][
j] = EEmean[
i][
j] / vt;
292 endcap_m->Fill(
i,
j, EEmean[
i][
j]);
293 EErms[
i][
j] = EErms[
i][
j] / vt - (EEmean[
i][
j] * EEmean[
i][
j]);
294 if (EErms[
i][
j] >= 0)
298 endcap_r->Fill(
i,
j, EErms[
i][
j]);
304 gStyle->SetPalette(1);
305 gStyle->SetOptStat(0);
306 TCanvas
canvas(
"CC map",
"CC map", 1440, 1500);
310 t1.SetTextSize(0.05);
311 t1.DrawLatex(0.5, 0.96, Form(
"Ecal PulseCovariances, IOV %i",
run));
313 float xmi[2] = {0.0, 0.5};
314 float xma[2] = {0.5, 1.0};
315 TPad*** pad =
new TPad**[2];
316 for (
int s = 0;
s < 2;
s++) {
317 pad[
s] =
new TPad*[2];
319 float yma = 0.94 - (0.47 *
s);
320 float ymi = yma - 0.45;
321 pad[
s][
obj] =
new TPad(Form(
"p_%i_%i",
obj,
s), Form(
"p_%i_%i",
obj,
s), xmi[
obj], ymi, xma[
obj], yma);
340 canvas.SaveAs(ImageName.c_str());
346 TLine*
lh =
new TLine(1., 0., 1., 1.);
348 TLine* lv =
new TLine(1., 0., 1., 1.);
351 for (
int i = 1;
i < TEMPLATESAMPLES;
i++) {
353 lv =
new TLine(
i, 0.,
i, TEMPLATESAMPLES);
355 lh =
new TLine(0.,
i, TEMPLATESAMPLES,
i);
void DrawEE(TH2F *endc, float min, float max)
void DrawEB(TH2F *ebmap, float min, float max)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)