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

Public Member Functions

 BoardVariationsDiff (char *, 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 1028 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ BoardVariationsDiff()

BoardVariationsDiff::BoardVariationsDiff ( char *  infile_data,
char *  infile_ref,
int  det 
)

Definition at line 1039 of file TRTCalib_makeplots.cxx.

1040 {
1041 
1042  cout << "In BoardVariationsDiff infile_data: " << string(infile_data) << " infile_ref: " << string(infile_ref) << " detector " << det << endl;
1043 
1044  // ofstream txtfile(Form("BoardVarDiff_%i.txt",det),ios::out);
1045 
1046  float t0, dt0, oldt0, bindex;
1047 
1048  minx = 0;
1049  maxx = 289;
1050  miny = 1000;
1051  maxy = -1000;
1052  if (abs(det) == 2)
1053  maxx = 449;
1054 
1055  this->SetName(Form("BoardT0VarDiff_%i", det));
1056 
1057  unique_ptr<TFile> filedata(new TFile(infile_data));
1058  unique_ptr<TFile> fileref(new TFile(infile_ref));
1059 
1060  filedata->cd();
1061  TNtuple *Boardtuple_data = (TNtuple *)filedata->Get("Board_Artuple");
1062  fileref->cd();
1063  TNtuple *Boardtuple_ref = (TNtuple *)fileref->Get("Board_Artuple");
1064 
1065  Boardtuple_data->SetBranchAddress("t0", &t0);
1066  Boardtuple_data->SetBranchAddress("dt0", &dt0);
1067  Boardtuple_ref->SetBranchAddress("oldt0", &oldt0);
1068 
1069  int ipnt = 0;
1070  for (int imod = 0; imod < 32; imod++)
1071  {
1072  for (int ibrd = 0; ibrd < 9; ibrd++)
1073  {
1074 
1075  bindex = 9 * imod + ibrd;
1076 
1077  Boardtuple_data->Draw(">>tmplist", Form("brd==%i && det==%i && mod==%i", ibrd, det, imod));
1078  TEventList *elist = (TEventList *)gDirectory->Get("tmplist");
1079  for (int ib = 0; ib < elist->GetN(); ib++)
1080  {
1081  ipnt++;
1082  Boardtuple_data->GetEntry(elist->GetEntry(ib));
1083  Boardtuple_ref->GetEntry(elist->GetEntry(ib));
1084  if ((t0 - oldt0) < miny)
1085  miny = t0 - oldt0;
1086  if ((t0 - oldt0) > maxy)
1087  maxy = t0 - oldt0;
1088  this->SetPoint(ipnt, bindex + 1, t0 - oldt0);
1089  this->SetPointError(ipnt, 0, dt0);
1090  // txtfile << det << " " << bindex << " " << t0-oldt0 << endl;
1091  }
1092  }
1093  }
1094 
1095  // Increased margin from 0.1 to 0.2 (PH Sept 2022)
1096  this->fMaximum = maxy + 0.2;
1097  this->fMinimum = miny - 0.2;
1098  if ((det + 1)>=3){
1099  throw std::runtime_error("detlet[det + 1] is out of bounds");
1100  }
1101  this->SetTitle(Form("Board T0 - ref (%c-side)", detlet[det + 1]));
1102  this->SetLineColor(4);
1103  this->RemovePoint(0);
1104 
1105  filedata->Close();
1106 
1107  cout << " found " << ipnt << " board t0s " << endl;
1108  // this->Print();
1109 }

Member Function Documentation

◆ DrawLines()

void BoardVariationsDiff::DrawLines ( )

Definition at line 1111 of file TRTCalib_makeplots.cxx.

1112 {
1113 
1114  this->GetYaxis()->SetTitle("T0_{board}-ref / ns");
1115  this->GetXaxis()->SetTitle("board #");
1116  // Increased margin from 0.1 to 0.2 (PH Sept 2022)
1117  this->GetYaxis()->SetRangeUser(-0.2 + miny, 0.2 + maxy);
1118  this->GetXaxis()->SetRangeUser(minx, maxx);
1119  this->Draw("AP");
1120  int nb = 9;
1121  if (maxx > 300)
1122  nb = 14;
1123  TLine *lin = new TLine(minx, 0, maxx, 0);
1124  lin->SetLineColor(2);
1125  lin->Draw();
1126  for (int imod = 1; imod <= (floor(int(maxx) / nb)); imod++)
1127  {
1128  TLine *lin = new TLine((float)imod * nb + 0.5, this->fMinimum, (float)imod * nb + 0.5, this->fMaximum);
1129  lin->SetLineStyle(2);
1130  lin->Draw();
1131  }
1132 }

◆ GetNpoints()

int BoardVariationsDiff::GetNpoints ( )
inline

Definition at line 1033 of file TRTCalib_makeplots.cxx.

1033 { return this->fNpoints; }

◆ GetX()

double* BoardVariationsDiff::GetX ( )
inline

Definition at line 1034 of file TRTCalib_makeplots.cxx.

1034 { return this->fX; }

◆ GetY()

double* BoardVariationsDiff::GetY ( )
inline

Definition at line 1035 of file TRTCalib_makeplots.cxx.

1035 { return this->fY; }

Member Data Documentation

◆ maxx

float BoardVariationsDiff::maxx

Definition at line 1036 of file TRTCalib_makeplots.cxx.

◆ maxy

float BoardVariationsDiff::maxy

Definition at line 1036 of file TRTCalib_makeplots.cxx.

◆ minx

float BoardVariationsDiff::minx

Definition at line 1036 of file TRTCalib_makeplots.cxx.

◆ miny

float BoardVariationsDiff::miny

Definition at line 1036 of file TRTCalib_makeplots.cxx.


The documentation for this class was generated from the following file:
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
BoardVariationsDiff::maxy
float maxy
Definition: TRTCalib_makeplots.cxx:1036
BoardVariationsDiff::maxx
float maxx
Definition: TRTCalib_makeplots.cxx:1036
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
BoardVariationsDiff::minx
float minx
Definition: TRTCalib_makeplots.cxx:1036
BoardVariationsDiff::miny
float miny
Definition: TRTCalib_makeplots.cxx:1036
hotSpotInTAG.nb
nb
Definition: hotSpotInTAG.py:164
detlet
char detlet[3]
Definition: TRTCalib_makeplots.cxx:47