135 std::cout <<
"Calculating Pedestal constants...\n";
136 std::vector<NewPedBunch>::iterator bunch_it;
137 for (bunch_it =
Bunches.begin(); bunch_it !=
Bunches.end(); ++bunch_it) {
138 if (bunch_it->usedflag) {
140 std::cout <<
"Analyzing channel sector= " << bunch_it->detid.sector()
141 <<
" module = " << bunch_it->detid.module() << std::endl;
143 bunch_it->cap[0] /= bunch_it->num[0][0];
144 bunch_it->cap[1] /= bunch_it->num[1][1];
145 bunch_it->cap[2] /= bunch_it->num[2][2];
146 bunch_it->cap[3] /= bunch_it->num[3][3];
147 bunch_it->capfc[0] /= bunch_it->num[0][0];
148 bunch_it->capfc[1] /= bunch_it->num[1][1];
149 bunch_it->capfc[2] /= bunch_it->num[2][2];
150 bunch_it->capfc[3] /= bunch_it->num[3][3];
152 bunch_it->sig[0][0] = (bunch_it->prod[0][0] / bunch_it->num[0][0]) - (bunch_it->cap[0] * bunch_it->cap[0]);
153 bunch_it->sig[0][1] = (bunch_it->prod[0][1] / bunch_it->num[0][1]) - (bunch_it->cap[0] * bunch_it->cap[1]);
154 bunch_it->sig[0][2] = (bunch_it->prod[0][2] / bunch_it->num[0][2]) - (bunch_it->cap[0] * bunch_it->cap[2]);
155 bunch_it->sig[0][3] = (bunch_it->prod[0][3] / bunch_it->num[0][3]) - (bunch_it->cap[0] * bunch_it->cap[3]);
156 bunch_it->sig[1][0] = (bunch_it->prod[1][0] / bunch_it->num[1][0]) - (bunch_it->cap[1] * bunch_it->cap[0]);
157 bunch_it->sig[1][1] = (bunch_it->prod[1][1] / bunch_it->num[1][1]) - (bunch_it->cap[1] * bunch_it->cap[1]);
158 bunch_it->sig[1][2] = (bunch_it->prod[1][2] / bunch_it->num[1][2]) - (bunch_it->cap[1] * bunch_it->cap[2]);
159 bunch_it->sig[1][3] = (bunch_it->prod[1][3] / bunch_it->num[1][3]) - (bunch_it->cap[1] * bunch_it->cap[3]);
160 bunch_it->sig[2][0] = (bunch_it->prod[2][0] / bunch_it->num[2][0]) - (bunch_it->cap[2] * bunch_it->cap[0]);
161 bunch_it->sig[2][1] = (bunch_it->prod[2][1] / bunch_it->num[2][1]) - (bunch_it->cap[2] * bunch_it->cap[1]);
162 bunch_it->sig[2][2] = (bunch_it->prod[2][2] / bunch_it->num[2][2]) - (bunch_it->cap[2] * bunch_it->cap[2]);
163 bunch_it->sig[2][3] = (bunch_it->prod[2][3] / bunch_it->num[2][3]) - (bunch_it->cap[2] * bunch_it->cap[3]);
164 bunch_it->sig[3][0] = (bunch_it->prod[3][0] / bunch_it->num[3][0]) - (bunch_it->cap[3] * bunch_it->cap[0]);
165 bunch_it->sig[3][1] = (bunch_it->prod[3][1] / bunch_it->num[3][1]) - (bunch_it->cap[3] * bunch_it->cap[1]);
166 bunch_it->sig[3][2] = (bunch_it->prod[3][2] / bunch_it->num[3][2]) - (bunch_it->cap[3] * bunch_it->cap[2]);
167 bunch_it->sig[3][3] = (bunch_it->prod[3][3] / bunch_it->num[3][3]) - (bunch_it->cap[3] * bunch_it->cap[3]);
169 bunch_it->sigfc[0][0] =
170 (bunch_it->prodfc[0][0] / bunch_it->num[0][0]) - (bunch_it->capfc[0] * bunch_it->capfc[0]);
171 bunch_it->sigfc[0][1] =
172 (bunch_it->prodfc[0][1] / bunch_it->num[0][1]) - (bunch_it->capfc[0] * bunch_it->capfc[1]);
173 bunch_it->sigfc[0][2] =
174 (bunch_it->prodfc[0][2] / bunch_it->num[0][2]) - (bunch_it->capfc[0] * bunch_it->capfc[2]);
175 bunch_it->sigfc[0][3] =
176 (bunch_it->prodfc[0][3] / bunch_it->num[0][3]) - (bunch_it->capfc[0] * bunch_it->capfc[3]);
177 bunch_it->sigfc[1][0] =
178 (bunch_it->prodfc[1][0] / bunch_it->num[1][0]) - (bunch_it->capfc[1] * bunch_it->capfc[0]);
179 bunch_it->sigfc[1][1] =
180 (bunch_it->prodfc[1][1] / bunch_it->num[1][1]) - (bunch_it->capfc[1] * bunch_it->capfc[1]);
181 bunch_it->sigfc[1][2] =
182 (bunch_it->prodfc[1][2] / bunch_it->num[1][2]) - (bunch_it->capfc[1] * bunch_it->capfc[2]);
183 bunch_it->sigfc[1][3] =
184 (bunch_it->prodfc[1][3] / bunch_it->num[1][3]) - (bunch_it->capfc[1] * bunch_it->capfc[3]);
185 bunch_it->sigfc[2][0] =
186 (bunch_it->prodfc[2][0] / bunch_it->num[2][0]) - (bunch_it->capfc[2] * bunch_it->capfc[0]);
187 bunch_it->sigfc[2][1] =
188 (bunch_it->prodfc[2][1] / bunch_it->num[2][1]) - (bunch_it->capfc[2] * bunch_it->capfc[1]);
189 bunch_it->sigfc[2][2] =
190 (bunch_it->prodfc[2][2] / bunch_it->num[2][2]) - (bunch_it->capfc[2] * bunch_it->capfc[2]);
191 bunch_it->sigfc[2][3] =
192 (bunch_it->prodfc[2][3] / bunch_it->num[2][3]) - (bunch_it->capfc[2] * bunch_it->capfc[3]);
193 bunch_it->sigfc[3][0] =
194 (bunch_it->prodfc[3][0] / bunch_it->num[3][0]) - (bunch_it->capfc[3] * bunch_it->capfc[0]);
195 bunch_it->sigfc[3][1] =
196 (bunch_it->prodfc[3][1] / bunch_it->num[3][1]) - (bunch_it->capfc[3] * bunch_it->capfc[1]);
197 bunch_it->sigfc[3][2] =
198 (bunch_it->prodfc[3][2] / bunch_it->num[3][2]) - (bunch_it->capfc[3] * bunch_it->capfc[2]);
199 bunch_it->sigfc[3][3] =
200 (bunch_it->prodfc[3][3] / bunch_it->num[3][3]) - (bunch_it->capfc[3] * bunch_it->capfc[3]);
202 for (
int i = 0;
i != 3;
i++) {
209 int fillphi = bunch_it->detid.sector();
214 dephist->Fill(bunch_it->detid.module(),
216 (bunch_it->cap[0] + bunch_it->cap[1] + bunch_it->cap[2] + bunch_it->cap[3]) / 4);
226 bunch_it->sig[3][3]);
229 widthsp.setSigma(0, 0, bunch_it->sig[0][0]);
230 widthsp.setSigma(0, 1, bunch_it->sig[0][1]);
231 widthsp.setSigma(0, 2, bunch_it->sig[0][2]);
232 widthsp.setSigma(0, 3, bunch_it->sig[0][3]);
233 widthsp.setSigma(1, 0, bunch_it->sig[1][0]);
234 widthsp.setSigma(1, 1, bunch_it->sig[1][1]);
235 widthsp.setSigma(1, 2, bunch_it->sig[1][2]);
236 widthsp.setSigma(1, 3, bunch_it->sig[1][3]);
237 widthsp.setSigma(2, 0, bunch_it->sig[2][0]);
238 widthsp.setSigma(2, 1, bunch_it->sig[2][1]);
239 widthsp.setSigma(2, 2, bunch_it->sig[2][2]);
240 widthsp.setSigma(2, 3, bunch_it->sig[2][3]);
241 widthsp.setSigma(3, 0, bunch_it->sig[3][0]);
242 widthsp.setSigma(3, 1, bunch_it->sig[3][1]);
243 widthsp.setSigma(3, 2, bunch_it->sig[3][2]);
244 widthsp.setSigma(3, 3, bunch_it->sig[3][3]);
252 bunch_it->sigfc[0][0],
253 bunch_it->sigfc[1][1],
254 bunch_it->sigfc[2][2],
255 bunch_it->sigfc[3][3]);
258 widthspfc.setSigma(0, 0, bunch_it->sigfc[0][0]);
259 widthspfc.setSigma(0, 1, bunch_it->sigfc[0][1]);
260 widthspfc.setSigma(0, 2, bunch_it->sigfc[0][2]);
261 widthspfc.setSigma(0, 3, bunch_it->sigfc[0][3]);
262 widthspfc.setSigma(1, 0, bunch_it->sigfc[1][0]);
263 widthspfc.setSigma(1, 1, bunch_it->sigfc[1][1]);
264 widthspfc.setSigma(1, 2, bunch_it->sigfc[1][2]);
265 widthspfc.setSigma(1, 3, bunch_it->sigfc[1][3]);
266 widthspfc.setSigma(2, 0, bunch_it->sigfc[2][0]);
267 widthspfc.setSigma(2, 1, bunch_it->sigfc[2][1]);
268 widthspfc.setSigma(2, 2, bunch_it->sigfc[2][2]);
269 widthspfc.setSigma(2, 3, bunch_it->sigfc[2][3]);
270 widthspfc.setSigma(3, 0, bunch_it->sigfc[3][0]);
271 widthspfc.setSigma(3, 1, bunch_it->sigfc[3][1]);
272 widthspfc.setSigma(3, 2, bunch_it->sigfc[3][2]);
273 widthspfc.setSigma(3, 3, bunch_it->sigfc[3][3]);
294 dephist->SetDrawOption(
"colz");
295 dephist->GetXaxis()->SetTitle(
"module");
296 dephist->GetYaxis()->SetTitle(
"sector");
298 std::stringstream tempstringout;
300 std::string name1 = tempstringout.str() +
"_pedplots_1d.png";
303 TStyle* theStyle =
new TStyle(
"style",
"null");
304 theStyle->SetPalette(1,
nullptr);
305 theStyle->SetCanvasDefH(1200);
306 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