1 Int_t AliTOFanalyzeSDigits(TString headersFile, Int_t iEvNum=0)
4 // Analyzes the TOF sdigits and fills QA-histograms
6 // iEvNum=0 means all events in the file
10 TFile * file = (TFile*) gROOT->GetFile(headersFile.Data() ) ;
12 //File was not opened yet
15 if(headersFile.Contains("rfio"))
16 file = TFile::Open(headersFile,"update") ;
18 file = new TFile(headersFile.Data(),"update") ;
19 gAlice = (AliRun *) file->Get("gAlice") ;
23 if (iEvNum == 0) iEvNum = (Int_t) gAlice->TreeE()->GetEntries();
26 AliTOFSDigit *tofsdigit;
28 AliTOF * tof = (AliTOF *) gAlice->GetDetector("TOF") ;
31 cout << "<AliTOFanalyzeSDigits> No TOF detector found" << endl;
37 TH1F *htdc = new TH1F("htdc","TDC [bin]",5000,0.,150000.);
38 TH1F *hadc = new TH1F("hadc","ADC [bin]",100,0., 3000.);
41 TH1F *hsector = new TH1F("hsector","Sector",20,0.,20.);
42 TH1F *hplate = new TH1F("hplate","Plate ", 6,0., 6.);
43 TH1F *hstrip = new TH1F("hstrip","Strip ",25,0.,25.);
44 TH1F *hpadz = new TH1F("hpadz","Pad along z ",3,0.,3.);
45 TH1F *hpadx = new TH1F("hpadx","Pad along x",50,0.,50.);
46 // ADC-TDC correlation
47 TH2F *h2tdcVSadc = new TH2F("h2tdcVSadc","TDC [bin] VS ADC [bin]",500,0.,150000.,100,0.,3000.);
50 for (Int_t ievent = 0; ievent < iEvNum; ievent++) {
52 gAlice->GetEvent(ievent) ;
53 if(gAlice->TreeS()==0) {
54 cout << "<AliTOFanalyzeSDigits> No TreeS found" << endl;
62 gAlice->ResetDigits();
63 gAlice->TreeS()->GetEvent(ievent);
64 TClonesArray * TOFdigits = tof->SDigits();
66 ndig=TOFdigits->GetEntries();
68 cout << "<AliTOFanalyzeSDigits> found " << ndig
69 << " TOF sdigits for event " << ievent << endl;
71 for (k=0; k<ndig; k++) {
72 tofsdigit= (AliTOFSDigit*) TOFdigits->UncheckedAt(k);
73 Float_t firstTDC=tofsdigit->GetTdc(0);
74 Float_t firstADC=tofsdigit->GetAdc(0);
78 Int_t sector = tofsdigit->GetSector(); // range [1-18]
79 Int_t plate = tofsdigit->GetPlate(); // range [1- 5]
80 Int_t strip = tofsdigit->GetStrip(); // range [1-20]
81 Int_t padz = tofsdigit->GetPadz(); // range [1- 2]
82 Int_t padx = tofsdigit->GetPadx(); // range [1-48]
83 // it is QA, then I perform QA!
84 Bool_t isSDigitBad = (sector<1 || sector>18 || plate<1 || plate >5 || padz<1 || padz>2 || padx<1 || padx>48);
87 cout << "<AliTOFanalyzeHits> strange hit found" << endl;
92 // filling sdigit volume histos
93 hsector->Fill(sector);
98 h2tdcVSadc->Fill(firstTDC,firstADC);
100 //cout << "firstTDC " << firstTDC << " firstADC " << firstADC << endl;
105 TFile *fout = new TFile("TOF_sdigitsQA.root","RECREATE");