873{
874
875 cout <<
"In BoardVariations infile: " <<
infile <<
" detector " <<
det << endl;
876
877
878
879 float t0,
dt0, bindex;
880
885 if (abs(det) == 2)
887
888 this->SetName(Form("BoardT0Var_%i", det));
889
890 unique_ptr<TFile>
file(
new TFile(infile));
891
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
924 this->SetPoint(ipnt, bindex + 1,
t0);
925 this->SetPointError(ipnt, 0, dt0);
926
927
928
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);
954
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);
969
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
998
999 cout << " found " << ipnt << " board t0s " << endl;
1000
1001}