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"
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"
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 AliTRDrawData rawData;
55 rawReader->Select("TRD");
56 AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader);
57 manager->MakeBranch(digitsTree);
58 manager->WriteDigits();
62 //_____________________________________________________________________________
63 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
64 , AliRawReader *rawReader) const
67 // Reconstruct clusters
70 AliInfo("Reconstruct TRD clusters from RAW data");
72 AliLoader *loader = runLoader->GetLoader("TRDLoader");
73 loader->LoadRecPoints("recreate");
75 runLoader->CdGAFile();
76 Int_t nEvents = runLoader->GetNumberOfEvents();
79 rawReader->Select("TRD");
81 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
82 if (!rawReader->NextEvent()) break;
83 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
84 clusterer.Open(runLoader->GetFileName(),iEvent);
85 clusterer.ReadDigits(rawReader);
86 clusterer.MakeClusters();
87 clusterer.WriteClusters(-1);
90 loader->UnloadRecPoints();
94 //_____________________________________________________________________________
95 void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
96 , TTree *clusterTree) const
99 // Reconstruct clusters
102 AliInfo("Reconstruct TRD clusters from RAW data");
105 rawReader->Select("TRD");
107 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
108 clusterer.OpenOutput(clusterTree);
109 clusterer.ReadDigits(rawReader);
110 clusterer.MakeClusters();
114 //_____________________________________________________________________________
115 void AliTRDReconstructor::Reconstruct(TTree *digitsTree
116 , TTree *clusterTree) const
119 // Reconstruct clusters
122 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
123 clusterer.OpenOutput(clusterTree);
124 clusterer.ReadDigits(digitsTree);
125 clusterer.MakeClusters();
129 //_____________________________________________________________________________
130 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
133 // Reconstruct clusters
136 AliLoader *loader = runLoader->GetLoader("TRDLoader");
137 loader->LoadRecPoints("recreate");
139 runLoader->CdGAFile();
140 Int_t nEvents = runLoader->GetNumberOfEvents();
142 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
143 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
144 clusterer.Open(runLoader->GetFileName(),iEvent);
145 clusterer.ReadDigits();
146 clusterer.MakeClusters();
147 clusterer.WriteClusters(-1);
150 loader->UnloadRecPoints();
154 //_____________________________________________________________________________
155 AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const
158 // Create a TRD tracker
161 runLoader->CdGAFile();
163 return new AliTRDtracker(gFile);
167 //_____________________________________________________________________________
168 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
169 , AliRawReader* /*rawReader*/
181 //_____________________________________________________________________________
182 void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/
183 , TTree* /*clusterTree*/
195 //_____________________________________________________________________________
196 void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/
197 , TTree* /*clusterTree*/
209 //_____________________________________________________________________________
210 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/