]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDReconstructor.cxx
Verbose printout commented out
[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 "AliESDEvent.h"
31
32 #include "AliTRDReconstructor.h"
33 #include "AliTRDclusterizerV1.h"
34 #include "AliTRDclusterizerV2.h"
35 #include "AliTRDtracker.h"
36 #include "AliTRDpidESD.h"
37 #include "AliTRDgtuTrack.h"
38 #include "AliTRDrawData.h"
39 #include "AliTRDdigitsManager.h"
40
41 ClassImp(AliTRDReconstructor)
42
43 Bool_t AliTRDReconstructor::fgkSeedingOn  = kFALSE;
44 Int_t  AliTRDReconstructor::fgStreamLevel = 0;      // Stream (debug) level
45
46 //_____________________________________________________________________________
47 void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader
48                                       , TTree *digitsTree) const
49 {
50   //
51   // Convert raw data digits into digit objects in a root tree
52   //
53
54   AliInfo("Convert raw data digits into digit objects [RawReader -> Digit TTree]");
55
56   AliTRDrawData rawData;
57   rawReader->Reset();
58   rawReader->Select("TRD");
59   AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader);
60   manager->MakeBranch(digitsTree);
61   manager->WriteDigits();
62   delete manager;
63
64 }
65
66 //_____________________________________________________________________________
67 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
68                                     , AliRawReader *rawReader) const
69 {
70   //
71   // Reconstruct clusters
72   //
73
74   AliInfo("Reconstruct TRD clusters from RAW data [RunLoader, RawReader]");
75
76   AliLoader *loader = runLoader->GetLoader("TRDLoader");
77   loader->LoadRecPoints("recreate");
78
79   runLoader->CdGAFile();
80   Int_t nEvents = runLoader->GetNumberOfEvents();
81
82   rawReader->Reset();
83   rawReader->Select("TRD");
84
85   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
86
87     if (!rawReader->NextEvent()) break;
88
89     // Old (slow) cluster finder
90     //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
91     //clusterer.Open(runLoader->GetFileName(),iEvent);
92     //clusterer.ReadDigits(rawReader);
93     //clusterer.MakeClusters();
94
95     // New (fast) cluster finder
96     AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
97     clusterer.Open(runLoader->GetFileName(),iEvent);
98     clusterer.Raw2ClustersChamber(rawReader);
99
100     clusterer.WriteClusters(-1);
101
102   }
103
104   loader->UnloadRecPoints();
105
106 }
107
108 //_____________________________________________________________________________
109 void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
110                                     , TTree *clusterTree) const
111 {
112   //
113   // Reconstruct clusters
114   //
115
116   AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]");
117
118   rawReader->Reset();
119   rawReader->Select("TRD");
120
121   // Old (slow) cluster finder
122   //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
123   //clusterer.OpenOutput(clusterTree);
124   //clusterer.ReadDigits(rawReader);
125   //clusterer.MakeClusters();
126
127   // New (fast) cluster finder
128   AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
129   clusterer.OpenOutput(clusterTree);
130   clusterer.SetAddLabels(kFALSE);
131   clusterer.Raw2ClustersChamber(rawReader);
132 }
133
134 //_____________________________________________________________________________
135 void AliTRDReconstructor::Reconstruct(TTree *digitsTree
136                                     , TTree *clusterTree) const
137 {
138   //
139   // Reconstruct clusters
140   //
141   AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]");
142
143   //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
144   AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
145   clusterer.OpenOutput(clusterTree);
146   clusterer.ReadDigits(digitsTree);
147   clusterer.MakeClusters();
148 }
149
150 //_____________________________________________________________________________
151 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
152 {
153   //
154   // Reconstruct clusters
155   //
156
157   AliInfo("Reconstruct TRD clusters [AliRunLoader]");
158   AliLoader *loader = runLoader->GetLoader("TRDLoader");
159   loader->LoadRecPoints("recreate");
160
161   runLoader->CdGAFile();
162   Int_t nEvents = runLoader->GetNumberOfEvents();
163
164   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
165     AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
166     //AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
167     clusterer.Open(runLoader->GetFileName(),iEvent);
168     clusterer.ReadDigits();
169     clusterer.MakeClusters();
170     clusterer.WriteClusters(-1);
171   }
172
173   loader->UnloadRecPoints();
174
175 }
176
177 //_____________________________________________________________________________
178 AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const
179 {
180   //
181   // Create a TRD tracker
182   //
183
184   runLoader->CdGAFile();
185
186   return new AliTRDtracker(gFile);
187
188 }
189
190 //_____________________________________________________________________________
191 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
192                                 , AliRawReader* /*rawReader*/
193                                 , AliESDEvent* /*esd*/) const
194 {
195   //
196   // Make PID
197   //
198
199   //AliTRDpidESD trdPID;
200   //trdPID.MakePID(esd);
201
202 }
203
204 //_____________________________________________________________________________
205 void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/
206                                 , TTree* /*clusterTree*/
207                                 , AliESDEvent* /*esd*/) const
208 {
209   //
210   // Make PID
211   //
212
213   //AliTRDpidESD trdPID;
214   //trdPID.MakePID(esd);
215
216 }
217
218 //_____________________________________________________________________________
219 void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/
220                                 , TTree* /*clusterTree*/
221                                 , AliESDEvent* /*esd*/) const
222 {
223   //
224   // Make PID
225   //
226
227   //AliTRDpidESD trdPID;
228   //trdPID.MakePID(esd);
229
230 }
231
232 //_____________________________________________________________________________
233 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
234                                 , AliESDEvent* /*esd*/) const
235 {
236   //
237   // Make PID
238   //
239
240   //AliTRDpidESD trdPID;
241   //trdPID.MakePID(esd);
242
243 }