9 #include "TPaveStats.h"
66 vValues[0].second = .0;
67 vValues[1].second = .0;
68 vValues[2].second = .0;
69 vValues[3].second = .0;
70 vValues[4].second = .0;
71 vValues[5].second = .0;
75 vValues[0].first =
"mult_x12";
76 vValues[1].first =
"mult_x6";
77 vValues[2].first =
"mult_x1";
78 vValues[3].first =
"shift_x12";
79 vValues[4].first =
"shift_x6";
80 vValues[5].first =
"shift_x1";
85 for(std::vector<EcalObject>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems){
87 vValues[0].second += iItems->mult_x12;
88 vValues[1].second += iItems->mult_x6;
89 vValues[2].second += iItems->mult_x1;
90 vValues[3].second += iItems->shift_x12;
91 vValues[4].second += iItems->shift_x6;
92 vValues[5].second += iItems->shift_x1;
101 std::stringstream ss;
111 std::vector<int>
const&,
112 std::vector<float>
const& )
const {
113 gStyle->SetPalette(1);
115 const float IMG_SIZE = 1.5;
116 TCanvas
canvas(
"CC map",
"CC map",800 * IMG_SIZE,1200 * IMG_SIZE);
118 float xmi[3] = {0.0 , 0.22, 0.78};
119 float xma[3] = {0.22, 0.78, 1.00};
120 TPad*** pad =
new TPad**[6];
121 for (
int gId = 0; gId < 6; gId++) {
122 pad[gId] =
new TPad*[3];
124 float yma = 1.- (0.17 * gId);
125 float ymi = yma - 0.15;
126 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId),Form(
"p_%i_%i",
obj, gId),
127 xmi[
obj], ymi, xma[obj], yma);
128 pad[gId][
obj]->Draw();
132 const int kGains = 3;
133 const int gainValues[3] = {12, 6, 1};
140 TH2F** barrel_m =
new TH2F*[3];
141 TH2F** endc_p_m =
new TH2F*[3];
142 TH2F** endc_m_m =
new TH2F*[3];
143 TH2F** barrel_r =
new TH2F*[3];
144 TH2F** endc_p_r =
new TH2F*[3];
145 TH2F** endc_m_r =
new TH2F*[3];
147 barrel_m[
gainId] =
new TH2F(Form(
"mult_x12 EBm%i",
gainId),Form(
"mult_x%i EB",gainValues[
gainId]),360,0,360, 170, -85,85);
148 endc_p_m[
gainId] =
new TH2F(Form(
"mult_x12 EE+m%i",gainId),Form(
"mult_x%i EE+",gainValues[gainId]),100,1,101,100,1,101);
149 endc_m_m[
gainId] =
new TH2F(Form(
"mult_x12 EE-m%i",gainId),Form(
"mult_x%i EE-",gainValues[gainId]),100,1,101,100,1,101);
150 barrel_r[
gainId] =
new TH2F(Form(
"shift_x12 EBr%i",gainId),Form(
"shift_x%i EB",gainValues[gainId]),360,0,360, 170, -85,85);
151 endc_p_r[
gainId] =
new TH2F(Form(
"shift_x12 EE+r%i",gainId),Form(
"shift_x%i EE+",gainValues[gainId]),100,1,101,100,1,101);
152 endc_m_r[
gainId] =
new TH2F(Form(
"shift_x12 EE-r%i",gainId),Form(
"shift_x%i EE-",gainValues[gainId]),100,1,101,100,1,101);
155 for (
int sign=0; sign <
kSides; sign++) {
156 int thesign = sign==1 ? 1:-1;
160 EBDetId id((ieta+1)*thesign, iphi+1);
162 if(sign == 1) y = ieta;
163 barrel_m[0]->Fill(iphi, y,
object()[
id.rawId()].mult_x12);
164 barrel_r[0]->Fill(iphi, y,
object()[
id.rawId()].shift_x12);
165 barrel_m[1]->Fill(iphi, y,
object()[
id.rawId()].mult_x6);
166 barrel_r[1]->Fill(iphi, y,
object()[
id.rawId()].shift_x6);
167 barrel_m[2]->Fill(iphi, y,
object()[
id.rawId()].mult_x1);
168 barrel_r[2]->Fill(iphi, y,
object()[
id.rawId()].shift_x1);
177 endc_p_m[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x12);
178 endc_p_r[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x12);
179 endc_p_m[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x6);
180 endc_p_r[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x6);
181 endc_p_m[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x1);
182 endc_p_r[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x1);
185 endc_m_m[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x12);
186 endc_m_r[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x12);
187 endc_m_m[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x6);
188 endc_m_r[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x6);
189 endc_m_m[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x1);
190 endc_m_r[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x1);
201 TLine*
l =
new TLine(0., 0., 0., 0.);
203 int ixSectorsEE[202] = {
204 62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42,
205 41, 41, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 46, 46, 56, 56, 58, 58, 59, 59,
206 60, 60, 61, 61, 62, 62, 0,101,101, 98, 98, 96, 96, 93, 93, 88, 88, 86, 86, 81,
207 81, 76, 76, 66, 66, 61, 61, 41, 41, 36, 36, 26, 26, 21, 21, 16, 16, 14, 14, 9,
208 9, 6, 6, 4, 4, 1, 1, 4, 4, 6, 6, 9, 9, 14, 14, 16, 16, 21, 21, 26,
209 26, 36, 36, 41, 41, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88, 93, 93, 96,
210 96, 98, 98,101,101, 0, 62, 66, 66, 71, 71, 81, 81, 91, 91, 93, 0, 62, 66, 66,
211 91, 91, 98, 0, 58, 61, 61, 66, 66, 71, 71, 76, 76, 81, 81, 0, 51, 51, 0, 44,
212 41, 41, 36, 36, 31, 31, 26, 26, 21, 21, 0, 40, 36, 36, 11, 11, 4, 0, 40, 36,
213 36, 31, 31, 21, 21, 11, 11, 9, 0, 46, 46, 41, 41, 36, 36, 0, 56, 56, 61, 61, 66, 66};
215 int iySectorsEE[202] = {
216 51, 56, 56, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 61, 61, 60, 60, 59, 59, 58,
217 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42, 41, 41, 40, 40, 41, 41, 42, 42, 43,
218 43, 44, 44, 46, 46, 51, 0, 51, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88,
219 93, 93, 96, 96, 98, 98,101,101, 98, 98, 96, 96, 93, 93, 88, 88, 86, 86, 81, 81,
220 76, 76, 66, 66, 61, 61, 41, 41, 36, 36, 26, 26, 21, 21, 16, 16, 14, 14, 9, 9,
221 6, 6, 4, 4, 1, 1, 4, 4, 6, 6, 9, 9, 14, 14, 16, 16, 21, 21, 26, 26,
222 36, 36, 41, 41, 51, 0, 46, 46, 41, 41, 36, 36, 31, 31, 26, 26, 0, 51, 51, 56,
223 56, 61, 61, 0, 61, 61, 66, 66, 71, 71, 76, 76, 86, 86, 88, 0, 62,101, 0, 61,
224 61, 66, 66, 71, 71, 76, 76, 86, 86, 88, 0, 51, 51, 56, 56, 61, 61, 0, 46, 46,
225 41, 41, 36, 36, 31, 31, 26, 26, 0, 40, 31, 31, 16, 16, 6, 0, 40, 31, 31, 16, 16, 6};
227 for (
int gId = 0; gId < 3; gId++) {
229 endc_m_m[gId]->SetStats(0);
232 endc_m_m[gId]->Draw(
"colz");
233 for (
int i=0;
i<201;
i=
i+1) {
234 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
235 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
236 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
237 ixSectorsEE[i+1], iySectorsEE[i+1]);
238 l->SetLineWidth(0.2);
241 pad[gId + 3][0]->cd();
242 endc_m_r[gId]->SetStats(0);
245 endc_m_r[gId]->Draw(
"colz");
246 for (
int i=0;
i<201;
i=
i+1) {
247 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
248 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
249 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
250 ixSectorsEE[i+1], iySectorsEE[i+1]);
255 barrel_m[gId]->SetStats(0);
258 barrel_m[gId]->Draw(
"colz");
259 for(
int i = 0;
i <17;
i++) {
260 Double_t
x = 20.+ (
i *20);
261 l =
new TLine(x,-85.,x,86.);
264 l =
new TLine(0.,0.,360.,0.);
266 pad[gId + 3][1]->cd();
267 barrel_r[gId]->SetStats(0);
270 barrel_r[gId]->Draw(
"colz");
271 for(
int i = 0;
i <17;
i++) {
272 Double_t
x = 20.+ (
i *20);
273 l =
new TLine(x,-85.,x,86.);
276 l =
new TLine(0.,0.,360.,0.);
280 endc_p_m[gId]->SetStats(0);
283 endc_p_m[gId]->Draw(
"colz");
284 for (
int i=0;
i<201;
i=
i+1) {
285 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
286 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
287 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
288 ixSectorsEE[i+1], iySectorsEE[i+1]);
291 pad[gId + 3][2]->cd();
292 endc_p_r[gId]->SetStats(0);
295 endc_p_r[gId]->Draw(
"colz");
296 for (
int i=0;
i<201;
i=
i+1) {
297 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
298 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
299 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
300 ixSectorsEE[i+1], iySectorsEE[i+1]);
305 canvas.SaveAs(filename.c_str());
static std::string dumpXML(const EcalCondHeader &header, const EcalTPGLinearizationConst &record)
std::string plot(std::string const &, std::string const &, std::vector< int > const &, std::vector< float > const &) const
int gainId(sample_type sample)
get the gainId (2 bits)
static const int kBarlRings
std::vector< std::pair< std::string, float > > type_vValues
#define PYTHON_WRAPPER(_class, _name)
unsigned int total_values
static const int kBarlWedges
std::string summary() const
static const int kEndcWedgesX
EcalTPGLinearizationConstHelper()
EcalTPGLinearizationConstant EcalObject
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)
type_vValues getValues(const std::vector< EcalObject > &vItems) override
static const int kEndcWedgesY