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();
66 //_____________________________________________________________________________
67 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
68 , AliRawReader *rawReader) const
71 // Reconstruct clusters
74 AliInfo("Reconstruct TRD clusters from RAW data [RunLoader, RawReader]");
76 AliLoader *loader = runLoader->GetLoader("TRDLoader");
77 loader->LoadRecPoints("recreate");
79 runLoader->CdGAFile();
80 Int_t nEvents = runLoader->GetNumberOfEvents();
83 rawReader->Select("TRD");
85 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
87 if (!rawReader->NextEvent()) break;
89 // Old (slow) cluster finder
90 //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
91 //clusterer.Open(runLoader->GetFileName(),iEvent);
92 //clusterer.ReadDigits(rawReader);
93 //clusterer.MakeClusters();
95 // New (fast) cluster finder
96 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
97 clusterer.Open(runLoader->GetFileName(),iEvent);
98 clusterer.Raw2ClustersChamber(rawReader);
100 clusterer.WriteClusters(-1);
104 loader->UnloadRecPoints();
108 //_____________________________________________________________________________
109 void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
110 , TTree *clusterTree) const
113 // Reconstruct clusters
116 AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]");
119 rawReader->Select("TRD");
121 // Old (slow) cluster finder
122 //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
123 //clusterer.OpenOutput(clusterTree);
124 //clusterer.ReadDigits(rawReader);
125 //clusterer.MakeClusters();
127 // New (fast) cluster finder
128 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
129 clusterer.OpenOutput(clusterTree);
130 clusterer.SetAddLabels(kFALSE);
131 clusterer.Raw2ClustersChamber(rawReader);
134 //_____________________________________________________________________________
135 void AliTRDReconstructor::Reconstruct(TTree *digitsTree
136 , TTree *clusterTree) const
139 // Reconstruct clusters
141 AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]");
143 //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
144 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
145 clusterer.OpenOutput(clusterTree);
146 clusterer.ReadDigits(digitsTree);
147 clusterer.MakeClusters();
150 //_____________________________________________________________________________
151 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
154 // Reconstruct clusters
157 AliInfo("Reconstruct TRD clusters [AliRunLoader]");
158 AliLoader *loader = runLoader->GetLoader("TRDLoader");
159 loader->LoadRecPoints("recreate");
161 runLoader->CdGAFile();
162 Int_t nEvents = runLoader->GetNumberOfEvents();
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);
173 loader->UnloadRecPoints();
177 //_____________________________________________________________________________
178 AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const
181 // Create a TRD tracker
184 runLoader->CdGAFile();
186 return new AliTRDtracker(gFile);
190 //_____________________________________________________________________________
191 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
192 , AliRawReader* /*rawReader*/
193 , AliESDEvent* /*esd*/) const
199 //AliTRDpidESD trdPID;
200 //trdPID.MakePID(esd);
204 //_____________________________________________________________________________
205 void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/
206 , TTree* /*clusterTree*/
207 , AliESDEvent* /*esd*/) const
213 //AliTRDpidESD trdPID;
214 //trdPID.MakePID(esd);
218 //_____________________________________________________________________________
219 void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/
220 , TTree* /*clusterTree*/
221 , AliESDEvent* /*esd*/) const
227 //AliTRDpidESD trdPID;
228 //trdPID.MakePID(esd);
232 //_____________________________________________________________________________
233 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
234 , AliESDEvent* /*esd*/) const
240 //AliTRDpidESD trdPID;
241 //trdPID.MakePID(esd);