1 Int_t AliTRDanalyzeDigits()
10 cout << "<AliTRDanalyzeDigits> No AliRun object found" << endl;
16 // Get the pointer to the TRD detector
17 AliTRD *TRD = (AliTRD *) gAlice->GetDetector("TRD");
19 cout << "<AliTRDanalyzeDigits> No TRD detector found" << endl;
24 // Define the histograms
25 TH1F *hAmp = new TH1F("hAmp","Amplitude of the digits",256,-0.5,255.5);
27 // Get the pointer to the geometry object
28 AliTRDgeometry *TRDgeometry;
30 TRDgeometry = TRD->GetGeometry();
33 cout << "<AliTRDanalyzeDigits> No TRD geometry found" << endl;
38 // Create the digits manager
39 AliTRDdigitsManager *DigitsManager = new AliTRDdigitsManager();
41 // Read the digits from the file
42 if (!(DigitsManager->ReadDigits())) {
43 cout << "<AliTRDanalyzeDigits> Cannot read the digits" << endl;
48 // Define the detector matrix for one chamber
49 Int_t iSec = TRD->GetSensSector();
50 Int_t iCha = TRD->GetSensChamber();
52 Int_t rowMax = TRDgeometry->GetRowMax(iPla,iCha,iSec);
53 Int_t colMax = TRDgeometry->GetColMax(iPla);
54 Int_t timeMax = TRDgeometry->GetTimeMax();
55 cout << "<AliTRDanalyzeDigits> Geometry: rowMax = " << rowMax
56 << " colMax = " << colMax
57 << " timeMax = " << timeMax << endl;
58 AliTRDmatrix *TRDmatrix = new AliTRDmatrix(rowMax,colMax,timeMax,iSec,iCha,iPla);
59 // Get the detector number
60 Int_t iDet = TRDgeometry->GetDetector(iPla,iCha,iSec);
61 cout << "<AliTRDanalyzeDigits> iSec = " << iSec
64 << " iDet = " << iDet << endl;
66 // Loop through the detector pixel
67 Int_t countDigits = 0;
68 for (Int_t time = 0; time < timeMax; time++) {
69 for (Int_t col = 0; col < colMax; col++) {
70 for (Int_t row = 0; row < rowMax; row++) {
72 AliTRDdigit *Digit = DigitsManager->GetDigit(row,col,time,iDet);
73 Int_t amp = Digit->GetAmp();
78 TRDmatrix->SetSignal(row,col,time,amp);
87 cout << "<AliTRDanalyzeDigits> Found " << countDigits << " digits in total" << endl;
89 // Display the detector matrix
93 TRDmatrix->ProjTime();
95 TCanvas *cDigits = new TCanvas("cDigits","AliTRDanalyzeDigits",50,50,600,600);