9 #include "TPaveStats.h"
55 vValues[0].first =
"mean_x12";
56 vValues[1].first =
"mean_x6";
57 vValues[2].first =
"mean_x1";
59 vValues[0].second = .0;
60 vValues[1].second = .0;
61 vValues[2].second = .0;
64 for(std::vector<EcalObject>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems){
66 vValues[0].second += iItems->mean_x12;
67 vValues[1].second += iItems->mean_x6;
68 vValues[2].second += iItems->mean_x1;
85 std::vector<int>
const&,
86 std::vector<float>
const& )
const {
87 gStyle->SetPalette(1);
88 const int TOTAL_IMAGES = 3;
89 const int TOTAL_PADS = 3;
92 const float IMG_SIZE = 1.3;
93 TCanvas
canvas(
"CC map",
"CC map",800*IMG_SIZE + 100, 200 * TOTAL_IMAGES*IMG_SIZE);
95 float xmi[3] = {0.0 , 0.22, 0.78};
96 float xma[3] = {0.22, 0.78, 1.00};
99 TPad***
pad =
new TPad**[TOTAL_IMAGES];
100 for (
int gId = 0; gId < TOTAL_IMAGES; gId++) {
101 pad[gId] =
new TPad*[TOTAL_PADS];
102 for (
int obj = 0;
obj < TOTAL_PADS;
obj++) {
103 float yma = 1. - (0.33 * gId);
104 float ymi = yma - 0.33;
105 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId),Form(
"p_%i_%i",
obj, gId),
106 xmi[
obj], ymi, xma[obj], yma);
107 pad[gId][
obj]->Draw();
111 const int kGains = 3;
112 const int gainValues[3] = {12, 6, 1};
119 TH2F** barrel_m =
new TH2F*[3];
120 TH2F** endc_p_m =
new TH2F*[3];
121 TH2F** endc_m_m =
new TH2F*[3];
125 std::string variableName =
"mean_x";
127 barrel_m[
gainId] =
new TH2F(Form((variableName +
"EBm%i").c_str(),
gainId),Form((variableName +
"%i EB").c_str(),gainValues[
gainId]),360,0,360, 170, -85,85);
128 endc_p_m[
gainId] =
new TH2F(Form((variableName +
"EE+m%i").c_str(),gainId),Form((variableName +
"%i EE+").c_str(),gainValues[gainId]),100,1,101,100,1,101);
129 endc_m_m[
gainId] =
new TH2F(Form((variableName +
"EE-m%i").c_str(),gainId),Form((variableName +
"%i EE-").c_str(),gainValues[gainId]),100,1,101,100,1,101);
135 for (
int sign=0; sign <
kSides; sign++) {
136 int thesign = sign==1 ? 1:-1;
142 if(sign == 1) y = ieta;
143 barrel_m[0]->Fill(iphi, y,
object()[
id.rawId()].
mean_x12);
144 barrel_m[1]->Fill(iphi, y,
object()[
id.rawId()].
mean_x6);
145 barrel_m[2]->Fill(iphi, y,
object()[
id.rawId()].mean_x1);
159 endc_p_m[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].
mean_x12);
160 endc_p_m[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].
mean_x6);
161 endc_p_m[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].mean_x1);
169 endc_m_m[0]->Fill(ix+1,iy+1,
object()[
id.rawId()].
mean_x12);
170 endc_m_m[1]->Fill(ix+1,iy+1,
object()[
id.rawId()].
mean_x6);
171 endc_m_m[2]->Fill(ix+1,iy+1,
object()[
id.rawId()].mean_x1);
187 TLine*
l =
new TLine(0., 0., 0., 0.);
189 int ixSectorsEE[202] = {
190 62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42,
191 41, 41, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 46, 46, 56, 56, 58, 58, 59, 59,
192 60, 60, 61, 61, 62, 62, 0,101,101, 98, 98, 96, 96, 93, 93, 88, 88, 86, 86, 81,
193 81, 76, 76, 66, 66, 61, 61, 41, 41, 36, 36, 26, 26, 21, 21, 16, 16, 14, 14, 9,
194 9, 6, 6, 4, 4, 1, 1, 4, 4, 6, 6, 9, 9, 14, 14, 16, 16, 21, 21, 26,
195 26, 36, 36, 41, 41, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88, 93, 93, 96,
196 96, 98, 98,101,101, 0, 62, 66, 66, 71, 71, 81, 81, 91, 91, 93, 0, 62, 66, 66,
197 91, 91, 98, 0, 58, 61, 61, 66, 66, 71, 71, 76, 76, 81, 81, 0, 51, 51, 0, 44,
198 41, 41, 36, 36, 31, 31, 26, 26, 21, 21, 0, 40, 36, 36, 11, 11, 4, 0, 40, 36,
199 36, 31, 31, 21, 21, 11, 11, 9, 0, 46, 46, 41, 41, 36, 36, 0, 56, 56, 61, 61, 66, 66};
201 int iySectorsEE[202] = {
202 51, 56, 56, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 61, 61, 60, 60, 59, 59, 58,
203 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42, 41, 41, 40, 40, 41, 41, 42, 42, 43,
204 43, 44, 44, 46, 46, 51, 0, 51, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88,
205 93, 93, 96, 96, 98, 98,101,101, 98, 98, 96, 96, 93, 93, 88, 88, 86, 86, 81, 81,
206 76, 76, 66, 66, 61, 61, 41, 41, 36, 36, 26, 26, 21, 21, 16, 16, 14, 14, 9, 9,
207 6, 6, 4, 4, 1, 1, 4, 4, 6, 6, 9, 9, 14, 14, 16, 16, 21, 21, 26, 26,
208 36, 36, 41, 41, 51, 0, 46, 46, 41, 41, 36, 36, 31, 31, 26, 26, 0, 51, 51, 56,
209 56, 61, 61, 0, 61, 61, 66, 66, 71, 71, 76, 76, 86, 86, 88, 0, 62,101, 0, 61,
210 61, 66, 66, 71, 71, 76, 76, 86, 86, 88, 0, 51, 51, 56, 56, 61, 61, 0, 46, 46,
211 41, 41, 36, 36, 31, 31, 26, 26, 0, 40, 31, 31, 16, 16, 6, 0, 40, 31, 31, 16, 16, 6};
213 for (
int gId = 0; gId < TOTAL_IMAGES; gId++) {
215 endc_m_m[gId]->SetStats(0);
218 endc_m_m[gId]->Draw(
"colz");
219 for (
int i=0;
i<201;
i=
i+1) {
220 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
221 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
222 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
223 ixSectorsEE[i+1], iySectorsEE[i+1]);
224 l->SetLineWidth(0.2);
243 barrel_m[gId]->SetStats(0);
246 barrel_m[gId]->Draw(
"colz");
247 for(
int i = 0;
i <17;
i++) {
248 Double_t
x = 20.+ (
i *20);
249 l =
new TLine(x,-85.,x,86.);
252 l =
new TLine(0.,0.,360.,0.);
270 endc_p_m[gId]->SetStats(0);
273 endc_p_m[gId]->Draw(
"colz");
274 for (
int i=0;
i<201;
i=
i+1) {
275 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
276 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
277 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
278 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
type_vValues getValues(const std::vector< EcalObject > &vItems)
static const int MAX_IPHI
EcalTPGPedestal EcalObject
static const int MAX_IETA
std::string printBarrelsEndcaps(const std::vector< T > &barrelItems, const std::vector< T > &endcapItems)
static const int kEndcWedgesY