1 Int_t AliTRDanalyzeDigits()
10 cout << "<AliTRDanalyzeDigits> No AliRun object found" << endl;
14 Int_t nPart = gAlice->GetEvent(0);
16 // Get the pointer to the TRD detector
17 AliTRD *TRD = (AliTRD *) gAlice->GetDetector("TRD");
19 cout << "<AliTRDanalyzeDigits> No TRD detector found" << endl;
24 // Get the digitizer object
25 TFile *file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
26 AliTRDdigitizer *Digitizer = (AliTRDdigitizer *) file->Get("digitizer");
28 cout << "<AliTRDanalyzeDigits> No digitizer object found" << endl;
33 // Define the histograms
34 Int_t adcRange = ((Int_t) Digitizer->GetADCoutRange());
35 TH1F *hAmpAll = new TH1F("hAmpAll" ,"Amplitude of the digits (all)"
36 ,adcRange+1,-0.5,((Float_t) adcRange)+0.5);
37 TH1F *hAmpEl = new TH1F("hAmpEl" ,"Amplitude of the digits (electrons)"
38 ,adcRange+1,-0.5,((Float_t) adcRange)+0.5);
39 TH1F *hAmpPi = new TH1F("hAmpPi" ,"Amplitude of the digits (pions)"
40 ,adcRange+1,-0.5,((Float_t) adcRange)+0.5);
41 TH1F *hAmpNoise = new TH1F("hAmpNoise","Amplitude of the digits (noise)"
42 ,adcRange+1,-0.5,((Float_t) adcRange)+0.5);
44 // Get the pointer to the geometry object
45 AliTRDgeometry *TRDgeometry;
47 TRDgeometry = TRD->GetGeometry();
50 cout << "<AliTRDanalyzeDigits> No TRD geometry found" << endl;
55 // Create the digits manager
56 AliTRDdigitsManager *DigitsManager = new AliTRDdigitsManager();
58 // Read the digits from the file
59 if (!(DigitsManager->ReadDigits())) {
60 cout << "<AliTRDanalyzeDigits> Cannot read the digits" << endl;
65 // Define the detector matrix for one chamber
66 Int_t iSec = TRD->GetSensSector();
67 Int_t iCha = TRD->GetSensChamber();
69 Int_t rowMax = TRDgeometry->GetRowMax(iPla,iCha,iSec);
70 Int_t colMax = TRDgeometry->GetColMax(iPla);
71 Int_t timeMax = TRDgeometry->GetTimeMax();
72 cout << "<AliTRDanalyzeDigits> Geometry: rowMax = " << rowMax
73 << " colMax = " << colMax
74 << " timeMax = " << timeMax << endl;
75 AliTRDmatrix *TRDmatrix = new AliTRDmatrix(rowMax,colMax,timeMax,iSec,iCha,iPla);
76 // Get the detector number
77 Int_t iDet = TRDgeometry->GetDetector(iPla,iCha,iSec);
78 cout << "<AliTRDanalyzeDigits> iSec = " << iSec
81 << " iDet = " << iDet << endl;
83 // Loop through the detector pixel
84 Int_t countDigits = 0;
85 for (Int_t time = 0; time < timeMax; time++) {
86 for (Int_t col = 0; col < colMax; col++) {
87 for (Int_t row = 0; row < rowMax; row++) {
89 AliTRDdigit *Digit = DigitsManager->GetDigit(row,col,time,iDet);
90 Int_t amp = Digit->GetAmp();
92 Int_t track0 = DigitsManager->GetTrack(0,row,col,time,iDet);
93 Int_t track1 = DigitsManager->GetTrack(1,row,col,time,iDet);
96 Part = gAlice->Particle(track0);
102 TRDmatrix->SetSignal(row,col,time,amp);
111 hAmpNoise->Fill(amp);
115 if ((Part) && (Part->GetPdgCode() == 11) && (track1 < 0)) {
120 if ((Part) && (Part->GetPdgCode() == -211) && (track1 < 0)) {
130 cout << "<AliTRDanalyzeDigits> Found " << countDigits << " digits in total" << endl;
132 // Display the detector matrix
134 TRDmatrix->ProjRow();
135 TRDmatrix->ProjCol();
136 TRDmatrix->ProjTime();
138 TCanvas *cDigits = new TCanvas("cDigits","AliTRDanalyzeDigits",50,50,600,600);
139 cDigits->Divide(2,2);