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 // Connect the AliRoot file containing Geometry, Kine, Hits, and digits
32 TFile *gafl = (TFile*) gROOT->GetListOfFiles()->FindObject(alifile);
34 cout << "Open the ALIROOT-file " << alifile << endl;
35 gafl = new TFile(alifile);
38 cout << alifile << " is already open" << endl;
41 // Get AliRun object from file or create it if not on file
42 gAlice = (AliRun*) gafl->Get("gAlice");
44 cout << "AliRun object found on file" << endl;
46 gAlice = new AliRun("gAlice","Alice test program");
48 // Import the Trees for the event nEvent in the file
49 Int_t nparticles = gAlice->GetEvent(nEvent);
50 if (nparticles <= 0) break;
52 // Get the pointer to the detector object
53 trd = (AliTRDv1*) gAlice->GetDetector("TRD");
55 // Get the pointer to the geometry object
57 geo = trd->GetGeometry();
60 cout << "Cannot find the geometry" << endl;
64 // The parameter object
65 par = new AliTRDparameter("TRDparameter","TRD parameter class");
67 // Create the digits manager
68 AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
69 digitsManager->SetDebug(1);
71 // Read the digits from the file
72 digitsManager->Open(alifile);
73 digitsManager->ReadDigits();
75 // Get the detector number
77 cout << " iDet = " << iDet << endl;
79 // Define the detector matrix for one chamber
80 const Int_t iSec = geo->GetSector(iDet);
81 const Int_t iCha = geo->GetChamber(iDet);
82 const Int_t iPla = geo->GetPlane(iDet);
83 Int_t rowMax = par->GetRowMax(iPla,iCha,iSec);
84 Int_t colMax = par->GetColMax(iPla);
85 Int_t timeMax = par->GetTimeMax();
86 cout << "Geometry: rowMax = " << rowMax
87 << " colMax = " << colMax
88 << " timeMax = " << timeMax << endl;
89 AliTRDmatrix *matrix = new AliTRDmatrix(rowMax,colMax,timeMax,iSec,iCha,iPla);
91 // Loop through the detector pixel
92 for (Int_t time = 0; time < timeMax; time++) {
93 for (Int_t col = 0; col < colMax; col++) {
94 for (Int_t row = 0; row < rowMax; row++) {
96 digit = digitsManager->GetDigit(row,col,time,iDet);
97 track = digitsManager->GetTrack(0,row,col,time,iDet);
99 matrix->SetSignal(row,col,time,digit->GetAmp());
107 // Display the detector matrix