1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // Class for TRD reconstruction //
22 ///////////////////////////////////////////////////////////////////////////////
26 #include "AliRunLoader.h"
27 #include "AliRawReader.h"
29 #include "AliESDTrdTrack.h"
30 #include "AliESDEvent.h"
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"
41 ClassImp(AliTRDReconstructor)
43 Bool_t AliTRDReconstructor::fgkSeedingOn = kFALSE;
44 Int_t AliTRDReconstructor::fgStreamLevel = 0; // Stream (debug) level
46 //_____________________________________________________________________________
47 void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader
48 , TTree *digitsTree) const
51 // Convert raw data digits into digit objects in a root tree
54 AliInfo("Convert raw data digits into digit objects [RawReader -> Digit TTree]");
56 AliTRDrawData rawData;
58 rawReader->Select("TRD");
59 AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader);
60 manager->MakeBranch(digitsTree);
61 manager->WriteDigits();
65 //_____________________________________________________________________________
66 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
67 , AliRawReader *rawReader) const
70 // Reconstruct clusters
73 AliInfo("Reconstruct TRD clusters from RAW data [RunLoader, RawReader]");
75 AliLoader *loader = runLoader->GetLoader("TRDLoader");
76 loader->LoadRecPoints("recreate");
78 runLoader->CdGAFile();
79 Int_t nEvents = runLoader->GetNumberOfEvents();
82 rawReader->Select("TRD");
84 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
86 if (!rawReader->NextEvent()) break;
88 // Old (slow) cluster finder
89 //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
90 //clusterer.Open(runLoader->GetFileName(),iEvent);
91 //clusterer.ReadDigits(rawReader);
92 //clusterer.MakeClusters();
94 // New (fast) cluster finder
95 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
96 clusterer.Open(runLoader->GetFileName(),iEvent);
97 clusterer.Raw2ClustersChamber(rawReader);
99 clusterer.WriteClusters(-1);
103 loader->UnloadRecPoints();
107 //_____________________________________________________________________________
108 void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
109 , TTree *clusterTree) const
112 // Reconstruct clusters
115 AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]");
118 rawReader->Select("TRD");
120 // Old (slow) cluster finder
121 //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
122 //clusterer.OpenOutput(clusterTree);
123 //clusterer.ReadDigits(rawReader);
124 //clusterer.MakeClusters();
126 // New (fast) cluster finder
127 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
128 clusterer.OpenOutput(clusterTree);
129 clusterer.SetAddLabels(kFALSE);
130 clusterer.Raw2ClustersChamber(rawReader);
133 //_____________________________________________________________________________
134 void AliTRDReconstructor::Reconstruct(TTree *digitsTree
135 , TTree *clusterTree) const
138 // Reconstruct clusters
140 AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]");
142 //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
143 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
144 clusterer.OpenOutput(clusterTree);
145 clusterer.ReadDigits(digitsTree);
146 clusterer.MakeClusters();
149 //_____________________________________________________________________________
150 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
153 // Reconstruct clusters
156 AliInfo("Reconstruct TRD clusters [AliRunLoader]");
157 AliLoader *loader = runLoader->GetLoader("TRDLoader");
158 loader->LoadRecPoints("recreate");
160 runLoader->CdGAFile();
161 Int_t nEvents = runLoader->GetNumberOfEvents();
163 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
164 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
165 //AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
166 clusterer.Open(runLoader->GetFileName(),iEvent);
167 clusterer.ReadDigits();
168 clusterer.MakeClusters();
169 clusterer.WriteClusters(-1);
172 loader->UnloadRecPoints();
176 //_____________________________________________________________________________
177 AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const
180 // Create a TRD tracker
183 runLoader->CdGAFile();
185 return new AliTRDtracker(gFile);
189 //_____________________________________________________________________________
190 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
191 , AliRawReader* /*rawReader*/
192 , AliESDEvent* /*esd*/) const
198 //AliTRDpidESD trdPID;
199 //trdPID.MakePID(esd);
203 //_____________________________________________________________________________
204 void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/
205 , TTree* /*clusterTree*/
206 , AliESDEvent* /*esd*/) const
212 //AliTRDpidESD trdPID;
213 //trdPID.MakePID(esd);
217 //_____________________________________________________________________________
218 void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/
219 , TTree* /*clusterTree*/
220 , AliESDEvent* /*esd*/) const
226 //AliTRDpidESD trdPID;
227 //trdPID.MakePID(esd);
231 //_____________________________________________________________________________
232 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
233 , AliESDEvent* /*esd*/) const
239 //AliTRDpidESD trdPID;
240 //trdPID.MakePID(esd);