]>
Commit | Line | Data |
---|---|---|
9dcfce73 | 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 | ||
17 | /////////////////////////////////////////////////////////////////////////////// | |
18 | // // | |
19 | // Component for redoing the reconstruction from the clusters and tracks | |
20 | // | |
21 | // The new calibration data used | |
22 | // | |
23 | // In reality it overwrites the content of the ESD | |
24 | // | |
25 | ||
3bf5c7a6 | 26 | /* |
27 | ||
28 | gSystem->Load("libANALYSIS"); | |
29 | gSystem->Load("libTPCcalib"); | |
30 | // | |
31 | gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros"); | |
32 | gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+") | |
33 | AliXRDPROOFtoolkit tool; | |
11c7a854 | 34 | TChain * chainCl = tool.MakeChain("calib.txt","Clusters",0,1); |
35 | chainCl->Lookup(); | |
36 | TChain * chainTr = tool.MakeChain("calib.txt","Tracks",0,1); | |
37 | chainTr->Lookup(); | |
3bf5c7a6 | 38 | |
39 | ||
40 | ||
41 | */ | |
42 | ||
43 | ||
44 | ||
9dcfce73 | 45 | // marian.ivanov@cern.ch |
46 | // | |
47 | #include "AliTPCcalibCalib.h" | |
48 | #include "TSystem.h" | |
49 | #include "TFile.h" | |
50 | #include "TTreeStream.h" | |
51 | #include "AliLog.h" | |
52 | #include "TTimeStamp.h" | |
53 | #include "AliESDEvent.h" | |
54 | #include "AliESDfriend.h" | |
55 | #include "AliESDtrack.h" | |
56 | #include "AliTracker.h" | |
11c7a854 | 57 | #include "AliTPCClusterParam.h" |
b5738316 | 58 | #include "AliTPCParam.h" |
9dcfce73 | 59 | |
60 | #include "AliTPCcalibDB.h" | |
61 | #include "AliTPCTransform.h" | |
7af539c6 | 62 | #include "AliTPCRecoParam.h" |
9dcfce73 | 63 | #include "AliTPCclusterMI.h" |
64 | #include "AliTPCseed.h" | |
15e48021 | 65 | #include "AliTPCPointCorrection.h" |
b5738316 | 66 | #include <TGeoManager.h> |
67 | #include <TGeoPhysicalNode.h> | |
be67055b | 68 | #include "TDatabasePDG.h" |
9dcfce73 | 69 | ClassImp(AliTPCcalibCalib) |
70 | ||
71 | AliTPCcalibCalib::AliTPCcalibCalib(): | |
7af539c6 | 72 | AliTPCcalibBase(), |
73 | fApplyExBCorrection(1), // apply ExB correction | |
74 | fApplyTOFCorrection(1), // apply TOF correction | |
75 | fApplyPositionCorrection(1), // apply position correction | |
76 | fApplySectorAlignment(1), // apply sector alignment | |
77 | fApplyRPhiCorrection(1), // apply R-Phi correction | |
78 | fApplyRCorrection(1) // apply Radial correction | |
79 | ||
9dcfce73 | 80 | { |
81 | // | |
82 | // Constructor | |
83 | // | |
84 | } | |
85 | ||
86 | ||
87 | AliTPCcalibCalib::AliTPCcalibCalib(const Text_t *name, const Text_t *title) | |
7af539c6 | 88 | :AliTPCcalibBase(), |
89 | fApplyExBCorrection(1), // apply ExB correction | |
90 | fApplyTOFCorrection(1), // apply TOF correction | |
91 | fApplyPositionCorrection(1), // apply position correction | |
92 | fApplySectorAlignment(1), // apply sector alignment | |
93 | fApplyRPhiCorrection(1), // apply R-Phi correction | |
94 | fApplyRCorrection(1) // apply Radial correction | |
9dcfce73 | 95 | { |
96 | SetName(name); | |
97 | SetTitle(title); | |
98 | } | |
99 | ||
100 | ||
101 | AliTPCcalibCalib::AliTPCcalibCalib(const AliTPCcalibCalib&calib): | |
7af539c6 | 102 | AliTPCcalibBase(calib), |
103 | fApplyExBCorrection(calib.GetApplyExBCorrection()), | |
104 | fApplyTOFCorrection(calib.GetApplyTOFCorrection()), | |
105 | fApplyPositionCorrection(calib.GetApplyPositionCorrection()), | |
106 | fApplySectorAlignment(calib.GetApplySectorAlignment()), | |
107 | fApplyRPhiCorrection(calib.GetApplyRPhiCorrection()), | |
108 | fApplyRCorrection(calib.GetApplyRCorrection()) | |
109 | ||
9dcfce73 | 110 | { |
111 | // | |
112 | // copy constructor | |
113 | // | |
114 | } | |
115 | ||
116 | AliTPCcalibCalib &AliTPCcalibCalib::operator=(const AliTPCcalibCalib&calib){ | |
117 | // | |
118 | // | |
119 | // | |
120 | ((AliTPCcalibBase *)this)->operator=(calib); | |
121 | return *this; | |
122 | } | |
123 | ||
124 | ||
125 | AliTPCcalibCalib::~AliTPCcalibCalib() { | |
126 | // | |
127 | // destructor | |
128 | // | |
129 | } | |
130 | ||
131 | ||
132 | void AliTPCcalibCalib::Process(AliESDEvent *event){ | |
133 | // | |
134 | // | |
135 | // | |
136 | if (!event) { | |
137 | return; | |
138 | } | |
139 | AliESDfriend *ESDfriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend")); | |
140 | if (!ESDfriend) { | |
141 | return; | |
142 | } | |
d0c09227 | 143 | if (ESDfriend->TestSkipBit()) return; |
9dcfce73 | 144 | if (GetDebugLevel()>20) printf("Hallo world: Im here\n"); |
19d6a12a | 145 | Int_t ntracks=ESDfriend->GetNumberOfTracks(); |
91350f5b | 146 | //AliTPCcalibDB::Instance()->SetExBField(fMagF); |
5c3e0d17 | 147 | |
9dcfce73 | 148 | // |
149 | // | |
150 | // | |
151 | ||
152 | for (Int_t i=0;i<ntracks;++i) { | |
3e55050f | 153 | AliESDtrack *track = event->GetTrack(i); |
e527a1b9 | 154 | AliESDfriendTrack *friendTrack = (AliESDfriendTrack*) ESDfriend->GetTrack(i); |
155 | if (!friendTrack) continue; | |
4486a91f | 156 | //track->SetFriendTrack(friendTrack); |
157 | fCurrentFriendTrack=friendTrack; | |
3e55050f | 158 | const AliExternalTrackParam * trackIn = track->GetInnerParam(); |
9dcfce73 | 159 | const AliExternalTrackParam * trackOut = track->GetOuterParam(); |
3e55050f | 160 | AliExternalTrackParam * tpcOut = (AliExternalTrackParam *)friendTrack->GetTPCOut(); |
9dcfce73 | 161 | if (!trackIn) continue; |
162 | if (!trackOut) continue; | |
3e55050f | 163 | if (!tpcOut) continue; |
9dcfce73 | 164 | TObject *calibObject; |
165 | AliTPCseed *seed = 0; | |
166 | for (Int_t l=0;(calibObject=friendTrack->GetCalibObject(l));++l) { | |
167 | if ((seed=dynamic_cast<AliTPCseed*>(calibObject))) break; | |
168 | } | |
169 | if (!seed) continue; | |
e527a1b9 | 170 | RefitTrack(track, seed, event->GetMagneticField()); |
3e55050f | 171 | (*tpcOut)=*(track->GetOuterParam()); |
9dcfce73 | 172 | } |
173 | return; | |
174 | } | |
175 | ||
38b1a1ca | 176 | Bool_t AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Float_t magesd){ |
9dcfce73 | 177 | // |
178 | // Refit track | |
38b1a1ca | 179 | // if magesd==0 forget the curvature |
9dcfce73 | 180 | |
15e48021 | 181 | // |
182 | // 0 - Setup transform object | |
183 | // | |
76c58ee2 | 184 | const Double_t kxIFC = 83.; // position of IFC |
185 | const Double_t kxOFC = 250.; // position of OFC | |
186 | const Double_t kaFC = 1.; // amplitude | |
187 | const Double_t ktFC = 5.0; // slope of error | |
188 | //cov[0]+= kaFC*(TMath::Exp(-TMath::Abs(cl->GetX()-kxIFC)/ktFC)+TMath::Exp(-TMath::Abs(cl->GetX()-kxOFC)/ktFC)); | |
189 | //cov[2]+= kaFC*(TMath::Exp(-TMath::Abs(cl->GetX()-kxIFC)/ktFC)+TMath::Exp(-TMath::Abs(cl->GetX()-kxOFC)/ktFC)); | |
190 | ||
4486a91f | 191 | static Int_t streamCounter=0; |
192 | streamCounter++; | |
193 | AliESDfriendTrack *friendTrack = fCurrentFriendTrack; | |
e527a1b9 | 194 | |
15e48021 | 195 | AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ; |
b96c3aef | 196 | AliTPCParam *param = AliTPCcalibDB::Instance()->GetParameters(); |
15e48021 | 197 | transform->SetCurrentRun(fRun); |
198 | transform->SetCurrentTimeStamp((UInt_t)fTime); | |
7af539c6 | 199 | if(!fApplyExBCorrection) { // disable ExB correction in transform |
200 | if(transform->GetCurrentRecoParam()) | |
201 | transform->GetCurrentRecoParamNonConst()->SetUseExBCorrection(0); | |
202 | } | |
203 | if(!fApplyTOFCorrection) { // disable TOF correction in transform | |
204 | if(transform->GetCurrentRecoParam()) | |
205 | transform->GetCurrentRecoParamNonConst()->SetUseTOFCorrection(kFALSE); | |
206 | } | |
207 | ||
9dcfce73 | 208 | // |
209 | // First apply calibration | |
210 | // | |
064244d8 | 211 | // AliTPCPointCorrection * corr = AliTPCPointCorrection::Instance(); |
9dcfce73 | 212 | for (Int_t irow=0;irow<159;irow++) { |
213 | AliTPCclusterMI *cluster=seed->GetClusterPointer(irow); | |
214 | if (!cluster) continue; | |
215 | AliTPCclusterMI cl0(*cluster); | |
216 | Double_t x[3]={cluster->GetRow(),cluster->GetPad(),cluster->GetTimeBin()}; | |
217 | Int_t i[1]={cluster->GetDetector()}; | |
7af539c6 | 218 | |
9dcfce73 | 219 | transform->Transform(x,i,0,1); |
11c7a854 | 220 | // |
221 | // get position correction | |
222 | // | |
223 | Int_t ipad=0; | |
224 | if (cluster->GetDetector()>35) ipad=1; | |
f26def9e | 225 | Float_t dy =0;//AliTPCClusterParam::SPosCorrection(0,ipad,cluster->GetPad(),cluster->GetTimeBin(),cluster->GetZ(),cluster->GetSigmaY2(),cluster->GetSigmaZ2(),cluster->GetMax()); |
226 | Float_t dz =0;//AliTPCClusterParam::SPosCorrection(1,ipad,cluster->GetPad(),cluster->GetTimeBin(),cluster->GetZ(),cluster->GetSigmaY2(),cluster->GetSigmaZ2(),cluster->GetMax()); | |
9dcfce73 | 227 | // |
228 | cluster->SetX(x[0]); | |
229 | cluster->SetY(x[1]); | |
230 | cluster->SetZ(x[2]); | |
b96c3aef | 231 | |
232 | // | |
233 | // Apply alignemnt | |
234 | // | |
b322e06a | 235 | if (transform->GetCurrentRecoParam()->GetUseSectorAlignment()){ |
b5738316 | 236 | if (!param->IsGeoRead()) param->ReadGeoMatrices(); |
237 | TGeoHMatrix *mat = param->GetClusterMatrix(cluster->GetDetector()); | |
238 | //TGeoHMatrix mat; | |
239 | Double_t pos[3]= {cluster->GetX(),cluster->GetY(),cluster->GetZ()}; | |
240 | Double_t posC[3]={cluster->GetX(),cluster->GetY(),cluster->GetZ()}; | |
241 | if (mat) mat->LocalToMaster(pos,posC); | |
242 | else{ | |
243 | // chack Loading of Geo matrices from GeoManager - TEMPORARY FIX | |
244 | } | |
245 | cluster->SetX(posC[0]); | |
246 | cluster->SetY(posC[1]); | |
247 | cluster->SetZ(posC[2]); | |
248 | } | |
b96c3aef | 249 | |
250 | ||
251 | ||
4486a91f | 252 | if (fStreamLevel>2 && streamCounter<20*fStreamLevel ){ |
253 | // dump debug info if required | |
9dcfce73 | 254 | TTreeSRedirector *cstream = GetDebugStreamer(); |
255 | if (cstream){ | |
256 | (*cstream)<<"Clusters"<< | |
108953e9 | 257 | "run="<<fRun<< // run number |
258 | "event="<<fEvent<< // event number | |
259 | "time="<<fTime<< // time stamp of event | |
260 | "trigger="<<fTrigger<< // trigger | |
15e48021 | 261 | "triggerClass="<<&fTriggerClass<< // trigger |
108953e9 | 262 | "mag="<<fMagF<< // magnetic field |
9dcfce73 | 263 | "cl0.="<<&cl0<< |
264 | "cl.="<<cluster<< | |
11c7a854 | 265 | "cy="<<dy<< |
266 | "cz="<<dz<< | |
9dcfce73 | 267 | "\n"; |
268 | } | |
269 | } | |
270 | } | |
15e48021 | 271 | // |
272 | // | |
273 | // | |
11c7a854 | 274 | Int_t ncl = seed->GetNumberOfClusters(); |
b5738316 | 275 | const Double_t kResetCov=4.; |
276 | const Double_t kSigma=5.; | |
11c7a854 | 277 | Double_t covar[15]; |
278 | for (Int_t i=0;i<15;i++) covar[i]=0; | |
b5738316 | 279 | covar[0]=kSigma*kSigma; |
280 | covar[2]=kSigma*kSigma; | |
281 | covar[5]=kSigma*kSigma/Float_t(ncl*ncl); | |
282 | covar[9]=kSigma*kSigma/Float_t(ncl*ncl); | |
283 | covar[14]=0.2*0.2; | |
38b1a1ca | 284 | if (TMath::Abs(magesd)<0.05) { |
285 | covar[14]=0.025*0.025; | |
286 | } | |
9dcfce73 | 287 | // |
288 | // And now do refit | |
289 | // | |
11c7a854 | 290 | AliExternalTrackParam * trackInOld = (AliExternalTrackParam*)track->GetInnerParam(); |
e527a1b9 | 291 | AliExternalTrackParam * trackOuter = (AliExternalTrackParam*)track->GetOuterParam(); |
292 | AliExternalTrackParam * trackOutOld = (AliExternalTrackParam *)friendTrack->GetTPCOut(); | |
be67055b | 293 | Double_t mass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass(); |
294 | ||
e527a1b9 | 295 | |
3e55050f | 296 | |
9dcfce73 | 297 | AliExternalTrackParam trackIn = *trackOutOld; |
b5738316 | 298 | trackIn.ResetCovariance(kResetCov); |
299 | trackIn.AddCovariance(covar); | |
38b1a1ca | 300 | if (TMath::Abs(magesd)<0.05) { |
301 | ((Double_t&)(trackIn.GetParameter()[4]))=0.000000001; | |
b5738316 | 302 | ((Double_t&)(trackIn.GetCovariance()[14]))=covar[14]; // fix the line |
38b1a1ca | 303 | } |
b5738316 | 304 | |
9dcfce73 | 305 | Double_t xyz[3]; |
306 | Int_t nclIn=0,nclOut=0; | |
307 | // | |
15e48021 | 308 | // Refit in |
309 | // | |
15e48021 | 310 | for (Int_t irow=159; irow>0; irow--){ |
311 | AliTPCclusterMI *cl=seed->GetClusterPointer(irow); | |
312 | if (!cl) continue; | |
313 | if (cl->GetX()<80) continue; | |
314 | Int_t sector = cl->GetDetector(); | |
315 | Float_t dalpha = TMath::DegToRad()*(sector%18*20.+10.)-trackIn.GetAlpha(); | |
91f8fa1d | 316 | if (TMath::Abs(dalpha)>0.01){ |
317 | if (!trackIn.Rotate(TMath::DegToRad()*(sector%18*20.+10.))) break; | |
318 | } | |
15e48021 | 319 | Double_t r[3]={cl->GetX(),cl->GetY(),cl->GetZ()}; |
320 | Double_t cov[3]={0.01,0.,0.01}; //TODO: correct error parametrisation | |
321 | AliTPCseed::GetError(cl, &trackIn,cov[0],cov[2]); | |
322 | cov[0]*=cov[0]; | |
323 | cov[2]*=cov[2]; | |
76c58ee2 | 324 | cov[0]+= kaFC*(TMath::Exp(-TMath::Abs(cl->GetX()-kxIFC)/ktFC)+TMath::Exp(-TMath::Abs(cl->GetX()-kxOFC)/ktFC)); |
325 | cov[2]+= kaFC*(TMath::Exp(-TMath::Abs(cl->GetX()-kxIFC)/ktFC)+TMath::Exp(-TMath::Abs(cl->GetX()-kxOFC)/ktFC)); | |
15e48021 | 326 | trackIn.GetXYZ(xyz); |
be67055b | 327 | // Double_t bz = AliTracker::GetBz(xyz); |
328 | ||
329 | // if (!trackIn.PropagateTo(r[0],bz)) continue; | |
b322e06a | 330 | if (!AliTracker::PropagateTrackToBxByBz(&trackIn, r[0],mass,1.,kFALSE)) continue; |
15e48021 | 331 | |
15e48021 | 332 | if (RejectCluster(cl,&trackIn)) continue; |
333 | nclIn++; | |
334 | trackIn.Update(&r[1],cov); | |
335 | } | |
336 | // | |
337 | AliExternalTrackParam trackOut = trackIn; | |
b5738316 | 338 | trackOut.ResetCovariance(kResetCov); |
339 | trackOut.AddCovariance(covar); | |
38b1a1ca | 340 | if (TMath::Abs(magesd)<0.05) { |
341 | ((Double_t&)(trackOut.GetParameter()[4]))=0.000000001; | |
b5738316 | 342 | ((Double_t&)(trackOut.GetCovariance()[14]))=covar[14]; // fix the line |
38b1a1ca | 343 | } |
b5738316 | 344 | |
15e48021 | 345 | // |
9dcfce73 | 346 | // Refit out |
347 | // | |
15e48021 | 348 | //Bool_t lastEdge=kFALSE; |
9dcfce73 | 349 | for (Int_t irow=0; irow<160; irow++){ |
350 | AliTPCclusterMI *cl=seed->GetClusterPointer(irow); | |
351 | if (!cl) continue; | |
352 | if (cl->GetX()<80) continue; | |
353 | Int_t sector = cl->GetDetector(); | |
354 | Float_t dalpha = TMath::DegToRad()*(sector%18*20.+10.)-trackOut.GetAlpha(); | |
355 | ||
91f8fa1d | 356 | if (TMath::Abs(dalpha)>0.01){ |
357 | if (!trackOut.Rotate(TMath::DegToRad()*(sector%18*20.+10.))) break; | |
358 | } | |
9dcfce73 | 359 | Double_t r[3]={cl->GetX(),cl->GetY(),cl->GetZ()}; |
91350f5b | 360 | |
361 | Double_t cov[3]={0.01,0.,0.01}; //TODO: correct error parametrisation | |
362 | AliTPCseed::GetError(cl, &trackOut,cov[0],cov[2]); | |
363 | cov[0]*=cov[0]; | |
364 | cov[2]*=cov[2]; | |
76c58ee2 | 365 | cov[0]+= kaFC*(TMath::Exp(-TMath::Abs(cl->GetX()-kxIFC)/ktFC)+TMath::Exp(-TMath::Abs(cl->GetX()-kxOFC)/ktFC)); |
366 | cov[2]+= kaFC*(TMath::Exp(-TMath::Abs(cl->GetX()-kxIFC)/ktFC)+TMath::Exp(-TMath::Abs(cl->GetX()-kxOFC)/ktFC)); | |
9dcfce73 | 367 | trackOut.GetXYZ(xyz); |
be67055b | 368 | //Double_t bz = AliTracker::GetBz(xyz); |
369 | // if (!trackOut.PropagateTo(r[0],bz)) continue; | |
b322e06a | 370 | if (!AliTracker::PropagateTrackToBxByBz(&trackOut, r[0],mass,1.,kFALSE)) continue; |
be67055b | 371 | |
42b40d07 | 372 | if (RejectCluster(cl,&trackOut)) continue; |
15e48021 | 373 | nclOut++; |
374 | trackOut.Update(&r[1],cov); | |
375 | //if (cl->GetType()<0) lastEdge=kTRUE; | |
376 | //if (cl->GetType()>=0) lastEdge=kFALSE; | |
9dcfce73 | 377 | } |
378 | // | |
9dcfce73 | 379 | // |
15e48021 | 380 | // |
381 | nclIn=0; | |
382 | trackIn = trackOut; | |
b5738316 | 383 | trackIn.ResetCovariance(kResetCov); |
384 | if (TMath::Abs(magesd)<0.05) { | |
385 | ((Double_t&)(trackIn.GetParameter()[4]))=0.000000001; | |
386 | ((Double_t&)(trackIn.GetCovariance()[14]))=covar[14]; // fix the line | |
387 | } | |
15e48021 | 388 | // |
389 | // Refit in one more time | |
390 | // | |
9dcfce73 | 391 | for (Int_t irow=159; irow>0; irow--){ |
392 | AliTPCclusterMI *cl=seed->GetClusterPointer(irow); | |
393 | if (!cl) continue; | |
394 | if (cl->GetX()<80) continue; | |
395 | Int_t sector = cl->GetDetector(); | |
396 | Float_t dalpha = TMath::DegToRad()*(sector%18*20.+10.)-trackIn.GetAlpha(); | |
91f8fa1d | 397 | if (TMath::Abs(dalpha)>0.01){ |
398 | if (!trackIn.Rotate(TMath::DegToRad()*(sector%18*20.+10.))) break; | |
399 | } | |
9dcfce73 | 400 | Double_t r[3]={cl->GetX(),cl->GetY(),cl->GetZ()}; |
401 | Double_t cov[3]={0.01,0.,0.01}; //TODO: correct error parametrisation | |
91350f5b | 402 | AliTPCseed::GetError(cl, &trackIn,cov[0],cov[2]); |
403 | cov[0]*=cov[0]; | |
404 | cov[2]*=cov[2]; | |
76c58ee2 | 405 | cov[0]+= kaFC*(TMath::Exp(-TMath::Abs(cl->GetX()-kxIFC)/ktFC)+TMath::Exp(-TMath::Abs(cl->GetX()-kxOFC)/ktFC)); |
406 | cov[2]+= kaFC*(TMath::Exp(-TMath::Abs(cl->GetX()-kxIFC)/ktFC)+TMath::Exp(-TMath::Abs(cl->GetX()-kxOFC)/ktFC)); | |
407 | ||
91350f5b | 408 | trackIn.GetXYZ(xyz); |
be67055b | 409 | //Double_t bz = AliTracker::GetBz(xyz); |
410 | ||
411 | // if (!trackIn.PropagateTo(r[0],bz)) continue; | |
b322e06a | 412 | if (!AliTracker::PropagateTrackToBxByBz(&trackIn, r[0],mass,1,kFALSE)) continue; |
9dcfce73 | 413 | |
42b40d07 | 414 | if (RejectCluster(cl,&trackIn)) continue; |
15e48021 | 415 | nclIn++; |
9dcfce73 | 416 | trackIn.Update(&r[1],cov); |
417 | } | |
15e48021 | 418 | |
419 | ||
3bf5c7a6 | 420 | trackIn.Rotate(trackInOld->GetAlpha()); |
421 | trackOut.Rotate(trackOutOld->GetAlpha()); | |
422 | // | |
423 | trackInOld->GetXYZ(xyz); | |
424 | Double_t bz = AliTracker::GetBz(xyz); | |
425 | trackIn.PropagateTo(trackInOld->GetX(),bz); | |
426 | // | |
427 | trackOutOld->GetXYZ(xyz); | |
428 | bz = AliTracker::GetBz(xyz); | |
429 | trackOut.PropagateTo(trackOutOld->GetX(),bz); | |
430 | ||
9dcfce73 | 431 | |
4486a91f | 432 | if (fStreamLevel>0 && streamCounter<100*fStreamLevel){ |
9dcfce73 | 433 | TTreeSRedirector *cstream = GetDebugStreamer(); |
434 | if (cstream){ | |
435 | (*cstream)<<"Tracks"<< | |
108953e9 | 436 | "run="<<fRun<< // run number |
437 | "event="<<fEvent<< // event number | |
438 | "time="<<fTime<< // time stamp of event | |
439 | "trigger="<<fTrigger<< // trigger | |
15e48021 | 440 | "triggerClass="<<&fTriggerClass<< // trigger |
108953e9 | 441 | "mag="<<fMagF<< // magnetic field |
9dcfce73 | 442 | "nclIn="<<nclIn<< |
443 | "nclOut="<<nclOut<< | |
444 | "ncl="<<ncl<< | |
445 | "TrIn0.="<<trackInOld<< | |
446 | "TrOut0.="<<trackOutOld<< | |
447 | "TrIn1.="<<&trackIn<< | |
448 | "TrOut1.="<<&trackOut<< | |
449 | "\n"; | |
450 | } | |
451 | } | |
3bf5c7a6 | 452 | // |
981e9de5 | 453 | // And now rewrite ESDtrack and TPC seed |
3bf5c7a6 | 454 | // |
455 | ||
456 | (*trackInOld) = trackIn; | |
457 | (*trackOutOld) = trackOut; | |
e527a1b9 | 458 | (*trackOuter) = trackOut; |
3bf5c7a6 | 459 | AliExternalTrackParam *t = &trackIn; |
b322e06a | 460 | //track->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); |
981e9de5 | 461 | seed->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); |
fe8454d9 | 462 | seed->SetNumberOfClusters((nclIn+nclOut)/2); |
2cfb8d90 | 463 | return kTRUE; |
9dcfce73 | 464 | } |
465 | ||
466 | ||
467 | ||
468 | Bool_t AliTPCcalibCalib::RejectCluster(AliTPCclusterMI* cl, AliExternalTrackParam * param){ | |
469 | // | |
470 | // check the acceptance of cluster | |
471 | // Cut on edge effects | |
472 | // | |
768e46f1 | 473 | if (!param) return kTRUE; |
15e48021 | 474 | Float_t kEdgeCut=2.5; |
475 | Float_t kSigmaCut=6; | |
476 | ||
9dcfce73 | 477 | Bool_t isReject = kFALSE; |
478 | Float_t edgeY = cl->GetX()*TMath::Tan(TMath::Pi()/18); | |
479 | Float_t dist = edgeY - TMath::Abs(cl->GetY()); | |
768e46f1 | 480 | dist = TMath::Abs(edgeY - TMath::Abs(param->GetY())); |
15e48021 | 481 | if (dist<kEdgeCut) isReject=kTRUE; |
482 | ||
483 | Double_t cov[3]={0.01,0.,0.01}; //TODO: correct error parametrisation | |
484 | AliTPCseed::GetError(cl, param,cov[0],cov[2]); | |
91f8fa1d | 485 | if (param->GetSigmaY2()<0 || param->GetSigmaZ2()<0){ |
d3ce44cb | 486 | AliError("Wrong parameters"); |
487 | return kFALSE; | |
488 | } | |
15e48021 | 489 | Double_t py = (cl->GetY()-param->GetY())/TMath::Sqrt(cov[0]*cov[0]+param->GetSigmaY2()); |
490 | Double_t pz = (cl->GetZ()-param->GetZ())/TMath::Sqrt(cov[2]*cov[2]+param->GetSigmaZ2()); | |
491 | // | |
492 | if ((py*py+pz*pz)>kSigmaCut*kSigmaCut) isReject=kTRUE; | |
493 | ||
9dcfce73 | 494 | return isReject; |
495 | } | |
496 | ||
497 | ||
91350f5b | 498 |