ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
BoardVariationsTRes1 Class Reference
Inheritance diagram for BoardVariationsTRes1:
Collaboration diagram for BoardVariationsTRes1:

Public Member Functions

 BoardVariationsTRes1 (char *, int)
 
void DrawLines ()
 
int GetNpoints ()
 
double * GetX ()
 
double * GetY ()
 

Public Attributes

float maxx
 
float maxy
 
float minx
 
float miny
 

Detailed Description

Definition at line 1456 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ BoardVariationsTRes1()

BoardVariationsTRes1::BoardVariationsTRes1 ( char *  infile,
int  det 
)

Definition at line 1467 of file TRTCalib_makeplots.cxx.

1468 {
1469 
1470  // ofstream txtfile(Form("BoardVarTRes1_%i.txt",det),ios::out);
1471 
1472  cout << "In BoardVariationsTRes1 infile: " << string(infile) << " detector " << det << endl;
1473 
1474  float t0{}, oldt0{}, dt0{}, bindex{}, t0offset{};
1475 
1476  minx = 0;
1477  maxx = 289;
1478  miny = 100;
1479  maxy = -100;
1480  if (abs(det) == 2)
1481  maxx = 449;
1482 
1483  this->SetName(Form("BoardT0Var_%i", det));
1484 
1485  unique_ptr<TFile> file(new TFile(infile));
1486 
1487  file->cd();
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));
1519  if ((t0 - oldt0) < miny)
1520  miny = t0 - oldt0;
1521  if ((t0 - oldt0) > maxy)
1522  maxy = t0 - oldt0;
1523  this->SetPoint(ipnt, bindex + 1, t0 - oldt0);
1524  this->SetPointError(ipnt, 0, dt0);
1525  // txtfile << det << " " << bindex << " " << t0-oldt0 << endl;
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));
1545  if ((t0 - oldt0) < miny)
1546  miny = t0 - oldt0;
1547  if ((t0 - oldt0) > maxy)
1548  maxy = t0 - oldt0;
1549  this->SetPoint(ipnt, bindex + 1, t0 - oldt0);
1550  this->SetPointError(ipnt, 0, dt0);
1551  // txtfile << det << " " << bindex << " " << t0-oldt0 << endl;
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));
1560  if ((t0 - oldt0) < miny)
1561  miny = t0 - oldt0;
1562  if ((t0 - oldt0) > maxy)
1563  maxy = t0 - oldt0;
1564  this->SetPoint(ipnt, bindex + 1, t0 - oldt0);
1565  this->SetPointError(ipnt, 0, dt0);
1566  // txtfile << det << " " << bindex << " " << t0-oldt0 << endl;
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 
1592  file->Close();
1593  // txtfile.close();
1594  cout << " found " << ipnt << " board t0s " << endl;
1595  // this->Print();
1596 }

Member Function Documentation

◆ DrawLines()

void BoardVariationsTRes1::DrawLines ( )

Definition at line 1598 of file TRTCalib_makeplots.cxx.

1599 {
1600 
1601  this->GetYaxis()->SetTitle("Board T0 Difference / ns");
1602  this->GetXaxis()->SetTitle("board #");
1603  // Increased range from -0.5 - 0.5 to -1 - 1 (PH)
1604  miny = -1.5;
1605  maxy = 1.5;
1606  this->GetYaxis()->SetRangeUser(miny, maxy);
1607  this->GetXaxis()->SetRangeUser(minx, maxx);
1608  this->Draw("AL");
1609  TLine *lin = new TLine(minx, 0, maxx, 0);
1610  lin->Draw();
1611  TLine *lin1 = new TLine(minx, 0.3, maxx, 0.3);
1612  lin1->SetLineStyle(2);
1613  lin1->Draw();
1614  TLine *lin2 = new TLine(minx, -0.3, maxx, -0.3);
1615  lin2->SetLineStyle(2);
1616  lin2->Draw();
1617  // int nb=9;
1618  // if(maxx>300) nb=14;
1619  for (int imod = 1; imod <= (floor(int(maxx) / 9)); imod++)
1620  { // need to change the upper limit for both board and
1621  // barrel T0 differences
1622  TLine *lin = new TLine((float)imod * 9 + 0.5, miny, (float)imod * 9 + 0.5, maxy);
1623  lin->SetLineStyle(2);
1624  lin->Draw();
1625  }
1626 }

◆ GetNpoints()

int BoardVariationsTRes1::GetNpoints ( )
inline

Definition at line 1461 of file TRTCalib_makeplots.cxx.

1461 { return this->fNpoints; }

◆ GetX()

double* BoardVariationsTRes1::GetX ( )
inline

Definition at line 1462 of file TRTCalib_makeplots.cxx.

1462 { return this->fX; }

◆ GetY()

double* BoardVariationsTRes1::GetY ( )
inline

Definition at line 1463 of file TRTCalib_makeplots.cxx.

1463 { return this->fY; }

Member Data Documentation

◆ maxx

float BoardVariationsTRes1::maxx

Definition at line 1464 of file TRTCalib_makeplots.cxx.

◆ maxy

float BoardVariationsTRes1::maxy

Definition at line 1464 of file TRTCalib_makeplots.cxx.

◆ minx

float BoardVariationsTRes1::minx

Definition at line 1464 of file TRTCalib_makeplots.cxx.

◆ miny

float BoardVariationsTRes1::miny

Definition at line 1464 of file TRTCalib_makeplots.cxx.


The documentation for this class was generated from the following file:
run.infile
string infile
Definition: run.py:13
BoardVariationsTRes1::maxx
float maxx
Definition: TRTCalib_makeplots.cxx:1464
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
CalibDbCompareT0.dt0
dt0
Definition: CalibDbCompareT0.py:76
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
PlotCalibFromCool.ib
ib
Definition: PlotCalibFromCool.py:419
BoardVariationsTRes1::maxy
float maxy
Definition: TRTCalib_makeplots.cxx:1464
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
file
TFile * file
Definition: tile_monitor.h:29
BoardVariationsTRes1::miny
float miny
Definition: TRTCalib_makeplots.cxx:1464
BoardVariationsTRes1::minx
float minx
Definition: TRTCalib_makeplots.cxx:1464