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

Public Member Functions

 BoardVariations (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 861 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ BoardVariations()

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

Definition at line 872 of file TRTCalib_makeplots.cxx.

873{
874
875 cout << "In BoardVariations infile: " << infile << " detector " << det << endl;
876
877 // ofstream txtfile(Form("BoardVar_%i.txt",det),ios::out);
878
879 float t0, dt0, bindex;
880
881 minx = 0;
882 maxx = 289;
883 miny = 100;
884 maxy = -25;
885 if (abs(det) == 2)
886 maxx = 449;
887
888 this->SetName(Form("BoardT0Var_%i", det));
889
890 unique_ptr<TFile> file(new TFile(infile));
891
892 file->cd();
893 TNtuple *Boardtuple = (TNtuple *)file->Get("Board_Artuple");
894 TNtuple *BoardtupleXe = (TNtuple *)file->Get("Boardtuple");
895 Boardtuple->SetBranchAddress("t0", &t0);
896 Boardtuple->SetBranchAddress("dt0", &dt0);
897 if (abs(det) == 2)
898 {
899 BoardtupleXe->SetBranchAddress("t0", &t0);
900 BoardtupleXe->SetBranchAddress("dt0", &dt0);
901 }
902
903 int ipnt = 0;
904 if (abs(det) == 1)
905 {
906 for (int imod = 0; imod < 32; imod++)
907 {
908 for (int ibrd = 0; ibrd < 9; ibrd++)
909 {
910
911 bindex = 9 * imod + ibrd;
912
913 Boardtuple->Draw(">>tmplist", Form("brd==%i && det==%i && mod==%i", ibrd, det, imod));
914 TEventList *elist = (TEventList *)gDirectory->Get("tmplist");
915 for (int ib = 0; ib < elist->GetN(); ib++)
916 {
917 ipnt++;
918 Boardtuple->GetEntry(elist->GetEntry(ib));
919
920 if (t0 < miny)
921 miny = t0;
922 if (t0 > maxy)
923 maxy = t0;
924 this->SetPoint(ipnt, bindex + 1, t0);
925 this->SetPointError(ipnt, 0, dt0);
926
927 // txtfile << det << " " << bindex << " " << t0 << endl;
928 // txtfile << det << " " << bindex << " t0 " << t0 << " ibrd "<<ibrd<<" det "<<det<<" imod "<<imod<<endl;
929 }
930 }
931 }
932 }
933 else if (abs(det) == 2)
934 {
935 for (int imod = 0; imod < 32; imod++)
936 {
937 for (int ilay = 0; ilay < 14; ilay++)
938 {
939
940 bindex = 14 * imod + ilay;
941
942 Boardtuple->Draw(">>tmplist1", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
943 TEventList *elist = (TEventList *)gDirectory->Get("tmplist1");
944 for (int ib = 0; ib < elist->GetN(); ib++)
945 {
946 ipnt++;
947 Boardtuple->GetEntry(elist->GetEntry(ib));
948 this->SetPoint(ipnt, bindex + 1, t0);
949 this->SetPointError(ipnt, 0, dt0);
950 if (t0 < miny)
951 miny = t0;
952 if (t0 > maxy)
953 maxy = t0;
954 // txtfile << det << " " << bindex << " " << t0 << endl;
955 }
956
957 BoardtupleXe->Draw(">>tmplistXe", Form("lay==%i && det==%i && mod==%i", ilay, det, imod));
958 elist = (TEventList *)gDirectory->Get("tmplistXe");
959 for (int ib = 0; ib < elist->GetN(); ib++)
960 {
961 ipnt++;
962 BoardtupleXe->GetEntry(elist->GetEntry(ib));
963 this->SetPoint(ipnt, bindex + 1, t0);
964 this->SetPointError(ipnt, 0, dt0);
965 if (t0 < miny)
966 miny = t0;
967 if (t0 > maxy)
968 maxy = t0;
969 // txtfile << det << " " << bindex << " " << t0 << endl;
970 }
971 }
972 }
973 }
974
975 this->fMaximum = maxy;
976 this->fMinimum = miny;
977 if (det == 1)
978 {
979 this->SetTitle("Barrel Board T0s A side");
980 }
981 else if (det == -1)
982 {
983 this->SetTitle("Barrel Board T0s C side");
984 }
985 else if (det == 2)
986 {
987 this->SetTitle("Endcap Board T0s A side");
988 }
989 else if (det == -2)
990 {
991 this->SetTitle("Endcap Board T0s C side");
992 }
993
994 this->SetLineColor(4);
995 this->RemovePoint(0);
996
997 file->Close();
998 // txtfile.close();
999 cout << " found " << ipnt << " board t0s " << endl;
1000 // this->Print();
1001}
static Double_t t0
str infile
Definition run.py:13
TFile * file

Member Function Documentation

◆ DrawLines()

void BoardVariations::DrawLines ( )

Definition at line 1003 of file TRTCalib_makeplots.cxx.

1004{
1005
1006 this->GetYaxis()->SetTitle("T0_{board} / ns");
1007 this->GetXaxis()->SetTitle("board #");
1008 this->GetYaxis()->SetRangeUser(-0.1 + miny, 0.1 + maxy);
1009 // Increased range from 7-14 to 0-20 (PH Sept 2022))
1010 this->GetYaxis()->SetRangeUser(0.0, 20.0);
1011 miny = 0.0;
1012 maxy = 20.0;
1013 this->GetXaxis()->SetRangeUser(minx, maxx);
1014 this->Draw("AL");
1015 int nb = 9;
1016 if (maxx > 14)
1017 nb = 14;
1018 for (int imod = 1; imod <= (floor(int(maxx) / nb)); imod++)
1019 {
1020 TLine *lin = new TLine((float)imod * nb + 0.5, miny, (float)imod * nb + 0.5, maxy);
1021 lin->SetLineStyle(2);
1022 lin->Draw();
1023 }
1024}

◆ GetNpoints()

int BoardVariations::GetNpoints ( )
inline

Definition at line 866 of file TRTCalib_makeplots.cxx.

866{ return this->fNpoints; }

◆ GetX()

double * BoardVariations::GetX ( )
inline

Definition at line 867 of file TRTCalib_makeplots.cxx.

867{ return this->fX; }

◆ GetY()

double * BoardVariations::GetY ( )
inline

Definition at line 868 of file TRTCalib_makeplots.cxx.

868{ return this->fY; }

Member Data Documentation

◆ maxx

float BoardVariations::maxx

Definition at line 869 of file TRTCalib_makeplots.cxx.

◆ maxy

float BoardVariations::maxy

Definition at line 869 of file TRTCalib_makeplots.cxx.

◆ minx

float BoardVariations::minx

Definition at line 869 of file TRTCalib_makeplots.cxx.

◆ miny

float BoardVariations::miny

Definition at line 869 of file TRTCalib_makeplots.cxx.


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