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

Public Member Functions

 BoardVariationsTRes (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 1631 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ BoardVariationsTRes()

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

Definition at line 1642 of file TRTCalib_makeplots.cxx.

1643 {
1644 
1645  // ofstream txtfile(Form("BoardVarTRes_%i.txt",det),ios::out);
1646 
1647  float t0, dt0, bindex;
1648 
1649  minx = 0;
1650  maxx = 289;
1651  miny = 100;
1652  maxy = -100;
1653  if (abs(det) == 2)
1654  maxx = 449;
1655 
1656  this->SetName(Form("BoardT0Var_%i", det));
1657 
1658  unique_ptr<TFile> file(new TFile(infile));
1659 
1660  cout << "In BoardVariationsTRes infile: " << string(infile) << " detector " << det << endl;
1661  file->cd();
1662  TNtuple *BoardtupleTRes = (TNtuple *)file->Get("Board_Artuple");
1663  TNtuple *BoardtupleXe = (TNtuple *)file->Get("Boardtuple");
1664 
1665  BoardtupleTRes->SetBranchAddress("tres", &t0);
1666  BoardtupleTRes->SetBranchAddress("dres", &dt0);
1667  if (abs(det) == 2)
1668  {
1669  BoardtupleXe->SetBranchAddress("tres", &t0);
1670  BoardtupleXe->SetBranchAddress("dres", &dt0);
1671  }
1672 
1673  int ipnt = 0;
1674  if (abs(det) == 1)
1675  {
1676  for (int imod = 0; imod < 32; imod++)
1677  {
1678  for (int ibrd = 0; ibrd < 9; ibrd++)
1679  {
1680 
1681  bindex = 9 * imod + ibrd;
1682 
1683  BoardtupleTRes->Draw(">>tmplist", Form("brd==%i && det==%i && mod==%i", ibrd, det, imod));
1684  TEventList *elist = (TEventList *)gDirectory->Get("tmplist");
1685  for (int ib = 0; ib < elist->GetN(); ib++)
1686  {
1687  ipnt++;
1688  BoardtupleTRes->GetEntry(elist->GetEntry(ib));
1689  this->SetPoint(ipnt, bindex + 1, t0);
1690  this->SetPointError(ipnt, 0, dt0);
1691  if (t0 < miny)
1692  miny = t0;
1693  if (t0 > maxy)
1694  maxy = t0;
1695  // txtfile << det << " " << bindex << " " << t0 << endl;
1696  }
1697  }
1698  }
1699  }
1700  else if (abs(det) == 2)
1701  {
1702  for (int imod = 0; imod < 32; imod++)
1703  {
1704  for (int ilay = 0; ilay < 14; ilay++)
1705  {
1706 
1707  bindex = 14 * imod + ilay;
1708 
1709  BoardtupleTRes->Draw(">>tmplist1", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
1710  TEventList *elist = (TEventList *)gDirectory->Get("tmplist1");
1711  for (int ib = 0; ib < elist->GetN(); ib++)
1712  {
1713  ipnt++;
1714  BoardtupleTRes->GetEntry(elist->GetEntry(ib));
1715  this->SetPoint(ipnt, bindex + 1, t0);
1716  this->SetPointError(ipnt, 0, dt0);
1717  if (t0 < miny)
1718  miny = t0;
1719  if (t0 > maxy)
1720  maxy = t0;
1721  // txtfile << det << " " << bindex << " " << t0 << endl;
1722  }
1723 
1724  BoardtupleXe->Draw(">>tmplistXe", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
1725  elist = (TEventList *)gDirectory->Get("tmplistXe");
1726  for (int ib = 0; ib < elist->GetN(); ib++)
1727  {
1728  ipnt++;
1729  BoardtupleXe->GetEntry(elist->GetEntry(ib));
1730  this->SetPoint(ipnt, bindex + 1, t0);
1731  this->SetPointError(ipnt, 0, dt0);
1732  if (t0 < miny)
1733  miny = t0;
1734  if (t0 > maxy)
1735  maxy = t0;
1736  // txtfile << det << " " << bindex << " " << t0 << endl;
1737  }
1738  }
1739  }
1740  }
1741 
1742  this->fMaximum = maxy;
1743  this->fMinimum = miny;
1744  if (abs(det) == 1)
1745  {
1746  // title set here, not sure why it doesnt work
1747  this->SetTitle(Form("Barrel Board Sigma Time Residuals (%c-side)", detlet[det + 1]));
1748  }
1749  else
1750  {
1751  if (det+1 >=3){
1752  throw std::out_of_range("Out-of-bounds access to the detlet array");
1753  }
1754  this->SetTitle(Form("Endcap Board Sigma Time Residuals (%c-side)", detlet[det + 1]));
1755  }
1756  this->SetLineColor(4);
1757  this->RemovePoint(0);
1758 
1759  file->Close();
1760  // txtfile.close();
1761  cout << " found " << ipnt << " board t0s " << endl;
1762  // this->Print();
1763 }

Member Function Documentation

◆ DrawLines()

void BoardVariationsTRes::DrawLines ( )

Definition at line 1765 of file TRTCalib_makeplots.cxx.

1766 {
1767 
1768  this->GetYaxis()->SetTitle("Board Sigma Time Residuals/ ns");
1769  this->GetXaxis()->SetTitle("board #");
1770  // Increased range from 3.0-3.7 to 1-5 (PH)
1771  miny = 1.0;
1772  maxy = 5.0;
1773  this->GetYaxis()->SetRangeUser(miny, maxy);
1774  this->GetXaxis()->SetRangeUser(minx, maxx);
1775  this->Draw("ALP");
1776  TLine *lin = new TLine(minx, 0, maxx, 0);
1777  lin->Draw();
1778  TLine *lin1 = new TLine(minx, 0.3, maxx, 0.3);
1779  lin1->SetLineStyle(2);
1780  lin1->Draw();
1781  TLine *lin2 = new TLine(minx, -0.3, maxx, -0.3);
1782  lin2->SetLineStyle(2);
1783  lin2->Draw();
1784  int nb = 9;
1785  if (maxx > 300)
1786  nb = 14;
1787  for (int imod = 1; imod <= (floor(int(maxx) / nb)); imod++)
1788  {
1789  TLine *lin = new TLine((float)imod * nb + 0.5, miny, (float)imod * nb + 0.5, maxy);
1790  lin->SetLineStyle(2);
1791  lin->Draw();
1792  }
1793 }

◆ GetNpoints()

int BoardVariationsTRes::GetNpoints ( )
inline

Definition at line 1636 of file TRTCalib_makeplots.cxx.

1636 { return this->fNpoints; }

◆ GetX()

double* BoardVariationsTRes::GetX ( )
inline

Definition at line 1637 of file TRTCalib_makeplots.cxx.

1637 { return this->fX; }

◆ GetY()

double* BoardVariationsTRes::GetY ( )
inline

Definition at line 1638 of file TRTCalib_makeplots.cxx.

1638 { return this->fY; }

Member Data Documentation

◆ maxx

float BoardVariationsTRes::maxx

Definition at line 1639 of file TRTCalib_makeplots.cxx.

◆ maxy

float BoardVariationsTRes::maxy

Definition at line 1639 of file TRTCalib_makeplots.cxx.

◆ minx

float BoardVariationsTRes::minx

Definition at line 1639 of file TRTCalib_makeplots.cxx.

◆ miny

float BoardVariationsTRes::miny

Definition at line 1639 of file TRTCalib_makeplots.cxx.


The documentation for this class was generated from the following file:
run.infile
string infile
Definition: run.py:13
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
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
file
TFile * file
Definition: tile_monitor.h:29
BoardVariationsTRes::maxy
float maxy
Definition: TRTCalib_makeplots.cxx:1639
BoardVariationsTRes::minx
float minx
Definition: TRTCalib_makeplots.cxx:1639
BoardVariationsTRes::miny
float miny
Definition: TRTCalib_makeplots.cxx:1639
hotSpotInTAG.nb
nb
Definition: hotSpotInTAG.py:164
BoardVariationsTRes::maxx
float maxx
Definition: TRTCalib_makeplots.cxx:1639
detlet
char detlet[3]
Definition: TRTCalib_makeplots.cxx:47