9 #include "TPaveStats.h"
71 vValues[0].first =
"gain12Over6";
72 vValues[1].first =
"gain6Over1";
74 vValues[0].second = .0;
75 vValues[1].second = .0;
78 for(std::vector<EcalObject>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems){
80 vValues[0].second += iItems->gain12Over6();
81 vValues[1].second += iItems->gain6Over1();
99 std::vector<int>
const&,
100 std::vector<float>
const& )
const {
101 gStyle->SetPalette(1);
102 TCanvas
canvas(
"CC map",
"CC map",840,600);
103 float xmi[3] = {0.0 , 0.22, 0.78};
104 float xma[3] = {0.22, 0.78, 1.00};
105 TPad*** pad =
new TPad**[2];
106 for (
int gId = 0; gId < 2; gId++) {
107 pad[gId] =
new TPad*[3];
109 float yma = 1.- (0.34 * gId);
110 float ymi = yma - 0.32;
111 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId),Form(
"p_%i_%i",
obj, gId),
112 xmi[
obj], ymi, xma[obj], yma);
113 pad[gId][
obj]->Draw();
116 TPad** pad1 =
new TPad*[4];
118 float xmi = 0.26 *
obj;
119 float xma = xmi + 0.22;
120 pad1[
obj] =
new TPad(Form(
"p1_%i",
obj),Form(
"p1_%i",
obj),
121 xmi, 0.0, xma, 0.32);
130 TH2F* barrel_12O6 =
new TH2F(
"EB_12O6",
"EB gain 12/6",360,0,360, 170, -85,85);
131 TH2F* endc_p_12O6 =
new TH2F(
"EE+_12O6",
"EE+ gain 12/6",100,1,101,100,1,101);
132 TH2F* endc_m_12O6 =
new TH2F(
"EE-_12O6",
"EE- gain 12/6",100,1,101,100,1,101);
133 TH2F* barrel_6O1 =
new TH2F(
"EB_6O1",
"EB gain 6/1",360,0,360, 170, -85,85);
134 TH2F* endc_p_6O1 =
new TH2F(
"EE+_6O1",
"EE+ gain 6/1",100,1,101,100,1,101);
135 TH2F* endc_m_6O1 =
new TH2F(
"EE-_6O1",
"EE- gain 6/1",100,1,101,100,1,101);
136 TH1F* b_12O6 =
new TH1F(
"b_12O6",
"EB gain 12/6", 50, 1.8, 2.1);
137 TH1F* e_12O6 =
new TH1F(
"e_12O6",
"EE gain 12/6", 50, 1.8, 2.1);
138 TH1F* b_6O1 =
new TH1F(
"b_6O1",
"EB gain 6/1", 100, 5.3, 6.3);
139 TH1F* e_6O1 =
new TH1F(
"e_6O1",
"EE gain 6/1", 100, 5.3, 6.3);
142 int thesign =
sign==1 ? 1:-1;
146 EBDetId id((ieta+1)*thesign, iphi+1);
148 if(
sign == 1) y = ieta;
149 barrel_12O6->Fill(iphi, y,
object()[
id.rawId()].gain12Over6());
150 barrel_6O1->Fill(iphi, y,
object()[
id.rawId()].gain6Over1());
151 b_12O6->Fill(
object()[
id.rawId()].gain12Over6());
152 b_6O1->Fill(
object()[
id.rawId()].gain6Over1());
161 endc_p_12O6->Fill(ix+1,iy+1,
object()[
id.rawId()].gain12Over6());
162 endc_p_6O1->Fill(ix+1,iy+1,
object()[
id.rawId()].gain6Over1());
165 endc_m_12O6->Fill(ix+1,iy+1,
object()[
id.rawId()].gain12Over6());
166 endc_m_6O1->Fill(ix+1,iy+1,
object()[
id.rawId()].gain6Over1());
168 e_12O6->Fill(
object()[
id.rawId()].gain12Over6());
169 e_6O1->Fill(
object()[
id.rawId()].gain6Over1());
174 TLine*
l =
new TLine(0., 0., 0., 0.);
176 int ixSectorsEE[202] = {
177 62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42,
178 41, 41, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 46, 46, 56, 56, 58, 58, 59, 59,
179 60, 60, 61, 61, 62, 62, 0,101,101, 98, 98, 96, 96, 93, 93, 88, 88, 86, 86, 81,
180 81, 76, 76, 66, 66, 61, 61, 41, 41, 36, 36, 26, 26, 21, 21, 16, 16, 14, 14, 9,
181 9, 6, 6, 4, 4, 1, 1, 4, 4, 6, 6, 9, 9, 14, 14, 16, 16, 21, 21, 26,
182 26, 36, 36, 41, 41, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88, 93, 93, 96,
183 96, 98, 98,101,101, 0, 62, 66, 66, 71, 71, 81, 81, 91, 91, 93, 0, 62, 66, 66,
184 91, 91, 98, 0, 58, 61, 61, 66, 66, 71, 71, 76, 76, 81, 81, 0, 51, 51, 0, 44,
185 41, 41, 36, 36, 31, 31, 26, 26, 21, 21, 0, 40, 36, 36, 11, 11, 4, 0, 40, 36,
186 36, 31, 31, 21, 21, 11, 11, 9, 0, 46, 46, 41, 41, 36, 36, 0, 56, 56, 61, 61, 66, 66};
188 int iySectorsEE[202] = {
189 51, 56, 56, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 61, 61, 60, 60, 59, 59, 58,
190 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42, 41, 41, 40, 40, 41, 41, 42, 42, 43,
191 43, 44, 44, 46, 46, 51, 0, 51, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88,
192 93, 93, 96, 96, 98, 98,101,101, 98, 98, 96, 96, 93, 93, 88, 88, 86, 86, 81, 81,
193 76, 76, 66, 66, 61, 61, 41, 41, 36, 36, 26, 26, 21, 21, 16, 16, 14, 14, 9, 9,
194 6, 6, 4, 4, 1, 1, 4, 4, 6, 6, 9, 9, 14, 14, 16, 16, 21, 21, 26, 26,
195 36, 36, 41, 41, 51, 0, 46, 46, 41, 41, 36, 36, 31, 31, 26, 26, 0, 51, 51, 56,
196 56, 61, 61, 0, 61, 61, 66, 66, 71, 71, 76, 76, 86, 86, 88, 0, 62,101, 0, 61,
197 61, 66, 66, 71, 71, 76, 76, 86, 86, 88, 0, 51, 51, 56, 56, 61, 61, 0, 46, 46,
198 41, 41, 36, 36, 31, 31, 26, 26, 0, 40, 31, 31, 16, 16, 6, 0, 40, 31, 31, 16, 16, 6};
200 float min12O6 = 1.8, max12O6 = 2.1, min6O1 = 5.3, max6O1 = 6.3;
202 endc_m_12O6->SetStats(0);
203 endc_m_12O6->SetMaximum(max12O6);
204 endc_m_12O6->SetMinimum(min12O6);
205 endc_m_12O6->Draw(
"colz");
206 for (
int i=0;
i<201;
i=
i+1) {
207 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
208 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
209 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
210 ixSectorsEE[i+1], iySectorsEE[i+1]);
211 l->SetLineWidth(0.2);
215 barrel_12O6->SetStats(0);
216 barrel_12O6->SetMaximum(max12O6);
217 barrel_12O6->SetMinimum(min12O6);
218 barrel_12O6->Draw(
"colz");
219 for(
int i = 0;
i <17;
i++) {
220 Double_t
x = 20.+ (
i *20);
221 l =
new TLine(x,-85.,x,86.);
224 l =
new TLine(0.,0.,360.,0.);
227 endc_p_12O6->SetStats(0);
228 endc_p_12O6->SetMaximum(max12O6);
229 endc_p_12O6->SetMinimum(min12O6);
230 endc_p_12O6->Draw(
"colz");
231 for (
int i=0;
i<201;
i=
i+1) {
232 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
233 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
234 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
235 ixSectorsEE[i+1], iySectorsEE[i+1]);
236 l->SetLineWidth(0.2);
240 endc_m_6O1->SetStats(0);
241 endc_m_6O1->SetMaximum(max6O1);
242 endc_m_6O1->SetMinimum(min6O1);
243 endc_m_6O1->Draw(
"colz");
244 for (
int i=0;
i<201;
i=
i+1) {
245 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
246 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
247 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
248 ixSectorsEE[i+1], iySectorsEE[i+1]);
249 l->SetLineWidth(0.2);
253 barrel_6O1->SetStats(0);
254 barrel_6O1->SetMaximum(max6O1);
255 barrel_6O1->SetMinimum(min6O1);
256 barrel_6O1->Draw(
"colz");
257 for(
int i = 0;
i <17;
i++) {
258 Double_t
x = 20.+ (
i *20);
259 l =
new TLine(x,-85.,x,86.);
262 l =
new TLine(0.,0.,360.,0.);
265 endc_p_6O1->SetStats(0);
266 endc_p_6O1->SetMaximum(max6O1);
267 endc_p_6O1->SetMinimum(min6O1);
268 endc_p_6O1->Draw(
"colz");
269 for (
int i=0;
i<201;
i=
i+1) {
270 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
271 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
272 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
273 ixSectorsEE[i+1], iySectorsEE[i+1]);
274 l->SetLineWidth(0.2);
278 gStyle->SetOptStat(111110);
282 TPaveStats *st = (TPaveStats*)b_12O6->FindObject(
"stats");
288 st = (TPaveStats*)e_12O6->FindObject(
"stats");
294 st = (TPaveStats*)b_6O1->FindObject(
"stats");
300 st = (TPaveStats*)e_6O1->FindObject(
"stats");
304 canvas.SaveAs(filename.c_str());
std::string plot(std::string const &, std::string const &, std::vector< int > const &, std::vector< float > const &) const
static const int kBarlRings
std::vector< std::pair< std::string, float > > type_vValues
#define PYTHON_WRAPPER(_class, _name)
EcalMGPAGainRatio EcalObject
unsigned int total_values
type_vValues getValues(const std::vector< EcalObject > &vItems) override
static const int kBarlWedges
T x() const
Cartesian x coordinate.
std::string summary() const
static const int kEndcWedgesX
static const int MAX_IPHI
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
static const int MAX_IETA
std::string printBarrelsEndcaps(const std::vector< T > &barrelItems, const std::vector< T > &endcapItems)
static std::string dumpXML(const EcalCondHeader &header, const EcalGainRatios &record)
static const int kEndcWedgesY