]>
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" |
6cae184e | 30 | #include "AliITSgeom.h" |
7d62fb64 | 31 | #include "AliITSLoader.h" |
e43c066c | 32 | #include "AliITStrackerMI.h" |
c0342e67 | 33 | #include "AliITStrackerV2.h" |
121a60bd | 34 | #include "AliITStrackerSA.h" |
35 | #include "AliITSVertexerIons.h" | |
36 | #include "AliITSVertexerFast.h" | |
3acc14d5 | 37 | #include "AliITSVertexer3D.h" |
121a60bd | 38 | #include "AliITSVertexerZ.h" |
3acc14d5 | 39 | #include "AliITSVertexerCosmics.h" |
af885e0f | 40 | #include "AliESDEvent.h" |
121a60bd | 41 | #include "AliITSpidESD.h" |
e62c1aea | 42 | #include "AliITSpidESD1.h" |
43 | #include "AliITSpidESD2.h" | |
023ae34b | 44 | #include "AliITSInitGeometry.h" |
121a60bd | 45 | |
44347160 | 46 | |
121a60bd | 47 | ClassImp(AliITSReconstructor) |
48 | ||
44347160 | 49 | AliITSRecoParam *AliITSReconstructor::fgkRecoParam =0; // reconstruction parameters |
50 | ||
e62c1aea | 51 | //___________________________________________________________________________ |
94631b2f | 52 | AliITSReconstructor::AliITSReconstructor() : AliReconstructor(), |
6cae184e | 53 | fItsPID(0), |
54 | fDetTypeRec(0) | |
94631b2f | 55 | { |
e62c1aea | 56 | // Default constructor |
44347160 | 57 | if (!fgkRecoParam) { |
58 | AliError("The Reconstruction parameters nonitialized - Used default one"); | |
59 | fgkRecoParam = AliITSRecoParam::GetHighFluxParam(); | |
60 | } | |
e62c1aea | 61 | } |
62 | //___________________________________________________________________________ | |
63 | AliITSReconstructor::~AliITSReconstructor(){ | |
64 | // destructor | |
65 | delete fItsPID; | |
44347160 | 66 | if(fgkRecoParam) delete fgkRecoParam; |
6cae184e | 67 | if(fDetTypeRec) delete fDetTypeRec; |
e62c1aea | 68 | } |
69 | //______________________________________________________________________ | |
94631b2f | 70 | AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob), |
6cae184e | 71 | fItsPID(ob.fItsPID), |
72 | fDetTypeRec(ob.fDetTypeRec) | |
73 | ||
94631b2f | 74 | { |
e62c1aea | 75 | // Copy constructor |
e62c1aea | 76 | } |
77 | ||
78 | //______________________________________________________________________ | |
94631b2f | 79 | AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& ob ){ |
e62c1aea | 80 | // Assignment operator |
94631b2f | 81 | this->~AliITSReconstructor(); |
82 | new(this) AliITSReconstructor(ob); | |
e62c1aea | 83 | return *this; |
84 | } | |
6cae184e | 85 | |
023ae34b | 86 | //______________________________________________________________________ |
6cae184e | 87 | void AliITSReconstructor::Init(AliRunLoader */*runLoader*/) { |
023ae34b | 88 | // Initalize this constructor bet getting/creating the objects |
89 | // nesseary for a proper ITS reconstruction. | |
90 | // Inputs: | |
91 | // AliRunLoader *runLoader Pointer to the run loader to allow | |
92 | // the getting of files/folders data | |
93 | // needed to do reconstruction | |
94 | // Output: | |
95 | // none. | |
96 | // Return: | |
97 | // none. | |
00a7cc50 | 98 | |
108bd0fe | 99 | AliITSInitGeometry initgeom; |
100 | AliITSgeom *geom = initgeom.CreateAliITSgeom(); | |
101 | AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data())); | |
6cae184e | 102 | |
103 | fDetTypeRec = new AliITSDetTypeRec(); | |
104 | fDetTypeRec->SetITSgeom(geom); | |
105 | fDetTypeRec->SetDefaults(); | |
106 | ||
023ae34b | 107 | return; |
108 | } | |
6cae184e | 109 | |
121a60bd | 110 | //_____________________________________________________________________________ |
6cae184e | 111 | void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const |
121a60bd | 112 | { |
113 | // reconstruct clusters | |
114 | ||
00a7cc50 | 115 | TString option = GetOption(); |
116 | Bool_t clusfinder=kTRUE; // Default: V2 cluster finder | |
117 | if(option.Contains("OrigCF"))clusfinder=kFALSE; | |
121a60bd | 118 | |
6cae184e | 119 | fDetTypeRec->SetTreeAddressD(digitsTree); |
120 | fDetTypeRec->MakeBranch(clustersTree,"R"); | |
121 | fDetTypeRec->SetTreeAddressR(clustersTree); | |
122 | fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",clusfinder); | |
121a60bd | 123 | } |
124 | ||
00a7cc50 | 125 | //_________________________________________________________________ |
6cae184e | 126 | void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const |
113c12f1 | 127 | { |
6cae184e | 128 | // reconstruct clusters from raw data |
00a7cc50 | 129 | |
6cae184e | 130 | fDetTypeRec->SetDefaultClusterFindersV2(kTRUE); |
131 | fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree); | |
113c12f1 | 132 | } |
133 | ||
121a60bd | 134 | //_____________________________________________________________________________ |
e62c1aea | 135 | AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader)const |
121a60bd | 136 | { |
137 | // create a ITS tracker | |
138 | ||
7d62fb64 | 139 | |
e43c066c | 140 | TString selectedTracker = GetOption(); |
e62c1aea | 141 | AliTracker* tracker; |
142 | if (selectedTracker.Contains("MI")) { | |
e341247d | 143 | tracker = new AliITStrackerMI(0); |
c0342e67 | 144 | } |
145 | else if (selectedTracker.Contains("V2")) { | |
146 | tracker = new AliITStrackerV2(0); | |
e62c1aea | 147 | } |
148 | else { | |
cc088660 | 149 | tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI |
1966f03c | 150 | AliITStrackerSA *sat=(AliITStrackerSA*)tracker; |
151 | if(selectedTracker.Contains("onlyITS"))sat->SetSAFlag(kTRUE); | |
152 | if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n"); | |
b8ed1a92 | 153 | if(selectedTracker.Contains("cosmics")||selectedTracker.Contains("COSMICS")) |
154 | sat->SetOuterStartLayer(AliITSgeomTGeo::GetNLayers()-2); | |
e62c1aea | 155 | } |
7d62fb64 | 156 | |
e62c1aea | 157 | TString selectedPIDmethod = GetOption(); |
158 | AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); | |
159 | if (!loader) { | |
160 | Error("CreateTracker", "ITS loader not found"); | |
161 | } | |
162 | if(selectedPIDmethod.Contains("LandauFitPID")){ | |
163 | loader->AdoptITSpid(new AliITSpidESD2((AliITStrackerMI*)tracker,loader)); | |
164 | } | |
165 | else{ | |
25fee9b6 | 166 | Double_t parITS[] = {0.15, 10.}; //PH positions of the MIP peak |
e62c1aea | 167 | loader->AdoptITSpid(new AliITSpidESD1(parITS)); |
168 | } | |
169 | return tracker; | |
7d62fb64 | 170 | |
121a60bd | 171 | } |
172 | ||
173 | //_____________________________________________________________________________ | |
174 | AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const | |
175 | { | |
176 | // create a ITS vertexer | |
177 | ||
f4d5a8d1 | 178 | TString selectedVertexer = GetOption(); |
121a60bd | 179 | if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){ |
180 | Info("CreateVertexer","a AliITSVertexerIons object has been selected\n"); | |
181 | return new AliITSVertexerIons("null"); | |
182 | } | |
183 | if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){ | |
184 | Double_t smear[3]={0.005,0.005,0.01}; | |
185 | Info("CreateVertexer","a AliITSVertexerFast object has been selected\n"); | |
186 | return new AliITSVertexerFast(smear); | |
187 | } | |
3acc14d5 | 188 | if(selectedVertexer.Contains("3d") || selectedVertexer.Contains("3D")){ |
189 | Info("CreateVertexer","a AliITSVertexer3D object has been selected\n"); | |
190 | return new AliITSVertexer3D("null"); | |
191 | } | |
192 | if(selectedVertexer.Contains("cosmics") || selectedVertexer.Contains("COSMICS")){ | |
193 | Info("CreateVertexer","a AliITSVertexerCosmics object has been selected\n"); | |
194 | return new AliITSVertexerCosmics(); | |
121a60bd | 195 | } |
196 | // by default an AliITSVertexerZ object is instatiated | |
197 | Info("CreateVertexer","a AliITSVertexerZ object has been selected\n"); | |
198 | return new AliITSVertexerZ("null"); | |
199 | } | |
200 | ||
201 | //_____________________________________________________________________________ | |
e62c1aea | 202 | void AliITSReconstructor::FillESD(AliRunLoader* runLoader, |
af885e0f | 203 | AliESDEvent* esd) const |
121a60bd | 204 | { |
e62c1aea | 205 | // make PID, find V0s and cascade |
206 | AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); | |
207 | AliITSpidESD *pidESD = 0; | |
208 | TString selectedPIDmethod = GetOption(); | |
209 | if(selectedPIDmethod.Contains("LandauFitPID")){ | |
149c4c59 | 210 | Info("FillESD","ITS LandauFitPID option has been selected\n"); |
e62c1aea | 211 | pidESD=loader->GetITSpid(); |
212 | } | |
213 | else{ | |
149c4c59 | 214 | Info("FillESD","ITS default PID\n"); |
e62c1aea | 215 | pidESD=loader->GetITSpid(); |
216 | } | |
217 | if(pidESD!=0){ | |
218 | pidESD->MakePID(esd); | |
219 | } | |
220 | else { | |
221 | Error("FillESD","!! cannot do the PID !!\n"); | |
222 | } | |
121a60bd | 223 | } |