1468{
1469
1470
1471
1472 cout <<
"In BoardVariationsTRes1 infile: " << string(infile) <<
" detector " <<
det << endl;
1473
1474 float t0{}, oldt0{},
dt0{}, bindex{}, t0offset{};
1475
1480 if (abs(det) == 2)
1482
1483 this->SetName(Form("BoardT0Var_%i", det));
1484
1485 unique_ptr<TFile>
file(
new TFile(infile));
1486
1488 TNtuple *BoardtupleTRes = (TNtuple *)
file->Get(
"Board_Artuple");
1489 TNtuple *BoardtupleXe = (TNtuple *)
file->Get(
"Boardtuple");
1490
1491 BoardtupleTRes->SetBranchAddress(
"t0", &
t0);
1492 BoardtupleTRes->SetBranchAddress("oldt0", &oldt0);
1493 BoardtupleTRes->SetBranchAddress("dt0", &dt0);
1494 BoardtupleTRes->SetBranchAddress("t0offset", &t0offset);
1495 if (abs(det) == 2)
1496 {
1497 BoardtupleXe->SetBranchAddress(
"t0", &
t0);
1498 BoardtupleXe->SetBranchAddress("oldt0", &oldt0);
1499 BoardtupleXe->SetBranchAddress("dt0", &dt0);
1500 BoardtupleXe->SetBranchAddress("t0offset", &t0offset);
1501 }
1502
1503 int ipnt = 0;
1504 if (abs(det) == 1)
1505 {
1506 for (int imod = 0; imod < 32; imod++)
1507 {
1508 for (int ibrd = 0; ibrd < 9; ibrd++)
1509 {
1510
1511 bindex = 9 * imod + ibrd;
1512
1513 BoardtupleTRes->Draw(">>tmplist", Form("brd==%i && det==%i && mod==%i", ibrd, det, imod));
1514 TEventList *elist = (TEventList *)
gDirectory->Get(
"tmplist");
1515 for (
int ib = 0;
ib < elist->GetN();
ib++)
1516 {
1517 ipnt++;
1518 BoardtupleTRes->GetEntry(elist->GetEntry(ib));
1523 this->SetPoint(ipnt, bindex + 1,
t0 - oldt0);
1524 this->SetPointError(ipnt, 0, dt0);
1525
1526 }
1527 }
1528 }
1529 }
1530 else if (abs(det) == 2)
1531 {
1532 for (int imod = 0; imod < 32; imod++)
1533 {
1534 for (int ilay = 0; ilay < 14; ilay++)
1535 {
1536
1537 bindex = 14 * imod + ilay;
1538
1539 BoardtupleTRes->Draw(">>tmplist1", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
1540 TEventList *elist = (TEventList *)
gDirectory->Get(
"tmplist1");
1541 for (
int ib = 0;
ib < elist->GetN();
ib++)
1542 {
1543 ipnt++;
1544 BoardtupleTRes->GetEntry(elist->GetEntry(ib));
1549 this->SetPoint(ipnt, bindex + 1,
t0 - oldt0);
1550 this->SetPointError(ipnt, 0, dt0);
1551
1552 }
1553
1554 BoardtupleXe->Draw(">>tmplistXe", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
1555 elist = (TEventList *)
gDirectory->Get(
"tmplistXe");
1556 for (
int ib = 0;
ib < elist->GetN();
ib++)
1557 {
1558 ipnt++;
1559 BoardtupleXe->GetEntry(elist->GetEntry(ib));
1564 this->SetPoint(ipnt, bindex + 1,
t0 - oldt0);
1565 this->SetPointError(ipnt, 0, dt0);
1566
1567 }
1568 }
1569 }
1570 }
1571
1572 if (det == 1)
1573 {
1574 this->SetTitle("Barrel Board T0 Difference (A side)");
1575 }
1576 else if (det == -1)
1577 {
1578 this->SetTitle("Barrel Board T0 Difference (C side)");
1579 }
1580 else if (det == 2)
1581 {
1582 this->SetTitle("Endcap Board T0 Difference (A side)");
1583 }
1584 else if (det == -2)
1585 {
1586 this->SetTitle("Endcap Board T0 Difference (C side)");
1587 }
1588 this->SetLineColor(4);
1589 this->RemovePoint(0);
1590 this->GetYaxis()->SetRangeUser(9, 10.7);
1591
1593
1594 cout << " found " << ipnt << " board t0s " << endl;
1595
1596}