]>
Commit | Line | Data |
---|---|---|
121a60bd | 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 ITS reconstruction // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
e62c1aea | 24 | #include "Riostream.h" |
121a60bd | 25 | #include "AliITSReconstructor.h" |
00a7cc50 | 26 | #include "AliRun.h" |
121a60bd | 27 | #include "AliRunLoader.h" |
113c12f1 | 28 | #include "AliRawReader.h" |
00a7cc50 | 29 | #include "AliITSDetTypeRec.h" |
7d62fb64 | 30 | #include "AliITSLoader.h" |
e43c066c | 31 | #include "AliITStrackerMI.h" |
121a60bd | 32 | #include "AliITStrackerSA.h" |
33 | #include "AliITSVertexerIons.h" | |
34 | #include "AliITSVertexerFast.h" | |
35 | #include "AliITSVertexerPPZ.h" | |
36 | #include "AliITSVertexerZ.h" | |
37 | #include "AliESD.h" | |
38 | #include "AliITSpidESD.h" | |
e62c1aea | 39 | #include "AliITSpidESD1.h" |
40 | #include "AliITSpidESD2.h" | |
023ae34b | 41 | #include "AliITSInitGeometry.h" |
121a60bd | 42 | |
43 | ClassImp(AliITSReconstructor) | |
44 | ||
e62c1aea | 45 | //___________________________________________________________________________ |
94631b2f | 46 | AliITSReconstructor::AliITSReconstructor() : AliReconstructor(), |
47 | fItsPID(0) | |
48 | { | |
e62c1aea | 49 | // Default constructor |
e62c1aea | 50 | } |
51 | //___________________________________________________________________________ | |
52 | AliITSReconstructor::~AliITSReconstructor(){ | |
53 | // destructor | |
54 | delete fItsPID; | |
55 | } | |
56 | //______________________________________________________________________ | |
94631b2f | 57 | AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob), |
58 | fItsPID(ob.fItsPID) | |
59 | { | |
e62c1aea | 60 | // Copy constructor |
e62c1aea | 61 | } |
62 | ||
63 | //______________________________________________________________________ | |
94631b2f | 64 | AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& ob ){ |
e62c1aea | 65 | // Assignment operator |
94631b2f | 66 | this->~AliITSReconstructor(); |
67 | new(this) AliITSReconstructor(ob); | |
e62c1aea | 68 | return *this; |
69 | } | |
023ae34b | 70 | //______________________________________________________________________ |
94631b2f | 71 | void AliITSReconstructor::Init(AliRunLoader *runLoader) const{ |
023ae34b | 72 | // Initalize this constructor bet getting/creating the objects |
73 | // nesseary for a proper ITS reconstruction. | |
74 | // Inputs: | |
75 | // AliRunLoader *runLoader Pointer to the run loader to allow | |
76 | // the getting of files/folders data | |
77 | // needed to do reconstruction | |
78 | // Output: | |
79 | // none. | |
80 | // Return: | |
81 | // none. | |
00a7cc50 | 82 | |
023ae34b | 83 | AliITSInitGeometry *initgeom = new AliITSInitGeometry("AliITSvPPRasymmFMD", |
84 | 2); | |
85 | AliITSgeom *geom = initgeom->CreateAliITSgeom(); | |
86 | delete initgeom; // once created, do not need initgeom any more. | |
87 | AliITSLoader* loader = static_cast<AliITSLoader*> | |
88 | (runLoader->GetLoader("ITSLoader")); | |
89 | if (!loader) { | |
90 | Error("Init", "ITS loader not found"); | |
91 | return; | |
92 | } | |
93 | loader->SetITSgeom(geom); | |
94 | return; | |
95 | } | |
121a60bd | 96 | //_____________________________________________________________________________ |
97 | void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const | |
98 | { | |
99 | // reconstruct clusters | |
100 | ||
7d62fb64 | 101 | |
8e50d897 | 102 | AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader")); |
121a60bd | 103 | if (!loader) { |
104 | Error("Reconstruct", "ITS loader not found"); | |
105 | return; | |
106 | } | |
8e50d897 | 107 | AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader); |
00a7cc50 | 108 | rec->SetDefaults(); |
109 | ||
121a60bd | 110 | loader->LoadRecPoints("recreate"); |
111 | loader->LoadDigits("read"); | |
112 | runLoader->LoadKinematics(); | |
00a7cc50 | 113 | TString option = GetOption(); |
114 | Bool_t clusfinder=kTRUE; // Default: V2 cluster finder | |
115 | if(option.Contains("OrigCF"))clusfinder=kFALSE; | |
121a60bd | 116 | |
121a60bd | 117 | Int_t nEvents = runLoader->GetNumberOfEvents(); |
118 | ||
119 | for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { | |
120 | runLoader->GetEvent(iEvent); | |
00a7cc50 | 121 | if(loader->TreeR()==0x0) loader->MakeTree("R"); |
122 | rec->MakeBranch("R"); | |
123 | rec->SetTreeAddress(); | |
124 | rec->DigitsToRecPoints(iEvent,0,"All",clusfinder); | |
121a60bd | 125 | } |
126 | ||
127 | loader->UnloadRecPoints(); | |
128 | loader->UnloadDigits(); | |
129 | runLoader->UnloadKinematics(); | |
130 | } | |
131 | ||
00a7cc50 | 132 | //_________________________________________________________________ |
133 | void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader, | |
134 | AliRawReader* rawReader) const | |
113c12f1 | 135 | { |
00a7cc50 | 136 | // reconstruct clusters |
113c12f1 | 137 | |
00a7cc50 | 138 | |
8e50d897 | 139 | AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader")); |
113c12f1 | 140 | if (!loader) { |
141 | Error("Reconstruct", "ITS loader not found"); | |
142 | return; | |
143 | } | |
00a7cc50 | 144 | |
8e50d897 | 145 | AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader); |
00a7cc50 | 146 | rec->SetDefaults(); |
147 | rec->SetDefaultClusterFindersV2(kTRUE); | |
113c12f1 | 148 | |
00a7cc50 | 149 | loader->LoadRecPoints("recreate"); |
113c12f1 | 150 | |
151 | Int_t iEvent = 0; | |
113c12f1 | 152 | |
00a7cc50 | 153 | while(rawReader->NextEvent()) { |
154 | runLoader->GetEvent(iEvent++); | |
155 | if(loader->TreeR()==0x0) loader->MakeTree("R"); | |
156 | rec->DigitsToRecPoints(rawReader); | |
113c12f1 | 157 | } |
158 | ||
159 | loader->UnloadRecPoints(); | |
160 | } | |
161 | ||
121a60bd | 162 | //_____________________________________________________________________________ |
e62c1aea | 163 | AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader)const |
121a60bd | 164 | { |
165 | // create a ITS tracker | |
166 | ||
7d62fb64 | 167 | |
e43c066c | 168 | TString selectedTracker = GetOption(); |
e62c1aea | 169 | AliTracker* tracker; |
170 | if (selectedTracker.Contains("MI")) { | |
e341247d | 171 | tracker = new AliITStrackerMI(0); |
e62c1aea | 172 | } |
173 | else { | |
cc088660 | 174 | tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI |
e62c1aea | 175 | } |
7d62fb64 | 176 | |
e62c1aea | 177 | TString selectedPIDmethod = GetOption(); |
178 | AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); | |
179 | if (!loader) { | |
180 | Error("CreateTracker", "ITS loader not found"); | |
181 | } | |
182 | if(selectedPIDmethod.Contains("LandauFitPID")){ | |
183 | loader->AdoptITSpid(new AliITSpidESD2((AliITStrackerMI*)tracker,loader)); | |
184 | } | |
185 | else{ | |
186 | Double_t parITS[] = {34., 0.15, 10.}; | |
187 | loader->AdoptITSpid(new AliITSpidESD1(parITS)); | |
188 | } | |
189 | return tracker; | |
7d62fb64 | 190 | |
121a60bd | 191 | } |
192 | ||
193 | //_____________________________________________________________________________ | |
194 | AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const | |
195 | { | |
196 | // create a ITS vertexer | |
197 | ||
f4d5a8d1 | 198 | TString selectedVertexer = GetOption(); |
121a60bd | 199 | if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){ |
200 | Info("CreateVertexer","a AliITSVertexerIons object has been selected\n"); | |
201 | return new AliITSVertexerIons("null"); | |
202 | } | |
203 | if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){ | |
204 | Double_t smear[3]={0.005,0.005,0.01}; | |
205 | Info("CreateVertexer","a AliITSVertexerFast object has been selected\n"); | |
206 | return new AliITSVertexerFast(smear); | |
207 | } | |
208 | if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){ | |
209 | Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n"); | |
210 | return new AliITSVertexerPPZ("null"); | |
211 | } | |
212 | // by default an AliITSVertexerZ object is instatiated | |
213 | Info("CreateVertexer","a AliITSVertexerZ object has been selected\n"); | |
214 | return new AliITSVertexerZ("null"); | |
215 | } | |
216 | ||
217 | //_____________________________________________________________________________ | |
e62c1aea | 218 | void AliITSReconstructor::FillESD(AliRunLoader* runLoader, |
121a60bd | 219 | AliESD* esd) const |
220 | { | |
e62c1aea | 221 | // make PID, find V0s and cascade |
222 | AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); | |
223 | AliITSpidESD *pidESD = 0; | |
224 | TString selectedPIDmethod = GetOption(); | |
225 | if(selectedPIDmethod.Contains("LandauFitPID")){ | |
149c4c59 | 226 | Info("FillESD","ITS LandauFitPID option has been selected\n"); |
e62c1aea | 227 | pidESD=loader->GetITSpid(); |
228 | } | |
229 | else{ | |
149c4c59 | 230 | Info("FillESD","ITS default PID\n"); |
e62c1aea | 231 | pidESD=loader->GetITSpid(); |
232 | } | |
233 | if(pidESD!=0){ | |
234 | pidESD->MakePID(esd); | |
235 | } | |
236 | else { | |
237 | Error("FillESD","!! cannot do the PID !!\n"); | |
238 | } | |
121a60bd | 239 | } |
240 | ||
241 | ||
242 | //_____________________________________________________________________________ | |
243 | AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const | |
244 | { | |
245 | // get the ITS geometry | |
246 | ||
247 | if (!runLoader->GetAliRun()) runLoader->LoadgAlice(); | |
248 | if (!runLoader->GetAliRun()) { | |
249 | Error("GetITSgeom", "couldn't get AliRun object"); | |
250 | return NULL; | |
251 | } | |
8e50d897 | 252 | AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); |
253 | AliITSgeom* geom = (AliITSgeom*)loader->GetITSgeom(); | |
7d62fb64 | 254 | if(!geom){ |
255 | Error("GetITSgeom","no ITS geometry available"); | |
121a60bd | 256 | return NULL; |
257 | } | |
7d62fb64 | 258 | |
259 | return geom; | |
121a60bd | 260 | } |