1304{
1305
1306
1307
1308 float t0{},
dt0{}, bindex{};
1309
1314 if (abs(det) == 2)
1316
1317 this->SetName(Form("BoardResVar_%i", det));
1318
1319 unique_ptr<TFile>
file(
new TFile(infile));
1320 cout <<
"In BoardVariationsRes infile: " << string(infile) <<
" detector " <<
det << endl;
1321
1323
1324 TNtuple *BoardtupleRes = (TNtuple *)
file->Get(
"Board_Artuple");
1325 TNtuple *BoardtupleXe = (TNtuple *)
file->Get(
"Boardtuple");
1326
1327 BoardtupleRes->SetBranchAddress(
"res", &
t0);
1328 BoardtupleRes->SetBranchAddress("dres", &dt0);
1329 if (abs(det) == 2)
1330 {
1331 BoardtupleXe->SetBranchAddress(
"res", &
t0);
1332 BoardtupleXe->SetBranchAddress("dres", &dt0);
1333 }
1334
1335 int ipnt = 0;
1336 if (abs(det) == 1)
1337 {
1338 for (int imod = 0; imod < 32; imod++)
1339 {
1340 for (int ibrd = 0; ibrd < 9; ibrd++)
1341 {
1342
1343 bindex = 9 * imod + ibrd;
1344
1345 BoardtupleRes->Draw(">>tmplist", Form("brd==%i && det==%i && mod==%i", ibrd, det, imod));
1346 TEventList *elist = (TEventList *)
gDirectory->Get(
"tmplist");
1347 for (
int ib = 0;
ib < elist->GetN();
ib++)
1348 {
1349 ipnt++;
1350 BoardtupleRes->GetEntry(elist->GetEntry(ib));
1351
1356 this->SetPoint(ipnt, bindex + 1,
t0);
1357 this->SetPointError(ipnt, 0, dt0);
1358
1359 }
1360 }
1361 }
1362 }
1363 else if (abs(det) == 2)
1364 {
1365 for (int imod = 0; imod < 32; imod++)
1366 {
1367 for (int ilay = 0; ilay < 14; ilay++)
1368 {
1369
1370 bindex = 14 * imod + ilay;
1371
1372 BoardtupleRes->Draw(">>tmplist1", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
1373 TEventList *elist = (TEventList *)
gDirectory->Get(
"tmplist1");
1374 for (
int ib = 0;
ib < elist->GetN();
ib++)
1375 {
1376 ipnt++;
1377 BoardtupleRes->GetEntry(elist->GetEntry(ib));
1378 this->SetPoint(ipnt, bindex + 1,
t0);
1379 this->SetPointError(ipnt, 0, dt0);
1384
1385 }
1386
1387 BoardtupleXe->Draw(">>tmplistXe", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
1388 elist = (TEventList *)
gDirectory->Get(
"tmplistXe");
1389 for (
int ib = 0;
ib < elist->GetN();
ib++)
1390 {
1391 ipnt++;
1392 BoardtupleXe->GetEntry(elist->GetEntry(ib));
1393 this->SetPoint(ipnt, bindex + 1,
t0);
1394 this->SetPointError(ipnt, 0, dt0);
1399
1400 }
1401 }
1402 }
1403 }
1404
1405 if (det == 1)
1406 {
1407 this->SetTitle("Barrel Board Residuals A side");
1408 }
1409 else if (det == -1)
1410 {
1411 this->SetTitle("Barrel Board Residuals C side");
1412 }
1413 else if (det == 2)
1414 {
1415 this->SetTitle("Endcap Board Residuals A side");
1416 }
1417 else if (det == -2)
1418 {
1419 this->SetTitle("Endcap Board Residuals C side");
1420 }
1421 this->SetLineColor(4);
1422 this->RemovePoint(0);
1423 this->fMaximum = 0.200;
1424 this->fMinimum = 0.100;
1425
1427
1428 cout << " found " << ipnt << " board t0s " << endl;
1429
1430}