1 #if !defined(__CINT__) || defined(__MAKECINT__)
4 #include "AliTRDrawData.h"
5 #include "AliTRDdigitsManager.h"
6 #include "AliTRDdigit.h"
7 #include "AliTRDgeometryFull.h"
8 #include "AliTRDparameter.h"
9 #include "AliTRDmatrix.h"
10 #include "AliRawReaderFile.h"
11 #include "AliRunLoader.h"
14 void AliTRDRaw2Digits(Int_t iEvent = 0, Int_t iDet = 0)
17 AliTRDrawData *raw = new AliTRDrawData();
19 AliRawReaderFile rawReader(iEvent);
20 AliTRDdigitsManager *digitsManagerRaw = raw->Raw2Digits(&rawReader);
22 // The geometry object
23 AliTRDgeometryFull *geo = new AliTRDgeometryFull();
25 // The parameter object
26 AliTRDparameter *par = new AliTRDparameter("TRDparameter"
27 ,"TRD parameter class");
29 // Print the event and detector number
30 cout << " iEvent = " << iEvent << endl;
31 cout << " iDet = " << iDet << endl;
33 // Define the detector matrix for one chamber
34 const Int_t iSec = geo->GetSector(iDet);
35 const Int_t iCha = geo->GetChamber(iDet);
36 const Int_t iPla = geo->GetPlane(iDet);
37 Int_t rowMax = par->GetRowMax(iPla,iCha,iSec);
38 Int_t colMax = par->GetColMax(iPla);
39 Int_t timeMax = par->GetTimeMax();
40 cout << "Geometry: rowMax = " << rowMax
41 << " colMax = " << colMax
42 << " timeMax = " << timeMax << endl;
43 AliTRDmatrix *matrix = new AliTRDmatrix(rowMax,colMax,timeMax,iSec,iCha,iPla);
45 AliRunLoader* rl = AliRunLoader::Open("galice.root");
46 AliLoader* loader = rl->GetLoader("TRDLoader");
50 // Create the digits manager
51 AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
52 digitsManager->SetDebug(1);
54 // Read the digits from the file
55 digitsManager->ReadDigits(loader->TreeD());
57 TH1F *DigDiff = new TH1F("DigDiff","DigDiff",100,-10,+10);
58 Int_t DigAmpRaw, DigAmp;
60 // Loop through the detector pixel
61 for (Int_t time = 0; time < timeMax; time++) {
62 for (Int_t col = 0; col < colMax; col++) {
63 for (Int_t row = 0; row < rowMax; row++) {
65 AliTRDdigit* digit = digitsManagerRaw->GetDigit(row,col,time,iDet);
67 matrix->SetSignal(row,col,time,digit->GetAmp());
69 DigAmpRaw = digit->GetAmp();
71 digit = digitsManager->GetDigit(row,col,time,iDet);
73 DigAmp = digit->GetAmp();
75 DigDiff->Fill((Float_t)DigAmp-(Float_t)DigAmpRaw);
83 // Display the detector matrix
89 TCanvas *c1 = new TCanvas("c1","Canvas 1",10,10,600,500);