ATLAS Offline Software
Loading...
Searching...
No Matches
BoardVariationsOldT0 Class Reference
Inheritance diagram for BoardVariationsOldT0:
Collaboration diagram for BoardVariationsOldT0:

Public Member Functions

 BoardVariationsOldT0 (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 1136 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ BoardVariationsOldT0()

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

Definition at line 1147 of file TRTCalib_makeplots.cxx.

1148{
1149
1150 cout << "In BoardVariationsOldT0 infile: " << string(infile) << " detector " << det << endl;
1151
1152 // ofstream txtfile(Form("BoardOldT0Var_%i.txt",det),ios::out);
1153
1154 float oldt0, bindex;
1155
1156 minx = 0;
1157 maxx = 289;
1158 miny = 100;
1159 maxy = -25;
1160 if (abs(det) == 2)
1161 maxx = 449;
1162
1163 this->SetName(Form("BoardOldT0Var_%i", det));
1164
1165 unique_ptr<TFile> file(new TFile(infile));
1166
1167 file->cd();
1168 TNtuple *Boardtuple = (TNtuple *)file->Get("Board_Artuple");
1169 TNtuple *BoardtupleXe = (TNtuple *)file->Get("Boardtuple");
1170
1171 Boardtuple->SetBranchAddress("oldt0", &oldt0);
1172 if (abs(det) == 2)
1173 BoardtupleXe->SetBranchAddress("oldt0", &oldt0);
1174
1175 int ipnt = 0;
1176 if (abs(det) == 1)
1177 {
1178
1179 for (int imod = 0; imod < 32; imod++)
1180 {
1181 for (int ibrd = 0; ibrd < 9; ibrd++)
1182 {
1183
1184 bindex = 9 * imod + ibrd;
1185
1186 Boardtuple->Draw(">>tmplist", Form("brd==%i && det==%i && mod==%i", ibrd, det, imod));
1187 TEventList *elist = (TEventList *)gDirectory->Get("tmplist");
1188 for (int ib = 0; ib < elist->GetN(); ib++)
1189 {
1190 ipnt++;
1191 Boardtuple->GetEntry(elist->GetEntry(ib));
1192 if (oldt0 < miny)
1193 miny = oldt0;
1194 if (oldt0 > maxy)
1195 maxy = oldt0;
1196 this->SetPoint(ipnt, bindex + 1, oldt0);
1197 // txtfile << det << " " << bindex << " " << oldt0 << endl;
1198 }
1199 }
1200 }
1201 }
1202 else if (abs(det) == 2)
1203 {
1204 for (int imod = 0; imod < 32; imod++)
1205 {
1206 for (int ilay = 0; ilay < 14; ilay++)
1207 {
1208
1209 bindex = 14 * imod + ilay;
1210
1211 Boardtuple->Draw(">>tmplist1", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
1212 TEventList *elist = (TEventList *)gDirectory->Get("tmplist1");
1213 for (int ib = 0; ib < elist->GetN(); ib++)
1214 {
1215 ipnt++;
1216 Boardtuple->GetEntry(elist->GetEntry(ib));
1217 this->SetPoint(ipnt, bindex + 1, oldt0);
1218 if (oldt0 < miny)
1219 miny = oldt0;
1220 if (oldt0 > maxy)
1221 maxy = oldt0;
1222 // txtfile << det << " " << bindex << " " << t0 << endl;
1223 }
1224
1225 BoardtupleXe->Draw(">>tmplistXe", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
1226 elist = (TEventList *)gDirectory->Get("tmplistXe");
1227 for (int ib = 0; ib < elist->GetN(); ib++)
1228 {
1229 ipnt++;
1230 BoardtupleXe->GetEntry(elist->GetEntry(ib));
1231 this->SetPoint(ipnt, bindex + 1, oldt0);
1232 if (oldt0 < miny)
1233 miny = oldt0;
1234 if (oldt0 > maxy)
1235 maxy = oldt0;
1236 // txtfile << det << " " << bindex << " " << t0 << endl;
1237 }
1238 }
1239 }
1240 }
1241
1242 this->fMaximum = maxy;
1243 this->fMinimum = miny;
1244
1245 if (abs(det) == 1)
1246 {
1247 this->SetTitle(Form("Barrel Board T0s (%c-side)", detlet[det + 1]));
1248 }
1249 else
1250 {
1251 if ((det + 1)>=3){
1252 throw std::runtime_error("detlet[det + 1] is out of bounds");
1253 }
1254 this->SetTitle(Form("Endcap Board T0s (%c-side)", detlet[det + 1]));
1255 }
1256 this->SetLineColor(4);
1257 this->RemovePoint(0);
1258
1259 this->GetYaxis()->SetRangeUser(9, 10.7);
1260
1261 file->Close();
1262 // txtfile.close();
1263 cout << " found " << ipnt << " board t0s " << endl;
1264 // this->Print();
1265}
char detlet[3]
TFile * file

Member Function Documentation

◆ DrawLines()

void BoardVariationsOldT0::DrawLines ( )

Definition at line 1267 of file TRTCalib_makeplots.cxx.

1268{
1269
1270 this->GetYaxis()->SetTitle("T0_{board} / ns");
1271 this->GetXaxis()->SetTitle("board #");
1272 // Increased range from 9-10.6 to 5-15 (PH Sept 2022)
1273 miny = 5.0;
1274 maxy = 15.0;
1275 this->GetYaxis()->SetRangeUser(miny, maxy);
1276 this->GetXaxis()->SetRangeUser(minx, maxx);
1277 this->Draw("AL");
1278 int nb = 9;
1279 if (maxx > 300)
1280 nb = 14;
1281 for (int imod = 1; imod <= (floor(int(maxx) / nb)); imod++)
1282 {
1283 TLine *lin = new TLine((float)imod * nb + 0.5, miny, (float)imod * nb + 0.5, maxy);
1284 lin->SetLineStyle(2);
1285 lin->Draw();
1286 }
1287}

◆ GetNpoints()

int BoardVariationsOldT0::GetNpoints ( )
inline

Definition at line 1141 of file TRTCalib_makeplots.cxx.

1141{ return this->fNpoints; }

◆ GetX()

double * BoardVariationsOldT0::GetX ( )
inline

Definition at line 1142 of file TRTCalib_makeplots.cxx.

1142{ return this->fX; }

◆ GetY()

double * BoardVariationsOldT0::GetY ( )
inline

Definition at line 1143 of file TRTCalib_makeplots.cxx.

1143{ return this->fY; }

Member Data Documentation

◆ maxx

float BoardVariationsOldT0::maxx

Definition at line 1144 of file TRTCalib_makeplots.cxx.

◆ maxy

float BoardVariationsOldT0::maxy

Definition at line 1144 of file TRTCalib_makeplots.cxx.

◆ minx

float BoardVariationsOldT0::minx

Definition at line 1144 of file TRTCalib_makeplots.cxx.

◆ miny

float BoardVariationsOldT0::miny

Definition at line 1144 of file TRTCalib_makeplots.cxx.


The documentation for this class was generated from the following file: