31 std::cout <<
"Calculating Pedestal constants...\n";
32 std::vector<NewPedBunch>::iterator bunch_it;
33 for(bunch_it=
Bunches.begin(); bunch_it !=
Bunches.end(); ++bunch_it)
35 if(bunch_it->usedflag){
38 <<
" module = " << bunch_it->detid.module()
41 bunch_it->cap[0] /= bunch_it->num[0][0];
42 bunch_it->cap[1] /= bunch_it->num[1][1];
43 bunch_it->cap[2] /= bunch_it->num[2][2];
44 bunch_it->cap[3] /= bunch_it->num[3][3];
45 bunch_it->capfc[0] /= bunch_it->num[0][0];
46 bunch_it->capfc[1] /= bunch_it->num[1][1];
47 bunch_it->capfc[2] /= bunch_it->num[2][2];
48 bunch_it->capfc[3] /= bunch_it->num[3][3];
50 bunch_it->sig[0][0] = (bunch_it->prod[0][0]/bunch_it->num[0][0])-(bunch_it->cap[0]*bunch_it->cap[0]);
51 bunch_it->sig[0][1] = (bunch_it->prod[0][1]/bunch_it->num[0][1])-(bunch_it->cap[0]*bunch_it->cap[1]);
52 bunch_it->sig[0][2] = (bunch_it->prod[0][2]/bunch_it->num[0][2])-(bunch_it->cap[0]*bunch_it->cap[2]);
53 bunch_it->sig[0][3] = (bunch_it->prod[0][3]/bunch_it->num[0][3])-(bunch_it->cap[0]*bunch_it->cap[3]);
54 bunch_it->sig[1][0] = (bunch_it->prod[1][0]/bunch_it->num[1][0])-(bunch_it->cap[1]*bunch_it->cap[0]);
55 bunch_it->sig[1][1] = (bunch_it->prod[1][1]/bunch_it->num[1][1])-(bunch_it->cap[1]*bunch_it->cap[1]);
56 bunch_it->sig[1][2] = (bunch_it->prod[1][2]/bunch_it->num[1][2])-(bunch_it->cap[1]*bunch_it->cap[2]);
57 bunch_it->sig[1][3] = (bunch_it->prod[1][3]/bunch_it->num[1][3])-(bunch_it->cap[1]*bunch_it->cap[3]);
58 bunch_it->sig[2][0] = (bunch_it->prod[2][0]/bunch_it->num[2][0])-(bunch_it->cap[2]*bunch_it->cap[0]);
59 bunch_it->sig[2][1] = (bunch_it->prod[2][1]/bunch_it->num[2][1])-(bunch_it->cap[2]*bunch_it->cap[1]);
60 bunch_it->sig[2][2] = (bunch_it->prod[2][2]/bunch_it->num[2][2])-(bunch_it->cap[2]*bunch_it->cap[2]);
61 bunch_it->sig[2][3] = (bunch_it->prod[2][3]/bunch_it->num[2][3])-(bunch_it->cap[2]*bunch_it->cap[3]);
62 bunch_it->sig[3][0] = (bunch_it->prod[3][0]/bunch_it->num[3][0])-(bunch_it->cap[3]*bunch_it->cap[0]);
63 bunch_it->sig[3][1] = (bunch_it->prod[3][1]/bunch_it->num[3][1])-(bunch_it->cap[3]*bunch_it->cap[1]);
64 bunch_it->sig[3][2] = (bunch_it->prod[3][2]/bunch_it->num[3][2])-(bunch_it->cap[3]*bunch_it->cap[2]);
65 bunch_it->sig[3][3] = (bunch_it->prod[3][3]/bunch_it->num[3][3])-(bunch_it->cap[3]*bunch_it->cap[3]);
67 bunch_it->sigfc[0][0] = (bunch_it->prodfc[0][0]/bunch_it->num[0][0])-(bunch_it->capfc[0]*bunch_it->capfc[0]);
68 bunch_it->sigfc[0][1] = (bunch_it->prodfc[0][1]/bunch_it->num[0][1])-(bunch_it->capfc[0]*bunch_it->capfc[1]);
69 bunch_it->sigfc[0][2] = (bunch_it->prodfc[0][2]/bunch_it->num[0][2])-(bunch_it->capfc[0]*bunch_it->capfc[2]);
70 bunch_it->sigfc[0][3] = (bunch_it->prodfc[0][3]/bunch_it->num[0][3])-(bunch_it->capfc[0]*bunch_it->capfc[3]);
71 bunch_it->sigfc[1][0] = (bunch_it->prodfc[1][0]/bunch_it->num[1][0])-(bunch_it->capfc[1]*bunch_it->capfc[0]);
72 bunch_it->sigfc[1][1] = (bunch_it->prodfc[1][1]/bunch_it->num[1][1])-(bunch_it->capfc[1]*bunch_it->capfc[1]);
73 bunch_it->sigfc[1][2] = (bunch_it->prodfc[1][2]/bunch_it->num[1][2])-(bunch_it->capfc[1]*bunch_it->capfc[2]);
74 bunch_it->sigfc[1][3] = (bunch_it->prodfc[1][3]/bunch_it->num[1][3])-(bunch_it->capfc[1]*bunch_it->capfc[3]);
75 bunch_it->sigfc[2][0] = (bunch_it->prodfc[2][0]/bunch_it->num[2][0])-(bunch_it->capfc[2]*bunch_it->capfc[0]);
76 bunch_it->sigfc[2][1] = (bunch_it->prodfc[2][1]/bunch_it->num[2][1])-(bunch_it->capfc[2]*bunch_it->capfc[1]);
77 bunch_it->sigfc[2][2] = (bunch_it->prodfc[2][2]/bunch_it->num[2][2])-(bunch_it->capfc[2]*bunch_it->capfc[2]);
78 bunch_it->sigfc[2][3] = (bunch_it->prodfc[2][3]/bunch_it->num[2][3])-(bunch_it->capfc[2]*bunch_it->capfc[3]);
79 bunch_it->sigfc[3][0] = (bunch_it->prodfc[3][0]/bunch_it->num[3][0])-(bunch_it->capfc[3]*bunch_it->capfc[0]);
80 bunch_it->sigfc[3][1] = (bunch_it->prodfc[3][1]/bunch_it->num[3][1])-(bunch_it->capfc[3]*bunch_it->capfc[1]);
81 bunch_it->sigfc[3][2] = (bunch_it->prodfc[3][2]/bunch_it->num[3][2])-(bunch_it->capfc[3]*bunch_it->capfc[2]);
82 bunch_it->sigfc[3][3] = (bunch_it->prodfc[3][3]/bunch_it->num[3][3])-(bunch_it->capfc[3]*bunch_it->capfc[3]);
84 for(
int i = 0;
i != 3;
i++){
93 int fillphi = bunch_it->detid.sector();
98 dephist->Fill( bunch_it->detid.module(),fillphi,
99 (bunch_it->cap[0]+bunch_it->cap[1]+bunch_it->cap[2]+bunch_it->cap[3])/4);
101 const CastorPedestal item(bunch_it->detid, bunch_it->cap[0], bunch_it->cap[1], bunch_it->cap[2], bunch_it->cap[3],
102 bunch_it->sig[0][0], bunch_it->sig[1][1], bunch_it->sig[2][2], bunch_it->sig[3][3]);
105 widthsp.setSigma(0,0,bunch_it->sig[0][0]);
106 widthsp.setSigma(0,1,bunch_it->sig[0][1]);
107 widthsp.setSigma(0,2,bunch_it->sig[0][2]);
108 widthsp.setSigma(0,3,bunch_it->sig[0][3]);
109 widthsp.setSigma(1,0,bunch_it->sig[1][0]);
110 widthsp.setSigma(1,1,bunch_it->sig[1][1]);
111 widthsp.setSigma(1,2,bunch_it->sig[1][2]);
112 widthsp.setSigma(1,3,bunch_it->sig[1][3]);
113 widthsp.setSigma(2,0,bunch_it->sig[2][0]);
114 widthsp.setSigma(2,1,bunch_it->sig[2][1]);
115 widthsp.setSigma(2,2,bunch_it->sig[2][2]);
116 widthsp.setSigma(2,3,bunch_it->sig[2][3]);
117 widthsp.setSigma(3,0,bunch_it->sig[3][0]);
118 widthsp.setSigma(3,1,bunch_it->sig[3][1]);
119 widthsp.setSigma(3,2,bunch_it->sig[3][2]);
120 widthsp.setSigma(3,3,bunch_it->sig[3][3]);
123 const CastorPedestal itemfc(bunch_it->detid, bunch_it->capfc[0], bunch_it->capfc[1], bunch_it->capfc[2], bunch_it->capfc[3],
124 bunch_it->sigfc[0][0], bunch_it->sigfc[1][1], bunch_it->sigfc[2][2], bunch_it->sigfc[3][3]);
127 widthspfc.setSigma(0,0,bunch_it->sigfc[0][0]);
128 widthspfc.setSigma(0,1,bunch_it->sigfc[0][1]);
129 widthspfc.setSigma(0,2,bunch_it->sigfc[0][2]);
130 widthspfc.setSigma(0,3,bunch_it->sigfc[0][3]);
131 widthspfc.setSigma(1,0,bunch_it->sigfc[1][0]);
132 widthspfc.setSigma(1,1,bunch_it->sigfc[1][1]);
133 widthspfc.setSigma(1,2,bunch_it->sigfc[1][2]);
134 widthspfc.setSigma(1,3,bunch_it->sigfc[1][3]);
135 widthspfc.setSigma(2,0,bunch_it->sigfc[2][0]);
136 widthspfc.setSigma(2,1,bunch_it->sigfc[2][1]);
137 widthspfc.setSigma(2,2,bunch_it->sigfc[2][2]);
138 widthspfc.setSigma(2,3,bunch_it->sigfc[2][3]);
139 widthspfc.setSigma(3,0,bunch_it->sigfc[3][0]);
140 widthspfc.setSigma(3,1,bunch_it->sigfc[3][1]);
141 widthspfc.setSigma(3,2,bunch_it->sigfc[3][2]);
142 widthspfc.setSigma(3,3,bunch_it->sigfc[3][3]);
175 dephist->SetDrawOption(
"colz");
176 dephist->GetXaxis()->SetTitle(
"module");
177 dephist->GetYaxis()->SetTitle(
"sector");
187 std::stringstream tempstringout;
189 std::string name1 = tempstringout.str() +
"_pedplots_1d.png";
190 std::string name2 = tempstringout.str() +
"_pedplots_2d.png";
192 TStyle *theStyle =
new TStyle(
"style",
"null");
193 theStyle->SetPalette(1,
nullptr);
194 theStyle->SetCanvasDefH(1200);
195 theStyle->SetCanvasDefW(1600);
std::vector< NewPedBunch > Bunches
std::string widthsfCfilename
std::string widthsADCfilename
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
std::string pedsADCfilename
bool addValues(const Item &myItem)
std::string pedsfCfilename