]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDReconstructor.cxx
Move pad planes from AliTRDCommomParam to AliTRDgeometry
[u/mrichter/AliRoot.git] / TRD / AliTRDReconstructor.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 // Class for TRD reconstruction                                              //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24 #include <TFile.h>
25
26 #include "AliRunLoader.h"
27 #include "AliRawReader.h"
28 #include "AliLog.h"
29 #include "AliESDTrdTrack.h"
30 #include "AliESD.h"
31
32 #include "AliTRDReconstructor.h"
33 #include "AliTRDclusterizerV1.h"
34 #include "AliTRDtracker.h"
35 #include "AliTRDpidESD.h"
36 #include "AliTRDgtuTrack.h"
37 #include "AliTRDrawData.h"
38 #include "AliTRDdigitsManager.h"
39
40 ClassImp(AliTRDReconstructor)
41
42 Bool_t AliTRDReconstructor::fgkSeedingOn  = kFALSE;
43 Int_t  AliTRDReconstructor::fgStreamLevel = 0;      // Stream (debug) level
44
45 //_____________________________________________________________________________
46 void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader
47                                       , TTree *digitsTree) const
48 {
49   //
50   // Convert raw data digits into digit objects in a root tree
51   //
52
53   AliTRDrawData rawData;
54   AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader);
55   manager->MakeBranch(digitsTree);
56   manager->WriteDigits();
57
58 }
59
60 //_____________________________________________________________________________
61 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
62                                     , AliRawReader *rawReader) const
63 {
64   //
65   // Reconstruct clusters
66   //
67
68   AliInfo("Reconstruct TRD clusters from RAW data");
69
70   AliLoader *loader = runLoader->GetLoader("TRDLoader");
71   loader->LoadRecPoints("recreate");
72
73   runLoader->CdGAFile();
74   Int_t nEvents = runLoader->GetNumberOfEvents();
75
76   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
77     if (!rawReader->NextEvent()) break;
78     AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
79     clusterer.Open(runLoader->GetFileName(),iEvent);
80     clusterer.ReadDigits(rawReader);
81     clusterer.MakeClusters();
82     clusterer.WriteClusters(-1);
83   }
84
85   loader->UnloadRecPoints();
86
87 }
88
89 //_____________________________________________________________________________
90 void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
91                                     , TTree *clusterTree) const
92 {
93   //
94   // Reconstruct clusters
95   //
96
97   AliInfo("Reconstruct TRD clusters from RAW data");
98
99   AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
100   clusterer.OpenOutput(clusterTree);
101   clusterer.ReadDigits(rawReader);
102   clusterer.MakeClusters();
103
104 }
105
106 //_____________________________________________________________________________
107 void AliTRDReconstructor::Reconstruct(TTree *digitsTree
108                                     , TTree *clusterTree) const
109 {
110   //
111   // Reconstruct clusters
112   //
113
114   AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
115   clusterer.OpenOutput(clusterTree);
116   clusterer.ReadDigits(digitsTree);
117   clusterer.MakeClusters();
118
119 }
120
121 //_____________________________________________________________________________
122 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
123 {
124   //
125   // Reconstruct clusters
126   //
127
128   AliLoader *loader = runLoader->GetLoader("TRDLoader");
129   loader->LoadRecPoints("recreate");
130
131   runLoader->CdGAFile();
132   Int_t nEvents = runLoader->GetNumberOfEvents();
133
134   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
135     AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
136     clusterer.Open(runLoader->GetFileName(),iEvent);
137     clusterer.ReadDigits();
138     clusterer.MakeClusters();
139     clusterer.WriteClusters(-1);
140   }
141
142   loader->UnloadRecPoints();
143
144 }
145
146 //_____________________________________________________________________________
147 AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const
148 {
149   //
150   // Create a TRD tracker
151   //
152
153   runLoader->CdGAFile();
154
155   return new AliTRDtracker(gFile);
156
157 }
158
159 //_____________________________________________________________________________
160 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
161                                 , AliRawReader* /*rawReader*/
162                                 , AliESD *esd) const
163 {
164   //
165   // Make PID
166   //
167
168   AliTRDpidESD trdPID;
169   trdPID.MakePID(esd);
170
171 }
172
173 //_____________________________________________________________________________
174 void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/
175                                 , TTree* /*clusterTree*/
176                                 , AliESD *esd) const
177 {
178   //
179   // Make PID
180   //
181
182   AliTRDpidESD trdPID;
183   trdPID.MakePID(esd);
184
185 }
186
187 //_____________________________________________________________________________
188 void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/
189                                 , TTree* /*clusterTree*/
190                                 , AliESD *esd) const
191 {
192   //
193   // Make PID
194   //
195
196   AliTRDpidESD trdPID;
197   trdPID.MakePID(esd);
198
199 }
200
201 //_____________________________________________________________________________
202 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
203                                 , AliESD *esd) const
204 {
205   //
206   // Make PID
207   //
208
209   AliTRDpidESD trdPID;
210   trdPID.MakePID(esd);
211
212 }