]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDReconstructor.cxx
6ef49234b4d7700fbf4e8296286a26a03480d899
[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
25 #include "AliTRDReconstructor.h"
26 #include "AliRunLoader.h"
27 #include "AliTRDclusterizerV1.h"
28 #include "AliTRDtracker.h"
29 #include "AliTRDpidESD.h"
30 #include <TFile.h>
31 #include "AliRawReader.h"
32 #include "AliLog.h"
33
34 ClassImp(AliTRDReconstructor)
35
36
37 Bool_t  AliTRDReconstructor::fgkSeedingOn = kFALSE;
38
39 //_____________________________________________________________________________
40 void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader) const
41 {
42 // reconstruct clusters
43
44   AliLoader *loader=runLoader->GetLoader("TRDLoader");
45   loader->LoadRecPoints("recreate");
46
47   AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer");
48   runLoader->CdGAFile();
49   Int_t nEvents = runLoader->GetNumberOfEvents();
50
51   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
52     clusterer.Open(runLoader->GetFileName(), iEvent);
53     clusterer.ReadDigits();
54     clusterer.MakeClusters();
55     clusterer.WriteClusters(-1);
56   }
57
58   loader->UnloadRecPoints();
59 }
60
61 //_____________________________________________________________________________
62 void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader,
63                                       AliRawReader* rawReader) const
64 {
65 // reconstruct clusters
66
67   AliInfo("Reconstruct TRD clusters from RAW data");
68
69   AliLoader *loader=runLoader->GetLoader("TRDLoader");
70   loader->LoadRecPoints("recreate");
71
72   AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer");
73   runLoader->CdGAFile();
74   Int_t nEvents = runLoader->GetNumberOfEvents();
75
76   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
77     if (!rawReader->NextEvent()) break;
78     clusterer.Open(runLoader->GetFileName(), iEvent);
79     clusterer.ReadDigits(rawReader);
80     clusterer.MakeClusters();
81     clusterer.WriteClusters(-1);
82   }
83
84   loader->UnloadRecPoints();
85 }
86
87 //_____________________________________________________________________________
88 AliTracker* AliTRDReconstructor::CreateTracker(AliRunLoader* runLoader) const
89 {
90 // create a TRD tracker
91
92   runLoader->CdGAFile();
93   return new AliTRDtracker(gFile);
94 }
95
96 //_____________________________________________________________________________
97 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/, 
98                                   AliESD* esd) const
99 {
100 // make PID
101
102   Double_t parTRD[] = {
103     280., // Min. Ionizing Particle signal.  Check it !!!
104     0.23, // relative resolution             Check it !!!
105     10.   // PID range (in sigmas)
106   };
107   AliTRDpidESD trdPID(parTRD);
108   trdPID.MakePID(esd);
109 }
110
111
112