4 /////////////////////////////////////////////////////////////////////////
6 // Example macro for the analysis of the TRD digits and the use
7 // of the AliTRDmatrix class.
9 /////////////////////////////////////////////////////////////////////////
11 // Dynamically link some shared libs
12 if (gClassTable->GetID("AliRun") < 0) {
13 gROOT->LoadMacro("loadlibs.C");
18 Char_t *alifile = "galice.root";
31 AliRunLoader* rl = AliRunLoader::Open(alifile);
32 AliLoader* loader = rl->GetLoader("TRDLoader");
36 gAlice = rl->GetAliRun();
38 // Get the pointer to the detector object
39 trd = (AliTRDv1*) gAlice->GetDetector("TRD");
41 // Get the pointer to the geometry object
43 geo = trd->GetGeometry();
46 cout << "Cannot find the geometry" << endl;
50 // The parameter object
51 par = new AliTRDparameter("TRDparameter","TRD parameter class");
53 // Create the digits manager
54 AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
55 digitsManager->SetDebug(1);
57 // Read the digits from the file
59 digitsManager->ReadDigits(loader->TreeD());
61 // Get the detector number
63 cout << " iDet = " << iDet << endl;
65 // Define the detector matrix for one chamber
66 const Int_t iSec = geo->GetSector(iDet);
67 const Int_t iCha = geo->GetChamber(iDet);
68 const Int_t iPla = geo->GetPlane(iDet);
69 Int_t rowMax = par->GetRowMax(iPla,iCha,iSec);
70 Int_t colMax = par->GetColMax(iPla);
71 Int_t timeMax = par->GetTimeMax();
72 cout << "Geometry: rowMax = " << rowMax
73 << " colMax = " << colMax
74 << " timeMax = " << timeMax << endl;
75 AliTRDmatrix *matrix = new AliTRDmatrix(rowMax,colMax,timeMax,iSec,iCha,iPla);
77 // Loop through the detector pixel
78 for (Int_t time = 0; time < timeMax; time++) {
79 for (Int_t col = 0; col < colMax; col++) {
80 for (Int_t row = 0; row < rowMax; row++) {
82 digit = digitsManager->GetDigit(row,col,time,iDet);
83 track = digitsManager->GetTrack(0,row,col,time,iDet);
85 matrix->SetSignal(row,col,time,digit->GetAmp());
93 // Display the detector matrix