20 enum { kESChannels = 137216 };
31 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
32 TH2F*** esmap =
new TH2F**[2];
34 for (
int plane = 0; plane < 2; plane++) {
35 esmap[plane] =
new TH2F*[2];
36 for (
int side = 0; side < 2; side++)
37 esmap[plane][side] =
new TH2F(
42 auto iov = iovs.front();
44 run = std::get<0>(iov);
47 for (
int id = 0;
id < kESChannels;
id++)
50 int side = myESId.
zside();
55 int plane = myESId.
plane() - 1;
56 if (side < 0 || side > 1 || plane < 0 || plane > 1) {
57 std::cout <<
" channel " <<
id <<
" side " << myESId.
zside() <<
" plane " << myESId.
plane() << std::endl;
63 if (myESId.
strip() == 1) {
64 esmap[plane][side]->Fill(myESId.
six() - 1, myESId.
siy() - 1,
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;
90 new TPad(Form(
"p_%i_%i", plane, side), Form(
"p_%i_%i", plane, side), xmi[side], ymi, xma[side], yma);
91 pad[plane][side]->Draw();
95 int min = valmin * 10 - 1.;
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());
115 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
118 ESIntercalibConstantsDiffBase()
120 bool fill()
override {
121 TH2F*** esmap =
new TH2F**[2];
123 for (
int plane = 0; plane < 2; plane++) {
124 esmap[plane] =
new TH2F*[2];
125 for (
int side = 0; side < 2; side++)
126 esmap[plane][side] =
new TH2F(
131 float val[kESChannels], valmin = 999.;
132 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
133 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
134 auto firstiov = iovs.front();
135 run[0] = std::get<0>(firstiov);
136 std::tuple<cond::Time_t, cond::Hash> lastiov;
138 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
139 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
140 lastiov = tag2iovs.front();
142 lastiov = iovs.back();
143 l_tagname[1] = l_tagname[0];
145 run[1] = std::get<0>(lastiov);
146 for (
int irun = 0; irun < nIOVs; irun++) {
147 std::shared_ptr<ESIntercalibConstants>
payload;
154 for (
int id = 0;
id < kESChannels;
id++)
159 float value = *IC_it;
164 int side = myESId.
zside();
169 int plane = myESId.
plane() - 1;
170 if (side < 0 || side > 1 || plane < 0 || plane > 1) {
171 std::cout <<
" channel " <<
id <<
" side " << myESId.
zside() <<
" plane " << myESId.
plane()
177 if (myESId.
strip() == 1) {
178 esmap[plane][side]->Fill(myESId.
six() - 1, myESId.
siy() - 1,
diff);
187 gStyle->SetOptStat(0);
188 gStyle->SetPalette(1);
189 TCanvas
canvas(
"CC map",
"CC map", 1680, 1320);
193 int len = l_tagname[0].length() + l_tagname[1].length();
194 if (ntags == 2 && len < 58) {
195 t1.SetTextSize(0.025);
197 0.5, 0.96, Form(
"%s IOV %i - %s IOV %i", l_tagname[1].c_str(),
run[1], l_tagname[0].c_str(),
run[0]));
199 t1.SetTextSize(0.03);
200 t1.DrawLatex(0.5, 0.96, Form(
"ES Intercalib Constants, IOV %i - %i",
run[1],
run[0]));
202 float xmi[2] = {0.0, 0.5};
203 float xma[2] = {0.5, 1.0};
204 TPad*** pad =
new TPad**[2];
205 for (
int plane = 0; plane < 2; plane++) {
206 pad[plane] =
new TPad*[2];
207 for (
int side = 0; side < 2; side++) {
208 float yma = 0.94 - (0.46 * plane);
209 float ymi = yma - 0.44;
211 new TPad(Form(
"p_%i_%i", plane, side), Form(
"p_%i_%i", plane, side), xmi[side], ymi, xma[side], yma);
212 pad[plane][side]->Draw();
216 int min = valmin * 10 - 1.;
218 for (
int side = 0; side < 2; side++) {
219 for (
int plane = 0; plane < 2; plane++) {
220 pad[plane][side]->cd();
221 esmap[plane][side]->Draw(
"colz1");
222 esmap[plane][side]->SetMinimum(valmin);
228 canvas.SaveAs(ImageName.c_str());
232 using ESIntercalibConstantsDiffOneTag = ESIntercalibConstantsDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
233 using ESIntercalibConstantsDiffTwoTags = ESIntercalibConstantsDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
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)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)