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

Public Member Functions

 ChipVariations (char *, int)
 
void DrawLines (float, float)
 

Detailed Description

Definition at line 740 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ ChipVariations()

ChipVariations::ChipVariations ( char *  infile,
int  detector 
)

Definition at line 747 of file TRTCalib_makeplots.cxx.

748 {
749 
750  ofstream txtfile(Form("finedelays_%i.txt", detector), ios::out);
751 
752  float t0o, chip, dt0, rt0;
753  int nchip[9] = {10, 11, 15, 9, 9, 11, 12, 13, 14};
754 
755  this->SetBins(104, 0.5, 104.5);
756  this->SetName(Form("ChipT0Var_%i", detector));
757 
758  TFile *file = new TFile(infile);
759  cout << "In ChipVariations infile: " << infile << " detector " << detector << endl;
760  file->cd();
761  TNtuple *Chiptuple = (TNtuple *)file->Get("Chiptuple");
762 
763  Chiptuple->SetBranchAddress("rt0", &rt0);
764  Chiptuple->SetBranchAddress("t0offset", &t0o);
765  Chiptuple->SetBranchAddress("chp", &chip);
766  Chiptuple->SetBranchAddress("dt0", &dt0);
767 
768  int ic = 0;
769  for (int ibrd = 0; ibrd < 9; ibrd++)
770  {
771 
772  Chiptuple->Draw(">>tmplist", Form("brd==%i && t0offset!=0 && ftype>1 && det==%i", ibrd, detector));
773  TEventList *elist = (TEventList *)gDirectory->Get("tmplist");
774 
775  int mchip = 0;
776  for (int ib = 0; ib < elist->GetN(); ib++)
777  {
778  ic++;
779  Chiptuple->GetEntry(elist->GetEntry(ib));
780  if (ibrd < 2)
781  mchip = (int)chip;
782  if (ibrd >= 2 && ibrd < 5)
783  mchip = (int)chip + 21;
784  if (ibrd >= 5)
785  mchip = (int)chip + 21 + 33;
786  this->Fill(mchip, t0o);
787  }
788  }
789 
790  ic = 0;
791  for (int ibrd = 0; ibrd < 9; ibrd++)
792  {
793  for (int ichp = 0; ichp < nchip[ibrd]; ichp++)
794  {
795  int mchip = 0;
796  if (ibrd == 0)
797  mchip = ichp + 1;
798  if (ibrd == 1)
799  mchip = ichp + nchip[ibrd - 1] + 1;
800  if (ibrd == 2)
801  mchip = ichp + 1;
802  if (ibrd == 3)
803  mchip = ichp + nchip[ibrd - 1] + 1;
804  if (ibrd == 4)
805  mchip = ichp + nchip[ibrd - 1] + nchip[ibrd - 2] + 1;
806  if (ibrd == 5)
807  mchip = ichp + 1;
808  if (ibrd == 6)
809  mchip = ichp + nchip[ibrd - 1] + 1;
810  if (ibrd == 7)
811  mchip = ichp + nchip[ibrd - 1] + nchip[ibrd - 2] + 1;
812  if (ibrd == 8)
813  mchip = ichp + nchip[ibrd - 1] + nchip[ibrd - 2] + nchip[ibrd - 3] + 1;
814  txtfile << ibrd << " " << mchip << " " << detector << " " << ic << " " << this->GetBinContent(ic + 1) << endl;
815  ic++;
816  }
817  }
818 
819  // chg->RemovePoint(0);
820  this->SetTitle(Form("Chip T0 offset (phi-mod average, %c-side)", detlet[detector + 1]));
821  this->SetStats(kFALSE);
822  this->SetLineColor(2);
823  this->GetYaxis()->SetTitle("T0_{board}-T0_{chip} / ns");
824  this->GetXaxis()->SetTitle("chip #");
825 
826  txtfile.close();
827  file->Close();
828  delete file;
829 }

Member Function Documentation

◆ DrawLines()

void ChipVariations::DrawLines ( float  lowe,
float  upe 
)

Definition at line 831 of file TRTCalib_makeplots.cxx.

832 {
833  TLine *lin1 = new TLine(10.5, lowe, 10.5, upe);
834  lin1->SetLineStyle(2);
835  lin1->Draw();
836  TLine *lin2 = new TLine(21.5, lowe, 21.5, upe);
837  lin2->SetLineStyle(2);
838  lin2->Draw();
839  TLine *lin3 = new TLine(36.5, lowe, 36.5, upe);
840  lin3->SetLineStyle(2);
841  lin3->Draw();
842  TLine *lin4 = new TLine(45.5, lowe, 45.5, upe);
843  lin4->SetLineStyle(2);
844  lin4->Draw();
845  TLine *lin5 = new TLine(54.5, lowe, 54.5, upe);
846  lin5->SetLineStyle(2);
847  lin5->Draw();
848  TLine *lin6 = new TLine(65.5, lowe, 65.5, upe);
849  lin6->SetLineStyle(2);
850  lin6->Draw();
851  TLine *lin7 = new TLine(77.5, lowe, 77.5, upe);
852  lin7->SetLineStyle(2);
853  lin7->Draw();
854  TLine *lin8 = new TLine(90.5, lowe, 90.5, upe);
855  lin8->SetLineStyle(2);
856  lin8->Draw();
857 }

The documentation for this class was generated from the following file:
run.infile
string infile
Definition: run.py:13
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TRTCalib_cfilter.detector
detector
Definition: TRTCalib_cfilter.py:241
CalibDbCompareT0.dt0
dt0
Definition: CalibDbCompareT0.py:76
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
PlotCalibFromCool.ib
ib
Definition: PlotCalibFromCool.py:419
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
file
TFile * file
Definition: tile_monitor.h:29
grepfile.ic
int ic
Definition: grepfile.py:33
detlet
char detlet[3]
Definition: TRTCalib_makeplots.cxx:47