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 "AliTRDclusterizerV2.h"
34 #include "AliTRDtracker.h"
35 #include "AliTRDpidESD.h"
36 #include "AliTRDgtuTrack.h"
37 #include "AliTRDrawData.h"
38 #include "AliTRDdigitsManager.h"
40 ClassImp(AliTRDReconstructor)
42 Bool_t AliTRDReconstructor::fgkSeedingOn = kFALSE;
43 Int_t AliTRDReconstructor::fgStreamLevel = 0; // Stream (debug) level
45 //_____________________________________________________________________________
46 void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader
47 , TTree *digitsTree) const
50 // Convert raw data digits into digit objects in a root tree
53 AliInfo("Convert raw data digits into digit objects [RawReader -> Digit TTree]");
55 AliTRDrawData rawData;
57 rawReader->Select("TRD");
58 AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader);
59 manager->MakeBranch(digitsTree);
60 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 // New (fast) cluster finder
89 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
90 clusterer.Open(runLoader->GetFileName(),iEvent);
91 clusterer.Raw2ClustersChamber(rawReader);
93 clusterer.WriteClusters(-1);
97 loader->UnloadRecPoints();
101 //_____________________________________________________________________________
102 void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
103 , TTree *clusterTree) const
106 // Reconstruct clusters
109 AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]");
112 rawReader->Select("TRD");
114 // New (fast) cluster finder
115 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
116 clusterer.OpenOutput(clusterTree);
117 clusterer.SetAddLabels(kFALSE);
118 clusterer.Raw2ClustersChamber(rawReader);
122 //_____________________________________________________________________________
123 void AliTRDReconstructor::Reconstruct(TTree *digitsTree
124 , TTree *clusterTree) const
127 // Reconstruct clusters
129 AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]");
131 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
132 clusterer.OpenOutput(clusterTree);
133 clusterer.ReadDigits(digitsTree);
134 clusterer.MakeClusters();
138 //_____________________________________________________________________________
139 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
142 // Reconstruct clusters
145 AliInfo("Reconstruct TRD clusters [AliRunLoader]");
146 AliLoader *loader = runLoader->GetLoader("TRDLoader");
147 loader->LoadRecPoints("recreate");
149 runLoader->CdGAFile();
150 Int_t nEvents = runLoader->GetNumberOfEvents();
152 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
153 AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
154 clusterer.Open(runLoader->GetFileName(),iEvent);
155 clusterer.ReadDigits();
156 clusterer.MakeClusters();
157 clusterer.WriteClusters(-1);
160 loader->UnloadRecPoints();
164 //_____________________________________________________________________________
165 AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const
168 // Create a TRD tracker
171 runLoader->CdGAFile();
173 return new AliTRDtracker(gFile);
177 //_____________________________________________________________________________
178 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
179 , AliRawReader* /*rawReader*/
180 , AliESDEvent* /*esd*/) const
188 //_____________________________________________________________________________
189 void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/
190 , TTree* /*clusterTree*/
191 , AliESDEvent* /*esd*/) const
199 //_____________________________________________________________________________
200 void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/
201 , TTree* /*clusterTree*/
202 , AliESDEvent* /*esd*/) const
210 //_____________________________________________________________________________
211 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
212 , AliESDEvent* /*esd*/) const