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

Public Member Functions

 BoardVariationsRes (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 1292 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ BoardVariationsRes()

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

Definition at line 1303 of file TRTCalib_makeplots.cxx.

1304 {
1305 
1306  // ofstream txtfile(Form("BoardVarRes_%i.txt",det),ios::out);
1307 
1308  float t0{}, dt0{}, bindex{};
1309 
1310  minx = 0;
1311  maxx = 289;
1312  miny = 100;
1313  maxy = -100;
1314  if (abs(det) == 2)
1315  maxx = 449;
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 
1322  file->cd();
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  // cout << bindex+1 << " " << t0 << " " << dt0 << endl;
1352  if (t0 < miny)
1353  miny = t0;
1354  if (t0 > maxy)
1355  maxy = t0;
1356  this->SetPoint(ipnt, bindex + 1, t0);
1357  this->SetPointError(ipnt, 0, dt0);
1358  // txtfile << det << " " << bindex << " " << t0 << endl;
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);
1380  if (t0 < miny)
1381  miny = t0;
1382  if (t0 > maxy)
1383  maxy = t0;
1384  // txtfile << det << " " << bindex << " " << t0 << endl;
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);
1395  if (t0 < miny)
1396  miny = t0;
1397  if (t0 > maxy)
1398  maxy = t0;
1399  // txtfile << det << " " << bindex << " " << t0 << endl;
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 
1426  file->Close();
1427  // txtfile.close();
1428  cout << " found " << ipnt << " board t0s " << endl;
1429  // this->Print();
1430 }

Member Function Documentation

◆ DrawLines()

void BoardVariationsRes::DrawLines ( )

Definition at line 1432 of file TRTCalib_makeplots.cxx.

1433 {
1434 
1435  this->GetYaxis()->SetTitle("Residual{board} / um");
1436  this->GetXaxis()->SetTitle("board #");
1437  miny = 0.100;
1438  maxy = 0.200;
1439  this->GetYaxis()->SetRangeUser(miny, maxy);
1440  this->GetXaxis()->SetRangeUser(minx, maxx);
1441  this->Draw("AL");
1442  int nb = 9;
1443  if (maxx > 300)
1444  nb = 14;
1445  for (int imod = 1; imod <= (floor(int(maxx) / nb)); imod++)
1446  {
1447  TLine *lin = new TLine((float)imod * nb + 0.5, miny, (float)imod * nb + 0.5, maxy);
1448  lin->SetLineStyle(2);
1449  lin->Draw();
1450  }
1451 }

◆ GetNpoints()

int BoardVariationsRes::GetNpoints ( )
inline

Definition at line 1297 of file TRTCalib_makeplots.cxx.

1297 { return this->fNpoints; }

◆ GetX()

double* BoardVariationsRes::GetX ( )
inline

Definition at line 1298 of file TRTCalib_makeplots.cxx.

1298 { return this->fX; }

◆ GetY()

double* BoardVariationsRes::GetY ( )
inline

Definition at line 1299 of file TRTCalib_makeplots.cxx.

1299 { return this->fY; }

Member Data Documentation

◆ maxx

float BoardVariationsRes::maxx

Definition at line 1300 of file TRTCalib_makeplots.cxx.

◆ maxy

float BoardVariationsRes::maxy

Definition at line 1300 of file TRTCalib_makeplots.cxx.

◆ minx

float BoardVariationsRes::minx

Definition at line 1300 of file TRTCalib_makeplots.cxx.

◆ miny

float BoardVariationsRes::miny

Definition at line 1300 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
BoardVariationsRes::miny
float miny
Definition: TRTCalib_makeplots.cxx:1300
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
file
TFile * file
Definition: tile_monitor.h:29
BoardVariationsRes::maxx
float maxx
Definition: TRTCalib_makeplots.cxx:1300
BoardVariationsRes::minx
float minx
Definition: TRTCalib_makeplots.cxx:1300
hotSpotInTAG.nb
nb
Definition: hotSpotInTAG.py:164
BoardVariationsRes::maxy
float maxy
Definition: TRTCalib_makeplots.cxx:1300