21 enum {kESChannels = 137216};
34 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
36 TH2F*** esmap =
new TH2F**[2];
38 for (
int plane = 0; plane < 2; plane++) {
39 esmap[plane] =
new TH2F*[2];
40 for (
int side = 0; side < 2; side++)
41 esmap[plane][side] =
new TH2F(Form(
"esmap%i%i",plane,side),title[plane][side].c_str(),
IX_MAX, 0,
IX_MAX,
IY_MAX, 0,
IY_MAX);
45 auto iov = iovs.front();
47 run = std::get<0>(iov);
50 for(
int id = 0;
id < kESChannels;
id++)
53 int side = myESId.
zside();
54 if(side < 0) side = 1;
56 int plane = myESId.
plane() - 1;
57 if(side < 0 || side > 1 || plane < 0 || plane > 1) {
58 std::cout <<
" channel " <<
id <<
" side " << myESId.
zside() <<
" plane " << myESId.
plane() << std::endl;
64 if(myESId.
strip() == 1) {
65 esmap[plane][side]->Fill(myESId.
six() -1, myESId.
siy() -1,
value);
66 if(value < valmin) valmin =
value;
71 gStyle->SetOptStat(0);
72 gStyle->SetPalette(1);
73 TCanvas
canvas(
"CC map",
"CC map",1680,1320);
78 t1.DrawLatex(0.5, 0.96, Form(
"ES Intercalib Constants, IOV %i", run));
79 t1.SetTextSize(0.025);
81 float xmi[2] = {0.0, 0.5};
82 float xma[2] = {0.5, 1.0};
83 TPad*** pad =
new TPad**[2];
84 for (
int plane = 0; plane < 2; plane++) {
85 pad[plane] =
new TPad*[2];
86 for (
int side = 0; side < 2; side++) {
87 float yma = 0.94 - (0.46 * plane);
88 float ymi = yma - 0.44;
89 pad[plane][side] =
new TPad(Form(
"p_%i_%i", plane, side),Form(
"p_%i_%i", plane, side),
90 xmi[side], ymi, xma[side], yma);
91 pad[plane][side]->Draw();
95 int min = valmin * 10 - 1.;
96 valmin = (
float)min / 10.;
97 for (
int side = 0; side < 2; side++) {
98 for (
int plane = 0; plane < 2; plane++) {
99 pad[plane][side]->cd();
100 esmap[plane][side]->Draw(
"colz1");
101 esmap[plane][side]->SetMinimum(valmin);
107 canvas.SaveAs(ImageName.c_str());
118 ESIntercalibConstantsDiff() :
cond::payloadInspector::PlotImage<
ESIntercalibConstants>(
"ES IntercalibConstants difference") {
121 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
122 TH2F*** esmap =
new TH2F**[2];
123 std::string title[2][2] = {{
"ES+F",
"ES-F"},{
"ES+R",
"ES-R"}};
124 for (
int plane = 0; plane < 2; plane++) {
125 esmap[plane] =
new TH2F*[2];
126 for (
int side = 0; side < 2; side++)
127 esmap[plane][side] =
new TH2F(Form(
"esmap%i%i",plane,side),title[plane][side].c_str(),
IX_MAX, 0,
IX_MAX,
IY_MAX, 0,
IY_MAX);
129 unsigned int run[2], irun = 0;
130 float val[kESChannels], valmin = 999.;
131 for (
auto const & iov: iovs) {
132 std::shared_ptr<ESIntercalibConstants> payload = fetchPayload( std::get<1>(iov) );
133 run[irun] = std::get<0>(iov);
136 for(
int id = 0;
id < kESChannels;
id++)
141 float value = *IC_it;
146 int side = myESId.
zside();
147 if(side < 0) side = 1;
149 int plane = myESId.
plane() - 1;
150 if(side < 0 || side > 1 || plane < 0 || plane > 1) {
151 std::cout <<
" channel " <<
id <<
" side " << myESId.
zside() <<
" plane " << myESId.
plane() << std::endl;
155 int diff = value - val[
id];
156 if(myESId.
strip() == 1) {
157 esmap[plane][side]->Fill(myESId.
six() -1, myESId.
siy() -1,
diff);
158 if(diff < valmin) valmin =
diff;
166 gStyle->SetOptStat(0);
167 gStyle->SetPalette(1);
168 TCanvas
canvas(
"CC map",
"CC map",1680,1320);
172 t1.SetTextSize(0.05);
173 t1.DrawLatex(0.5, 0.96, Form(
"ES Intercalib Constants, IOV %i - %i", run[1], run[0]));
174 t1.SetTextSize(0.025);
176 float xmi[2] = {0.0, 0.5};
177 float xma[2] = {0.5, 1.0};
178 TPad*** pad =
new TPad**[2];
179 for (
int plane = 0; plane < 2; plane++) {
180 pad[plane] =
new TPad*[2];
181 for (
int side = 0; side < 2; side++) {
182 float yma = 0.94 - (0.46 * plane);
183 float ymi = yma - 0.44;
184 pad[plane][side] =
new TPad(Form(
"p_%i_%i", plane, side),Form(
"p_%i_%i", plane, side),
185 xmi[side], ymi, xma[side], yma);
186 pad[plane][side]->Draw();
190 int min = valmin * 10 - 1.;
191 valmin = (
float)min / 10.;
192 for (
int side = 0; side < 2; side++) {
193 for (
int plane = 0; plane < 2; plane++) {
194 pad[plane][side]->cd();
195 esmap[plane][side]->Draw(
"colz1");
196 esmap[plane][side]->SetMinimum(valmin);
202 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)
std::vector< Item >::const_iterator const_iterator
void DrawES(int plane, int side)
static ESDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
static bool validHashIndex(int hi)