9 #include "TPaveStats.h"
57 vValues[0].second = .0;
58 vValues[1].second = .0;
59 vValues[2].second = .0;
60 vValues[3].second = .0;
61 vValues[4].second = .0;
62 vValues[5].second = .0;
66 vValues[0].first =
"mult_x12";
67 vValues[1].first =
"mult_x6";
68 vValues[2].first =
"mult_x1";
69 vValues[3].first =
"shift_x12";
70 vValues[4].first =
"shift_x6";
71 vValues[5].first =
"shift_x1";
76 for(std::vector<EcalObject>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems){
78 vValues[0].second += iItems->mult_x12;
79 vValues[1].second += iItems->mult_x6;
80 vValues[2].second += iItems->mult_x1;
81 vValues[3].second += iItems->shift_x12;
82 vValues[4].second += iItems->shift_x6;
83 vValues[5].second += iItems->shift_x1;
102 std::vector<int>
const&,
103 std::vector<float>
const& )
const {
104 gStyle->SetPalette(1);
106 const float IMG_SIZE = 1.5;
107 TCanvas
canvas(
"CC map",
"CC map",800 * IMG_SIZE,1200 * IMG_SIZE);
109 float xmi[3] = {0.0 , 0.22, 0.78};
110 float xma[3] = {0.22, 0.78, 1.00};
111 TPad***
pad =
new TPad**[6];
112 for (
int gId = 0; gId < 6; gId++) {
113 pad[gId] =
new TPad*[3];
115 float yma = 1.- (0.17 * gId);
116 float ymi = yma - 0.15;
117 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId),Form(
"p_%i_%i",
obj, gId),
118 xmi[
obj], ymi, xma[obj], yma);
119 pad[gId][
obj]->Draw();
123 const int kGains = 3;
124 const int gainValues[3] = {12, 6, 1};
131 TH2F** barrel_m =
new TH2F*[3];
132 TH2F** endc_p_m =
new TH2F*[3];
133 TH2F** endc_m_m =
new TH2F*[3];
134 TH2F** barrel_r =
new TH2F*[3];
135 TH2F** endc_p_r =
new TH2F*[3];
136 TH2F** endc_m_r =
new TH2F*[3];
138 barrel_m[
gainId] =
new TH2F(Form(
"mult_x12 EBm%i",
gainId),Form(
"mult_x%i EB",gainValues[
gainId]),360,0,360, 170, -85,85);
139 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);
140 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);
141 barrel_r[
gainId] =
new TH2F(Form(
"shift_x12 EBr%i",gainId),Form(
"shift_x%i EB",gainValues[gainId]),360,0,360, 170, -85,85);
142 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);
143 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);
146 for (
int sign=0; sign <
kSides; sign++) {
147 int thesign = sign==1 ? 1:-1;
153 if(sign == 1) y = ieta;
154 barrel_m[0]->Fill(iphi, y,
object()[
id.rawId()].mult_x12);
155 barrel_r[0]->Fill(iphi, y,
object()[
id.rawId()].shift_x12);
156 barrel_m[1]->Fill(iphi, y,
object()[
id.rawId()].mult_x6);
157 barrel_r[1]->Fill(iphi, y,
object()[
id.rawId()].shift_x6);
158 barrel_m[2]->Fill(iphi, y,
object()[
id.rawId()].mult_x1);
159 barrel_r[2]->Fill(iphi, y,
object()[
id.rawId()].shift_x1);
168 endc_p_m[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x12);
169 endc_p_r[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x12);
170 endc_p_m[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x6);
171 endc_p_r[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x6);
172 endc_p_m[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x1);
173 endc_p_r[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x1);
176 endc_m_m[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x12);
177 endc_m_r[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x12);
178 endc_m_m[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x6);
179 endc_m_r[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x6);
180 endc_m_m[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].mult_x1);
181 endc_m_r[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].shift_x1);
188 float bmin[3] ={0.7, 0.5, 0.4};
189 float bmax[3] ={1.7, 1.0, 0.8};
190 float emin[3] ={1.5, 0.8, 0.4};
191 float emax[3] ={2.5, 1.5, 0.8};
192 TLine*
l =
new TLine(0., 0., 0., 0.);
194 int ixSectorsEE[202] = {
195 62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42,
196 41, 41, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 46, 46, 56, 56, 58, 58, 59, 59,
197 60, 60, 61, 61, 62, 62, 0,101,101, 98, 98, 96, 96, 93, 93, 88, 88, 86, 86, 81,
198 81, 76, 76, 66, 66, 61, 61, 41, 41, 36, 36, 26, 26, 21, 21, 16, 16, 14, 14, 9,
199 9, 6, 6, 4, 4, 1, 1, 4, 4, 6, 6, 9, 9, 14, 14, 16, 16, 21, 21, 26,
200 26, 36, 36, 41, 41, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88, 93, 93, 96,
201 96, 98, 98,101,101, 0, 62, 66, 66, 71, 71, 81, 81, 91, 91, 93, 0, 62, 66, 66,
202 91, 91, 98, 0, 58, 61, 61, 66, 66, 71, 71, 76, 76, 81, 81, 0, 51, 51, 0, 44,
203 41, 41, 36, 36, 31, 31, 26, 26, 21, 21, 0, 40, 36, 36, 11, 11, 4, 0, 40, 36,
204 36, 31, 31, 21, 21, 11, 11, 9, 0, 46, 46, 41, 41, 36, 36, 0, 56, 56, 61, 61, 66, 66};
206 int iySectorsEE[202] = {
207 51, 56, 56, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 61, 61, 60, 60, 59, 59, 58,
208 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42, 41, 41, 40, 40, 41, 41, 42, 42, 43,
209 43, 44, 44, 46, 46, 51, 0, 51, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88,
210 93, 93, 96, 96, 98, 98,101,101, 98, 98, 96, 96, 93, 93, 88, 88, 86, 86, 81, 81,
211 76, 76, 66, 66, 61, 61, 41, 41, 36, 36, 26, 26, 21, 21, 16, 16, 14, 14, 9, 9,
212 6, 6, 4, 4, 1, 1, 4, 4, 6, 6, 9, 9, 14, 14, 16, 16, 21, 21, 26, 26,
213 36, 36, 41, 41, 51, 0, 46, 46, 41, 41, 36, 36, 31, 31, 26, 26, 0, 51, 51, 56,
214 56, 61, 61, 0, 61, 61, 66, 66, 71, 71, 76, 76, 86, 86, 88, 0, 62,101, 0, 61,
215 61, 66, 66, 71, 71, 76, 76, 86, 86, 88, 0, 51, 51, 56, 56, 61, 61, 0, 46, 46,
216 41, 41, 36, 36, 31, 31, 26, 26, 0, 40, 31, 31, 16, 16, 6, 0, 40, 31, 31, 16, 16, 6};
218 for (
int gId = 0; gId < 3; gId++) {
220 endc_m_m[gId]->SetStats(0);
223 endc_m_m[gId]->Draw(
"colz");
224 for (
int i=0;
i<201;
i=
i+1) {
225 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
226 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
227 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
228 ixSectorsEE[i+1], iySectorsEE[i+1]);
229 l->SetLineWidth(0.2);
232 pad[gId + 3][0]->cd();
233 endc_m_r[gId]->SetStats(0);
236 endc_m_r[gId]->Draw(
"colz");
237 for (
int i=0;
i<201;
i=
i+1) {
238 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
239 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
240 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
241 ixSectorsEE[i+1], iySectorsEE[i+1]);
246 barrel_m[gId]->SetStats(0);
249 barrel_m[gId]->Draw(
"colz");
250 for(
int i = 0;
i <17;
i++) {
251 Double_t
x = 20.+ (
i *20);
252 l =
new TLine(x,-85.,x,86.);
255 l =
new TLine(0.,0.,360.,0.);
257 pad[gId + 3][1]->cd();
258 barrel_r[gId]->SetStats(0);
261 barrel_r[gId]->Draw(
"colz");
262 for(
int i = 0;
i <17;
i++) {
263 Double_t
x = 20.+ (
i *20);
264 l =
new TLine(x,-85.,x,86.);
267 l =
new TLine(0.,0.,360.,0.);
271 endc_p_m[gId]->SetStats(0);
274 endc_p_m[gId]->Draw(
"colz");
275 for (
int i=0;
i<201;
i=
i+1) {
276 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
277 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
278 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
279 ixSectorsEE[i+1], iySectorsEE[i+1]);
282 pad[gId + 3][2]->cd();
283 endc_p_r[gId]->SetStats(0);
286 endc_p_r[gId]->Draw(
"colz");
287 for (
int i=0;
i<201;
i=
i+1) {
288 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
289 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
290 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
291 ixSectorsEE[i+1], iySectorsEE[i+1]);
296 canvas.SaveAs(filename.c_str());
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 bool validDetId(int crystal_ix, int crystal_iy, int iz)
static const int kBarlWedges
std::string summary() const
static const int kEndcWedgesX
EcalTPGLinearizationConstHelper()
EcalTPGLinearizationConstant EcalObject
type_vValues getValues(const std::vector< EcalObject > &vItems)
static const int MAX_IPHI
static const int MAX_IETA
std::string printBarrelsEndcaps(const std::vector< T > &barrelItems, const std::vector< T > &endcapItems)
static const int kEndcWedgesY