]>
Commit | Line | Data |
---|---|---|
33791895 | 1 | /************************************************************************** |
2 | * This file is property of and copyright by the ALICE HLT Project * | |
3 | * ALICE Experiment at CERN, All rights reserved. * | |
4 | * * | |
5 | * Primary Authors: Svein Lindal <slindal@fys.uio.no > * | |
6 | * for The ALICE HLT Project. * | |
7 | * * | |
8 | * Permission to use, copy, modify and distribute this software and its * | |
9 | * documentation strictly for non-commercial purposes is hereby granted * | |
10 | * without fee, provided that the above copyright notice appears in all * | |
11 | * copies and that both the copyright notice and this permission notice * | |
12 | * appear in the supporting documentation. The authors make no claims * | |
13 | * about the suitability of this software for any purpose. It is * | |
14 | * provided "as is" without express or implied warranty. * | |
15 | **************************************************************************/ | |
16 | ||
17 | /// @file AliHLTEvePhos.cxx | |
18 | /// @author Svein Lindal <slindal@fys.uio.no> | |
19 | /// @brief HLT class for the HLT EVE display | |
20 | ||
21 | #include "AliHLTEveHLT.h" | |
22 | #include "AliHLTHOMERBlockDesc.h" | |
23 | #include "AliHLTEveBase.h" | |
fd2adb88 | 24 | #include "AliEveHLTEventManager.h" |
c8fc4838 | 25 | #include "AliHLTGlobalTriggerDecision.h" |
33791895 | 26 | #include "TEveManager.h" |
27 | #include "TEvePointSet.h" | |
28 | #include "TEveTrack.h" | |
29 | #include "TCanvas.h" | |
30 | #include "AliESDEvent.h" | |
4883ef27 | 31 | #include "AliESDtrack.h" |
33791895 | 32 | #include "TEveTrackPropagator.h" |
33 | #include "AliEveTrack.h" | |
34 | #include "TEveVSDStructs.h" | |
35 | #include "TString.h" | |
36 | #include "TPCLib/tracking-ca/AliHLTTPCCATrackParam.h" | |
37 | #include "TPCLib/tracking-ca/AliHLTTPCCATrackConvertor.h" | |
38 | #include "AliEveMagField.h" | |
f1a55ef4 | 39 | #include "TH1.h" |
33791895 | 40 | #include "TH1F.h" |
41 | #include "TH2F.h" | |
fd2adb88 | 42 | #include "TThread.h" |
33791895 | 43 | |
44 | ClassImp(AliHLTEveHLT) | |
45 | ||
46 | AliHLTEveHLT::AliHLTEveHLT() : | |
fd2adb88 | 47 | AliHLTEveBase("TPC tracks"), |
33791895 | 48 | fTrueField(kFALSE), |
49 | fUseIpOnFailedITS(kFALSE), | |
50 | fUseRkStepper(kFALSE), | |
353f10b3 | 51 | fTrackList(NULL), |
fd2adb88 | 52 | fOldTrackList(NULL), |
bc1a13f1 | 53 | fPointSetVertex(NULL), |
353f10b3 | 54 | fTrCanvas(NULL), |
f1a55ef4 | 55 | fVertexCanvas(NULL), |
353f10b3 | 56 | fHistEta(NULL), |
353f10b3 | 57 | fHistPhi(NULL), |
58 | fHistnClusters(NULL), | |
f1a55ef4 | 59 | fHistMult(NULL), |
4883ef27 | 60 | fHistDCAr(NULL), |
f1a55ef4 | 61 | fTrCount(0), |
62 | fVCount(0) | |
33791895 | 63 | { |
64 | // Constructor. | |
4883ef27 | 65 | CreateHistograms(); |
66 | ||
33791895 | 67 | } |
c8fc4838 | 68 | ///___________________________________________________________________ |
33791895 | 69 | AliHLTEveHLT::~AliHLTEveHLT() |
70 | { | |
71 | //Destructor, not implemented | |
72 | if(fTrackList) | |
73 | delete fTrackList; | |
74 | fTrackList = NULL; | |
75 | } | |
c8fc4838 | 76 | ///____________________________________________________________________ |
fd2adb88 | 77 | void AliHLTEveHLT::ProcessEsdEvent( AliESDEvent * esd ) { |
353f10b3 | 78 | //See header file for documentation |
fd2adb88 | 79 | if(!fTrackList) CreateTrackList(); |
80 | if(!fPointSetVertex) CreateVertexPointSet(); | |
81 | ProcessEsdEvent(esd, fTrackList); | |
4883ef27 | 82 | |
353f10b3 | 83 | } |
4883ef27 | 84 | |
85 | ///________________________________________________________________________ | |
86 | void AliHLTEveHLT::CreateHistograms(){ | |
87 | //See header file for documentation | |
88 | ||
89 | //fHistPt = new TH1F("fHistPt", "transverse momentum", 100, 0, 10); // KK | |
90 | //fHistP = new TH1F("fHistP", "signed momentum", 100,-7, 7); | |
91 | ||
92 | //fHistPt ->SetXTitle("p_{t} (GeV/c)"); // KK | |
93 | //fHistP ->SetXTitle("P*charge (GeV/c)"); | |
94 | ||
95 | // fHistTheta = new TH1F("fHistTheta", "polar angle", 180, 0,180); | |
96 | // fHistTheta->SetXTitle("#theta (degrees)"); | |
97 | ||
98 | fHistEta = new TH1F("fHistEta", "pseudorapidity", 100,-2, 2); | |
99 | fHistEta ->SetXTitle("#eta"); | |
100 | ||
101 | fHistPhi = new TH1F("fHistPhi", "azimuthal angle", 180, 0,360); | |
102 | fHistPhi ->SetXTitle("#phi (degrees)"); | |
103 | ||
104 | fHistnClusters = new TH1F("fHistnClusters","TPC clusters per track", 160, 0,160); | |
105 | ||
106 | fHistMult = new TH1F("fHistMult", "event track multiplicity",50, 0, 50); | |
107 | ||
108 | fHistDCAr = new TH1F("fHistDCAr", "DCA r", 200, -100, 100); | |
109 | ||
110 | } | |
111 | ||
112 | ||
fd2adb88 | 113 | ///_____________________________________________________________________ |
33791895 | 114 | void AliHLTEveHLT::ProcessBlock(AliHLTHOMERBlockDesc * block) { |
115 | //See header file for documentation | |
116 | if ( ! block->GetDataType().CompareTo("ALIESDV0") ) { | |
117 | if(!fTrackList) CreateTrackList(); | |
bc1a13f1 | 118 | if(!fPointSetVertex) CreateVertexPointSet(); |
33791895 | 119 | ProcessEsdBlock(block, fTrackList); |
120 | } | |
121 | ||
122 | else if ( ! block->GetDataType().CompareTo("ROOTTOBJ") ) { | |
123 | //processROOTTOBJ( block, gHLTText ); | |
124 | } | |
125 | ||
126 | else if ( ! block->GetDataType().CompareTo("HLTRDLST") ) { | |
c8fc4838 | 127 | cout << "ignoring hlt rdlst"<<endl; |
33791895 | 128 | //processHLTRDLST( block ); |
129 | } | |
130 | ||
c8fc4838 | 131 | else if ( ! block->GetDataType().CompareTo("GLOBTRIG") ) { |
132 | ProcessGlobalTrigger( block ); | |
133 | } | |
134 | ||
33791895 | 135 | else if ( !block->GetDataType().CompareTo("ROOTHIST") ) { |
136 | if( !fCanvas ) { | |
4883ef27 | 137 | fCanvas = CreateCanvas("PVtx/Tr QA", "PrimV"); |
138 | fCanvas->Divide(3, 3); | |
33791895 | 139 | } |
140 | ProcessHistograms( block , fCanvas); | |
fd2adb88 | 141 | } |
33791895 | 142 | } |
143 | ||
fd2adb88 | 144 | ///____________________________________________________________________________ |
33791895 | 145 | void AliHLTEveHLT::UpdateElements() { |
146 | //See header file for documentation | |
f1a55ef4 | 147 | // |
4883ef27 | 148 | DrawHistograms(); |
33791895 | 149 | if(fTrackList) fTrackList->ElementChanged(); |
bc1a13f1 | 150 | if(fPointSetVertex) fPointSetVertex->ResetBBox(); |
f1a55ef4 | 151 | if(fTrCanvas) fTrCanvas->Update(); |
152 | if(fVertexCanvas) fVertexCanvas->Update(); | |
153 | if(fCanvas) fCanvas->Update(); | |
154 | ||
33791895 | 155 | } |
fd2adb88 | 156 | ///_________________________________________________________________________________ |
33791895 | 157 | void AliHLTEveHLT::ResetElements(){ |
fd2adb88 | 158 | //See header file for documentation |
159 | ||
160 | cout << "destroy"<<endl; | |
161 | if(fTrackList) { | |
c8fc4838 | 162 | fTrackList->Destroy(); |
fd2adb88 | 163 | fTrackList = NULL; |
c8fc4838 | 164 | // RemoveElement(fTrackList); |
165 | // TThread * destructor = new TThread(DestroyGarbage, (void*) this); | |
166 | // destructor->Run(); | |
167 | // fTrackList = NULL; | |
fd2adb88 | 168 | } |
169 | ||
2d91aa68 | 170 | fTrCount = 0; |
171 | fVCount = 0; | |
172 | ||
bc1a13f1 | 173 | if(fPointSetVertex) fPointSetVertex->Reset(); |
fd2adb88 | 174 | cout<< "reset done"<<endl; |
33791895 | 175 | fHistoCount = 0; |
176 | ||
177 | } | |
178 | ||
fd2adb88 | 179 | ///_____________________________________________________________________________________ |
180 | void * AliHLTEveHLT::DestroyGarbage(void * arg) { | |
181 | AliHLTEveHLT * hlt = reinterpret_cast<AliHLTEveHLT*>(arg); | |
182 | if(hlt) hlt->DestroyOldTrackList(); | |
183 | return (void*)0; | |
184 | } | |
185 | ///_____________________________________________________________________________________ | |
186 | void AliHLTEveHLT::DestroyOldTrackList() { | |
187 | cout << "Destroying the old tracklist's elements"<<endl; | |
188 | fOldTrackList->DestroyElements(); | |
189 | cout << "Destroying the old tracklist itself"<<endl; | |
190 | fOldTrackList->Destroy(); | |
191 | } | |
192 | ||
193 | ///_____________________________________________________________________________________ | |
33791895 | 194 | void AliHLTEveHLT::ProcessHistograms(AliHLTHOMERBlockDesc * block, TCanvas * canvas) { |
195 | //See header file for documentation | |
f1a55ef4 | 196 | if (!fTrCanvas) { |
4883ef27 | 197 | fTrCanvas = CreateCanvas("ESD", "ESD"); |
f1a55ef4 | 198 | fTrCanvas->Divide(4, 2); |
199 | } | |
4883ef27 | 200 | |
f1a55ef4 | 201 | if(!fVertexCanvas) { |
4883ef27 | 202 | fVertexCanvas = CreateCanvas("Vtx", "Vtx"); |
f1a55ef4 | 203 | fVertexCanvas->Divide(4, 2); |
204 | } | |
205 | ||
206 | ||
207 | ||
33791895 | 208 | if ( ! block->GetClassName().CompareTo("TH1F")) { |
209 | TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject()); | |
210 | if( histo ){ | |
211 | TString name(histo->GetName()); | |
f1a55ef4 | 212 | cout << "TH1F " <<name << endl; |
33791895 | 213 | if( !name.CompareTo("primVertexZ") ){ |
214 | canvas->cd(2); | |
215 | histo->Draw(); | |
216 | }else if( !name.CompareTo("primVertexX") ){ | |
217 | canvas->cd(3); | |
218 | histo->Draw(); | |
219 | }else if( !name.CompareTo("primVertexY") ){ | |
220 | canvas->cd(4); | |
221 | histo->Draw(); | |
f1a55ef4 | 222 | } else if ( name.Contains("Track")) { |
223 | AddHistogramToCanvas(histo, fTrCanvas, fTrCount); | |
224 | } else { | |
225 | AddHistogramToCanvas(histo, fVertexCanvas, fVCount); | |
33791895 | 226 | } |
227 | } | |
228 | } else if ( ! block->GetClassName().CompareTo("TH2F")) { | |
229 | TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject()); | |
230 | if (hista ){ | |
231 | TString name(hista->GetName()); | |
f1a55ef4 | 232 | cout << "TH2F " << name << endl; |
33791895 | 233 | if( !name.CompareTo("primVertexXY")) { |
234 | canvas->cd(1); | |
235 | hista->Draw(); | |
f1a55ef4 | 236 | } else if ( name.Contains("Track")) { |
237 | AddHistogramToCanvas(hista, fTrCanvas, fTrCount); | |
238 | } else { | |
239 | AddHistogramToCanvas(hista, fVertexCanvas, fVCount); | |
240 | } | |
33791895 | 241 | } |
242 | } | |
243 | canvas->cd(); | |
33791895 | 244 | } |
245 | ||
f1a55ef4 | 246 | ///_____________________________________________________________________________________ |
247 | void AliHLTEveHLT::AddHistogramToCanvas(TH1* histogram, TCanvas * canvas, Int_t &cdCount) { | |
248 | canvas->cd(++cdCount); | |
249 | histogram->Draw(); | |
250 | } | |
251 | ||
252 | ||
fd7a3071 | 253 | ///________________________________________________________________________________________ |
33791895 | 254 | void AliHLTEveHLT::CreateTrackList() { |
255 | //See header file for documentation | |
256 | fTrackList = new TEveTrackList("ESD Tracks"); | |
257 | fTrackList->SetMainColor(6); | |
fd2adb88 | 258 | AddElement(fTrackList); |
33791895 | 259 | } |
7036e5c1 | 260 | // ///________________________________________________________________________________________ |
261 | // void AliHLTEveHLT::CreateTrackList() { | |
262 | // //See header file for documentation | |
263 | // fTrackList = new TEveElementList("ESD tracks"); | |
264 | // for (Int_t i = 0; i < 10; i++ ) { | |
265 | // TEveTrackList * trackList = new TEveTrackList(Form("Tracklist_%d", i)); | |
266 | // trackList->SetMainColor(i); | |
267 | // fTrackList->AddElement(trackList); | |
268 | // } | |
269 | ||
270 | // AddElement(fTrackList); | |
271 | // } | |
33791895 | 272 | |
fd7a3071 | 273 | ///_________________________________________________________________________________________ |
bc1a13f1 | 274 | void AliHLTEveHLT::CreateVertexPointSet() { |
275 | //See header file for documentation | |
276 | fPointSetVertex = new TEvePointSet("Primary Vertex"); | |
277 | fPointSetVertex->SetMainColor(6); | |
278 | fPointSetVertex->SetMarkerStyle((Style_t)kFullStar); | |
279 | ||
fd2adb88 | 280 | AddElement(fPointSetVertex); |
bc1a13f1 | 281 | } |
282 | ||
c8fc4838 | 283 | ///________________________________________________________________________ |
284 | void AliHLTEveHLT::ProcessGlobalTrigger( AliHLTHOMERBlockDesc * block ) { | |
285 | //See header file for documentation | |
286 | AliHLTGlobalTriggerDecision * decision = dynamic_cast<AliHLTGlobalTriggerDecision*>(block->GetTObject()); | |
287 | decision->Print(); | |
288 | ||
289 | } | |
290 | ||
33791895 | 291 | |
c8fc4838 | 292 | ///______________________________________________________________________ |
33791895 | 293 | void AliHLTEveHLT::ProcessEsdBlock( AliHLTHOMERBlockDesc * block, TEveTrackList * cont ) { |
294 | //See header file for documentation | |
295 | ||
296 | AliESDEvent* esd = (AliESDEvent *) (block->GetTObject()); | |
fd2adb88 | 297 | if (!esd) return; |
298 | ||
299 | ProcessEsdEvent(esd, cont); | |
300 | } | |
fd7a3071 | 301 | ///___________________________________________________________________________________ |
fd2adb88 | 302 | void AliHLTEveHLT::ProcessEsdEvent(AliESDEvent * esd, TEveTrackList * cont) { |
303 | ||
fd7a3071 | 304 | cout << "ProcessESDEvent() :"<< esd->GetEventNumberInFile()<< " " << esd->GetNumberOfCaloClusters() << " tracks : " << esd->GetNumberOfTracks() << endl; |
fd2adb88 | 305 | |
306 | //fEventManager->SetRunNumber(esd->GetRunNumber()); | |
307 | ||
bc1a13f1 | 308 | Double_t vertex[3]; |
cb9a310a | 309 | const AliESDVertex * esdVertex = esd->GetPrimaryVertex(); |
bc1a13f1 | 310 | |
cb9a310a | 311 | if(esdVertex) { |
312 | esdVertex->GetXYZ(vertex); | |
313 | fPointSetVertex->SetNextPoint(vertex[0], vertex[1], vertex[2]); | |
314 | } | |
33791895 | 315 | |
316 | SetUpTrackPropagator(cont->GetPropagator(),-0.1*esd->GetMagneticField(), 520); | |
317 | ||
318 | for (Int_t iter = 0; iter < esd->GetNumberOfTracks(); ++iter) { | |
4883ef27 | 319 | |
320 | AliESDtrack * esdTrack = dynamic_cast<AliESDtrack*>(esd->GetTrack(iter)); | |
321 | ||
322 | AliEveTrack* track = dynamic_cast<AliEveTrack*>(MakeEsdTrack(esdTrack, cont)); | |
33791895 | 323 | cont->AddElement(track); |
353f10b3 | 324 | |
4883ef27 | 325 | fHistEta->Fill(esdTrack->Eta()); |
326 | // fHistTheta->Fill(esdTrack->Theta()*TMath::RadToDeg()); | |
327 | fHistPhi->Fill(esdTrack->Phi()*TMath::RadToDeg()); | |
328 | ||
329 | ||
330 | Float_t DCAr, DCAz = -99; | |
331 | esdTrack->GetImpactParametersTPC(DCAr, DCAz); | |
332 | fHistDCAr->Fill(DCAr); | |
333 | ||
334 | ||
335 | if(esdTrack->GetStatus()&AliESDtrack::kTPCin || (esdTrack->GetStatus()&AliESDtrack::kTPCin && esdTrack->GetStatus()&AliESDtrack::kITSin)){ | |
336 | fHistnClusters->Fill(esdTrack->GetTPCNcls()); | |
337 | } | |
33791895 | 338 | } |
339 | ||
4883ef27 | 340 | |
341 | fHistMult->Fill(esd->GetNumberOfTracks()); // KK | |
33791895 | 342 | |
33791895 | 343 | |
344 | cont->SetTitle(Form("N=%d", esd->GetNumberOfTracks()) ); | |
345 | cont->MakeTracks(); | |
fd2adb88 | 346 | |
33791895 | 347 | } |
348 | ||
353f10b3 | 349 | void AliHLTEveHLT::DrawHistograms(){ |
350 | //See header file for documentation | |
4883ef27 | 351 | if(!fCanvas) { |
352 | fCanvas = CreateCanvas("PVtx/Tr QA", "Primary vertex, Track QA"); | |
353 | fCanvas->Divide(3, 3); | |
354 | } | |
355 | ||
356 | fCanvas->cd(5); | |
357 | fHistEta->Draw(); | |
358 | ||
359 | fCanvas->cd(6); | |
360 | fHistPhi->Draw(); | |
361 | ||
362 | fCanvas->cd(7); | |
363 | fHistnClusters->Draw(); | |
364 | ||
365 | fCanvas->cd(8); | |
366 | fHistMult->Draw(); | |
353f10b3 | 367 | |
4883ef27 | 368 | fCanvas->cd(9); |
369 | fHistDCAr->Draw(); | |
353f10b3 | 370 | |
4883ef27 | 371 | fCanvas->cd(); |
353f10b3 | 372 | |
373 | } | |
374 | ||
33791895 | 375 | AliEveTrack* AliHLTEveHLT::MakeEsdTrack (AliESDtrack *at, TEveTrackList* cont) { |
376 | //See header file for documentation | |
377 | ||
378 | ||
379 | const double kCLight = 0.000299792458; | |
380 | double bz = - kCLight*10.*( cont->GetPropagator()->GetMagField(0,0,0).fZ); | |
381 | ||
382 | Bool_t innerTaken = kFALSE; | |
383 | if ( ! at->IsOn(AliESDtrack::kITSrefit) && fUseIpOnFailedITS) | |
384 | { | |
385 | //tp = at->GetInnerParam(); | |
386 | innerTaken = kTRUE; | |
387 | } | |
388 | ||
389 | // Add inner/outer track parameters as path-marks. | |
390 | ||
391 | Double_t pbuf[3], vbuf[3]; | |
392 | ||
393 | AliExternalTrackParam trackParam = *at; | |
394 | ||
395 | // take parameters constrained to vertex (if they are) | |
396 | ||
397 | if( at->GetConstrainedParam() ){ | |
398 | trackParam = *at->GetConstrainedParam(); | |
399 | } | |
400 | else if( at->GetInnerParam() ){ | |
401 | trackParam = *(at->GetInnerParam()); | |
402 | } | |
403 | if( at->GetStatus()&AliESDtrack::kTRDin ){ | |
404 | // transport to TRD in | |
405 | trackParam = *at; | |
406 | trackParam.PropagateTo( 290.45, -10.*( cont->GetPropagator()->GetMagField(0,0,0).fZ) ); | |
407 | } | |
408 | ||
409 | TEveRecTrack rt; | |
410 | { | |
411 | rt.fLabel = at->GetLabel(); | |
412 | rt.fIndex = (Int_t) at->GetID(); | |
413 | rt.fStatus = (Int_t) at->GetStatus(); | |
414 | rt.fSign = (Int_t) trackParam.GetSign(); | |
415 | trackParam.GetXYZ(vbuf); | |
416 | trackParam.GetPxPyPz(pbuf); | |
417 | rt.fV.Set(vbuf); | |
418 | rt.fP.Set(pbuf); | |
419 | Double_t ep = at->GetP(), mc = at->GetMass(); | |
420 | rt.fBeta = ep/TMath::Sqrt(ep*ep + mc*mc); | |
421 | } | |
422 | ||
423 | AliEveTrack* track = new AliEveTrack(&rt, cont->GetPropagator()); | |
424 | track->SetAttLineAttMarker(cont); | |
425 | track->SetName(Form("AliEveTrack %d", at->GetID())); | |
426 | track->SetElementTitle(CreateTrackTitle(at)); | |
427 | track->SetSourceObject(at); | |
428 | ||
429 | ||
430 | // Set reference points along the trajectory | |
431 | // and the last point | |
432 | ||
433 | { | |
434 | TEvePathMark startPoint(TEvePathMark::kReference); | |
435 | trackParam.GetXYZ(vbuf); | |
436 | trackParam.GetPxPyPz(pbuf); | |
437 | startPoint.fV.Set(vbuf); | |
438 | startPoint.fP.Set(pbuf); | |
439 | rt.fV.Set(vbuf); | |
440 | rt.fP.Set(pbuf); | |
441 | Double_t ep = at->GetP(), mc = at->GetMass(); | |
442 | rt.fBeta = ep/TMath::Sqrt(ep*ep + mc*mc); | |
443 | ||
444 | track->AddPathMark( startPoint ); | |
445 | } | |
446 | ||
2d91aa68 | 447 | bool ok = 1; |
7036e5c1 | 448 | if( at->GetOuterParam() && at->GetTPCPoints(2)>80 ){ |
2d91aa68 | 449 | |
33791895 | 450 | // |
451 | // use AliHLTTPCCATrackParam propagator | |
452 | // since AliExternalTrackParam:PropagateTo() | |
453 | // has an offset at big distances | |
454 | // | |
7036e5c1 | 455 | double rot = at->GetOuterParam()->GetAlpha() - trackParam.GetAlpha(); |
456 | double crot = cos(rot), srot = sin(rot); | |
2d91aa68 | 457 | double xEnd = at->GetTPCPoints(2)*crot - at->GetTPCPoints(3)*srot; |
7036e5c1 | 458 | // take parameters constrained to vertex (if they are) |
459 | ||
460 | ||
33791895 | 461 | AliHLTTPCCATrackParam t; |
462 | AliHLTTPCCATrackConvertor::SetExtParam( t, trackParam ); | |
463 | ||
464 | Double_t x0 = trackParam.GetX(); | |
7036e5c1 | 465 | Double_t dx = xEnd - x0; |
33791895 | 466 | |
2d91aa68 | 467 | if( dx<0 ) ok = 0; |
33791895 | 468 | // |
469 | // set a reference at the half of trajectory for better drawing | |
470 | // | |
471 | ||
2d91aa68 | 472 | for( double dxx=dx/2; ok && TMath::Abs(dxx)>=1.; dxx*=.9 ){ |
473 | ||
474 | if( !t.TransportToX(x0+dxx, bz, .999 ) ){ | |
475 | ok = 0; | |
476 | break; | |
477 | continue; | |
478 | } | |
7036e5c1 | 479 | AliExternalTrackParam tt; |
480 | AliHLTTPCCATrackConvertor::GetExtParam( t, tt, trackParam.GetAlpha() ); | |
481 | tt.GetXYZ(vbuf); | |
482 | tt.GetPxPyPz(pbuf); | |
33791895 | 483 | TEvePathMark midPoint(TEvePathMark::kReference); |
484 | midPoint.fV.Set(vbuf); | |
485 | midPoint.fP.Set(pbuf); | |
486 | track->AddPathMark( midPoint ); | |
487 | break; | |
488 | } | |
7036e5c1 | 489 | |
490 | ||
33791895 | 491 | // |
492 | // Set a reference at the end of the trajectory | |
493 | // and a "decay point", to let the event display know where the track ends | |
494 | // | |
495 | ||
2d91aa68 | 496 | for( ; ok; dx*=.9 ){ |
497 | ||
7036e5c1 | 498 | if( !t.TransportToX(x0+dx, bz, .999 ) ){ |
2d91aa68 | 499 | ok = 0; |
500 | break; | |
501 | if( TMath::Abs(dx)<1. ) break; | |
7036e5c1 | 502 | continue; |
503 | } | |
2d91aa68 | 504 | break; |
505 | } | |
506 | ||
507 | { | |
508 | if( !ok ){ | |
509 | AliHLTTPCCATrackConvertor::SetExtParam( t, trackParam ); | |
510 | } | |
511 | AliExternalTrackParam tt; | |
7036e5c1 | 512 | AliHLTTPCCATrackConvertor::GetExtParam( t, tt, trackParam.GetAlpha() ); |
513 | tt.GetXYZ(vbuf); | |
514 | tt.GetPxPyPz(pbuf); | |
33791895 | 515 | TEvePathMark endPoint(TEvePathMark::kReference); |
516 | TEvePathMark decPoint(TEvePathMark::kDecay); | |
517 | endPoint.fV.Set(vbuf); | |
518 | endPoint.fP.Set(pbuf); | |
519 | decPoint.fV.Set(vbuf); | |
520 | decPoint.fP.Set(pbuf); | |
521 | track->AddPathMark( endPoint ); | |
2d91aa68 | 522 | track->AddPathMark( decPoint ); |
33791895 | 523 | } |
524 | } | |
525 | ||
2d91aa68 | 526 | if ( ok && at->IsOn(AliESDtrack::kTPCrefit)) |
33791895 | 527 | { |
528 | if ( ! innerTaken) | |
529 | { | |
530 | AddTrackParamToTrack(track, at->GetInnerParam()); | |
531 | } | |
532 | AddTrackParamToTrack(track, at->GetOuterParam()); | |
533 | } | |
2d91aa68 | 534 | |
33791895 | 535 | return track; |
536 | } | |
537 | ||
538 | void AliHLTEveHLT::SetUpTrackPropagator(TEveTrackPropagator* trkProp, Float_t magF, Float_t maxR) { | |
539 | //See header file for documentation | |
540 | ||
541 | if (fTrueField) { | |
542 | trkProp->SetMagFieldObj(new AliEveMagField); | |
543 | ||
544 | } else { | |
545 | trkProp->SetMagField(magF); | |
546 | } | |
547 | ||
548 | if (fUseRkStepper) { | |
549 | trkProp->SetStepper(TEveTrackPropagator::kRungeKutta); | |
550 | } | |
551 | ||
552 | trkProp->SetMaxR(maxR); | |
553 | } | |
554 | ||
555 | ||
556 | void AliHLTEveHLT::AddTrackParamToTrack(AliEveTrack* track, const AliExternalTrackParam* tp) { | |
557 | //See header file for documentation | |
558 | ||
559 | if (tp == 0) | |
560 | return; | |
561 | ||
562 | Double_t pbuf[3], vbuf[3]; | |
563 | tp->GetXYZ(vbuf); | |
564 | tp->GetPxPyPz(pbuf); | |
565 | ||
566 | TEvePathMark pm(TEvePathMark::kReference); | |
567 | pm.fV.Set(vbuf); | |
568 | pm.fP.Set(pbuf); | |
569 | track->AddPathMark(pm); | |
570 | } | |
571 | ||
572 | ||
573 | ||
574 | TString AliHLTEveHLT::CreateTrackTitle(AliESDtrack* t) { | |
575 | // Add additional track parameters as a path-mark to track. | |
576 | ||
577 | TString s; | |
578 | ||
579 | Int_t label = t->GetLabel(), index = t->GetID(); | |
580 | TString idx(index == kMinInt ? "<undef>" : Form("%d", index)); | |
581 | TString lbl(label == kMinInt ? "<undef>" : Form("%d", label)); | |
582 | ||
583 | Double_t p[3], v[3]; | |
584 | t->GetXYZ(v); | |
585 | t->GetPxPyPz(p); | |
586 | Double_t pt = t->Pt(); | |
587 | Double_t ptsig = TMath::Sqrt(t->GetSigma1Pt2()); | |
588 | Double_t ptsq = pt*pt; | |
589 | Double_t ptm = pt / (1.0 + pt*ptsig); | |
590 | Double_t ptM = pt / (1.0 - pt*ptsig); | |
591 | ||
592 | s = Form("Index=%s, Label=%s\nChg=%d, Pdg=%d\n" | |
593 | "pT = %.3f + %.3f - %.3f [%.3f]\n" | |
594 | "P = (%.3f, %.3f, %.3f)\n" | |
595 | "V = (%.3f, %.3f, %.3f)\n", | |
596 | idx.Data(), lbl.Data(), t->Charge(), 0, | |
597 | pt, ptM - pt, pt - ptm, ptsig*ptsq, | |
598 | p[0], p[1], p[2], | |
599 | v[0], v[1], v[2]); | |
600 | ||
601 | Int_t o; | |
602 | s += "Det (in,out,refit,pid):\n"; | |
603 | o = AliESDtrack::kITSin; | |
604 | s += Form("ITS (%d,%d,%d,%d) ", t->IsOn(o), t->IsOn(o<<1), t->IsOn(o<<2), t->IsOn(o<<3)); | |
605 | o = AliESDtrack::kTPCin; | |
606 | s += Form("TPC(%d,%d,%d,%d)\n", t->IsOn(o), t->IsOn(o<<1), t->IsOn(o<<2), t->IsOn(o<<3)); | |
607 | o = AliESDtrack::kTRDin; | |
608 | s += Form("TRD(%d,%d,%d,%d) ", t->IsOn(o), t->IsOn(o<<1), t->IsOn(o<<2), t->IsOn(o<<3)); | |
609 | o = AliESDtrack::kTOFin; | |
610 | s += Form("TOF(%d,%d,%d,%d)\n", t->IsOn(o), t->IsOn(o<<1), t->IsOn(o<<2), t->IsOn(o<<3)); | |
611 | o = AliESDtrack::kHMPIDout; | |
612 | s += Form("HMPID(out=%d,pid=%d)\n", t->IsOn(o), t->IsOn(o<<1)); | |
613 | s += Form("ESD pid=%d", t->IsOn(AliESDtrack::kESDpid)); | |
614 | ||
615 | if (t->IsOn(AliESDtrack::kESDpid)) | |
616 | { | |
617 | Double_t pid[5]; | |
618 | t->GetESDpid(pid); | |
619 | s += Form("\n[%.2f %.2f %.2f %.2f %.2f]", pid[0], pid[1], pid[2], pid[3], pid[4]); | |
620 | } | |
621 | ||
622 | return s; | |
623 | } | |
624 | ||
fd2adb88 | 625 |