]>
Commit | Line | Data |
---|---|---|
59697224 | 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 TPC reconstruction // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | ||
25 | #include "AliTPCReconstructor.h" | |
26 | #include "AliRunLoader.h" | |
27 | #include "AliRun.h" | |
38e6e547 | 28 | #include "AliRawReader.h" |
59697224 | 29 | #include "AliTPCclustererMI.h" |
30 | #include "AliTPCtrackerMI.h" | |
31 | #include "AliTPCpidESD.h" | |
4fb6310b | 32 | #include "AliTPCParam.h" |
90c7886e | 33 | #include "AliTPCParamSR.h" |
59697224 | 34 | |
35 | ClassImp(AliTPCReconstructor) | |
36 | ||
8018bb90 | 37 | Double_t AliTPCReconstructor::fgCtgRange = 1.05; |
3f82c4f2 | 38 | Double_t AliTPCReconstructor::fgMaxSnpTracker = 0.95; // max tangent in tracker - correspond to 3 |
39 | Double_t AliTPCReconstructor::fgMaxSnpTrack = 0.999; // tangent | |
34acb742 | 40 | Int_t AliTPCReconstructor::fgStreamLevel = 0; // stream (debug) level |
59697224 | 41 | //_____________________________________________________________________________ |
42 | void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader) const | |
43 | { | |
44 | // reconstruct clusters | |
45 | ||
46 | AliLoader* loader = runLoader->GetLoader("TPCLoader"); | |
47 | if (!loader) { | |
48 | Error("Reconstruct", "TPC loader not found"); | |
49 | return; | |
50 | } | |
51 | loader->LoadRecPoints("recreate"); | |
52 | loader->LoadDigits("read"); | |
53 | ||
54 | AliTPCParam* param = GetTPCParam(runLoader); | |
55 | if (!param) return; | |
56 | AliTPCclustererMI clusterer(param); | |
57 | Int_t nEvents = runLoader->GetNumberOfEvents(); | |
58 | ||
59 | for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { | |
60 | runLoader->GetEvent(iEvent); | |
61 | ||
62 | TTree* treeClusters = loader->TreeR(); | |
63 | if (!treeClusters) { | |
64 | loader->MakeTree("R"); | |
65 | treeClusters = loader->TreeR(); | |
66 | } | |
67 | TTree* treeDigits = loader->TreeD(); | |
68 | if (!treeDigits) { | |
69 | Error("Reconstruct", "Can't get digits tree !"); | |
70 | return; | |
71 | } | |
72 | ||
73 | clusterer.SetInput(treeDigits); | |
74 | clusterer.SetOutput(treeClusters); | |
75 | clusterer.Digits2Clusters(); | |
76 | ||
77 | loader->WriteRecPoints("OVERWRITE"); | |
78 | } | |
79 | ||
80 | loader->UnloadRecPoints(); | |
81 | loader->UnloadDigits(); | |
82 | } | |
83 | ||
38e6e547 | 84 | //_____________________________________________________________________________ |
85 | void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader, | |
86 | AliRawReader* rawReader) const | |
87 | { | |
88 | // reconstruct clusters from raw data | |
89 | ||
90 | AliLoader* loader = runLoader->GetLoader("TPCLoader"); | |
91 | if (!loader) { | |
92 | Error("Reconstruct", "TPC loader not found"); | |
93 | return; | |
94 | } | |
95 | loader->LoadRecPoints("recreate"); | |
96 | ||
97 | AliTPCParam* param = GetTPCParam(runLoader); | |
90c7886e | 98 | if (!param) { |
99 | AliWarning("Loading default TPC parameters !"); | |
100 | param = new AliTPCParamSR; | |
101 | } | |
38e6e547 | 102 | AliTPCclustererMI clusterer(param); |
103 | ||
104 | Int_t iEvent = 0; | |
105 | while (rawReader->NextEvent()) { | |
106 | runLoader->GetEvent(iEvent++); | |
107 | ||
108 | TTree* treeClusters = loader->TreeR(); | |
109 | if (!treeClusters) { | |
110 | loader->MakeTree("R"); | |
111 | treeClusters = loader->TreeR(); | |
112 | } | |
113 | ||
114 | clusterer.SetOutput(treeClusters); | |
115 | clusterer.Digits2Clusters(rawReader); | |
116 | ||
117 | loader->WriteRecPoints("OVERWRITE"); | |
118 | } | |
119 | ||
120 | loader->UnloadRecPoints(); | |
121 | } | |
122 | ||
59697224 | 123 | //_____________________________________________________________________________ |
124 | AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* runLoader) const | |
125 | { | |
126 | // create a TPC tracker | |
127 | ||
128 | AliTPCParam* param = GetTPCParam(runLoader); | |
90c7886e | 129 | if (!param) { |
130 | AliWarning("Loading default TPC parameters !"); | |
131 | param = new AliTPCParamSR; | |
132 | } | |
4fb6310b | 133 | param->ReadGeoMatrices(); |
59697224 | 134 | return new AliTPCtrackerMI(param); |
135 | } | |
136 | ||
137 | //_____________________________________________________________________________ | |
138 | void AliTPCReconstructor::FillESD(AliRunLoader* /*runLoader*/, | |
139 | AliESD* esd) const | |
140 | { | |
141 | // make PID | |
142 | ||
143 | Double_t parTPC[] = {47., 0.10, 10.}; | |
144 | AliTPCpidESD tpcPID(parTPC); | |
145 | tpcPID.MakePID(esd); | |
146 | } | |
147 | ||
148 | ||
149 | //_____________________________________________________________________________ | |
150 | AliTPCParam* AliTPCReconstructor::GetTPCParam(AliRunLoader* runLoader) const | |
151 | { | |
152 | // get the TPC parameters | |
153 | ||
6d75e4b6 | 154 | TDirectory* saveDir = gDirectory; |
155 | runLoader->CdGAFile(); | |
156 | ||
157 | AliTPCParam* param = (AliTPCParam*) gDirectory->Get("75x40_100x60_150x60"); | |
158 | if (!param) Error("GetTPCParam", "no TPC parameters found"); | |
159 | ||
160 | saveDir->cd(); | |
161 | return param; | |
59697224 | 162 | } |