]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDanaDigits.C
Remove AliTRDmatrix
[u/mrichter/AliRoot.git] / TRD / AliTRDanaDigits.C
CommitLineData
fa148e6c 1void AliTRDanaDigits()
2{
3
4/////////////////////////////////////////////////////////////////////////
5//
6// Example macro for the analysis of the TRD digits and the use
7// of the AliTRDmatrix class.
8//
9/////////////////////////////////////////////////////////////////////////
10
11 // Dynamically link some shared libs
12 if (gClassTable->GetID("AliRun") < 0) {
13 gROOT->LoadMacro("loadlibs.C");
14 loadlibs();
15 }
16
17 // Input file name
5990c064 18 Char_t *alifile = "galice.root";
fa148e6c 19
20 // Event number
21 Int_t nEvent = 0;
22
23 // Define the objects
5990c064 24 AliTRDv1 *trd;
25 AliTRDgeometry *geo;
26 AliTRDdigit *digit;
27 AliTRDparameter *par;
fa148e6c 28
29 Int_t track;
30
88cb7938 31 AliRunLoader* rl = AliRunLoader::Open(alifile);
32 AliLoader* loader = rl->GetLoader("TRDLoader");
33 rl->LoadDigits();
34
35 rl->LoadgAlice();
36 gAlice = rl->GetAliRun();
fa148e6c 37
38 // Get the pointer to the detector object
39 trd = (AliTRDv1*) gAlice->GetDetector("TRD");
40
41 // Get the pointer to the geometry object
42 if (trd) {
43 geo = trd->GetGeometry();
44 }
45 else {
46 cout << "Cannot find the geometry" << endl;
47 break;
48 }
49
5990c064 50 // The parameter object
51 par = new AliTRDparameter("TRDparameter","TRD parameter class");
52
fa148e6c 53 // Create the digits manager
54 AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
55 digitsManager->SetDebug(1);
fa148e6c 56
8dc7d97f 57 // Read the digits from the file
88cb7938 58 digitsManager->ReadDigits(loader->TreeD());
fa148e6c 59
60 // Get the detector number
5990c064 61 Int_t iDet = 514;
fa148e6c 62 cout << " iDet = " << iDet << endl;
63
64 // Define the detector matrix for one chamber
65 const Int_t iSec = geo->GetSector(iDet);
66 const Int_t iCha = geo->GetChamber(iDet);
67 const Int_t iPla = geo->GetPlane(iDet);
5990c064 68 Int_t rowMax = par->GetRowMax(iPla,iCha,iSec);
69 Int_t colMax = par->GetColMax(iPla);
70 Int_t timeMax = par->GetTimeMax();
fa148e6c 71 cout << "Geometry: rowMax = " << rowMax
72 << " colMax = " << colMax
73 << " timeMax = " << timeMax << endl;
fa148e6c 74
75 // Loop through the detector pixel
76 for (Int_t time = 0; time < timeMax; time++) {
77 for (Int_t col = 0; col < colMax; col++) {
78 for (Int_t row = 0; row < rowMax; row++) {
79
80 digit = digitsManager->GetDigit(row,col,time,iDet);
81 track = digitsManager->GetTrack(0,row,col,time,iDet);
82
fa148e6c 83 delete digit;
84
85 }
86 }
87 }
88
88cb7938 89 delete rl;
8dc7d97f 90
fa148e6c 91}