]>
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 | ||
b6f060dc | 104 | TString option = GetOption(); |
105 | if (option.Contains("PedestalSubtraction")) | |
106 | clusterer.SetPedSubtraction(kTRUE); | |
107 | ||
38e6e547 | 108 | Int_t iEvent = 0; |
109 | while (rawReader->NextEvent()) { | |
110 | runLoader->GetEvent(iEvent++); | |
111 | ||
112 | TTree* treeClusters = loader->TreeR(); | |
113 | if (!treeClusters) { | |
114 | loader->MakeTree("R"); | |
115 | treeClusters = loader->TreeR(); | |
116 | } | |
117 | ||
118 | clusterer.SetOutput(treeClusters); | |
119 | clusterer.Digits2Clusters(rawReader); | |
120 | ||
121 | loader->WriteRecPoints("OVERWRITE"); | |
122 | } | |
123 | ||
124 | loader->UnloadRecPoints(); | |
125 | } | |
126 | ||
59697224 | 127 | //_____________________________________________________________________________ |
128 | AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* runLoader) const | |
129 | { | |
130 | // create a TPC tracker | |
131 | ||
132 | AliTPCParam* param = GetTPCParam(runLoader); | |
90c7886e | 133 | if (!param) { |
134 | AliWarning("Loading default TPC parameters !"); | |
135 | param = new AliTPCParamSR; | |
136 | } | |
4fb6310b | 137 | param->ReadGeoMatrices(); |
59697224 | 138 | return new AliTPCtrackerMI(param); |
139 | } | |
140 | ||
141 | //_____________________________________________________________________________ | |
142 | void AliTPCReconstructor::FillESD(AliRunLoader* /*runLoader*/, | |
143 | AliESD* esd) const | |
144 | { | |
145 | // make PID | |
146 | ||
147 | Double_t parTPC[] = {47., 0.10, 10.}; | |
148 | AliTPCpidESD tpcPID(parTPC); | |
149 | tpcPID.MakePID(esd); | |
150 | } | |
151 | ||
152 | ||
153 | //_____________________________________________________________________________ | |
154 | AliTPCParam* AliTPCReconstructor::GetTPCParam(AliRunLoader* runLoader) const | |
155 | { | |
156 | // get the TPC parameters | |
157 | ||
6d75e4b6 | 158 | TDirectory* saveDir = gDirectory; |
159 | runLoader->CdGAFile(); | |
160 | ||
161 | AliTPCParam* param = (AliTPCParam*) gDirectory->Get("75x40_100x60_150x60"); | |
162 | if (!param) Error("GetTPCParam", "no TPC parameters found"); | |
163 | ||
164 | saveDir->cd(); | |
165 | return param; | |
59697224 | 166 | } |