2 // Main authors: Matevz Tadel & Alja Mrak-Tadel & Bogdan Vulpescu: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliEveMUONTrack.h"
12 #include <EveBase/AliEveEventManager.h>
16 #include <AliESDMuonTrack.h>
17 #include <AliESDEvent.h>
18 #include <AliESDVertex.h>
19 #include <AliRunLoader.h>
22 #include <AliMUONTrack.h>
23 #include <AliMUONTriggerTrack.h>
24 #include <AliMUONTrackParam.h>
25 #include <AliMUONConstants.h>
26 #include <AliMUONESDInterface.h>
27 #include <AliMUONVCluster.h>
29 #include <TObjArray.h>
30 #include <TGeoGlobalMagField.h>
31 #include <TParticle.h>
32 #include <TParticlePDG.h>
36 #include <Riostream.h>
38 //==============================================================================
40 //==============================================================================
41 //==============================================================================
43 //______________________________________________________________________________
44 // Produce TEveUtil:TEveTrack from AliMUONTrack with dipole field model
49 using std::setprecision;
50 ClassImp(AliEveMUONTrack)
53 //______________________________________________________________________________
54 AliEveMUONTrack::AliEveMUONTrack(TEveRecTrack* t, TEveTrackPropagator* rs) :
60 fIsMUONTriggerTrack(kFALSE),
70 //______________________________________________________________________________
71 AliEveMUONTrack::~AliEveMUONTrack()
77 if (fIsRefTrack || fIsESDTrack) delete fTrack;
78 if (fIsMCTrack) delete fPart;
82 //______________________________________________________________________________
83 void AliEveMUONTrack::PrintMCTrackInfo()
86 // information about the MC particle
92 cout << " ! no particle ..." << endl;
97 cout << " MC track parameters at vertex" << endl;
98 cout << " -------------------------------------------------------------------------------------" << endl;
99 cout << " PDG code Vx Vy Vz Px Py Pz " << endl;
102 setw(8) << setprecision(0) <<
103 fPart->GetPdgCode() << " " <<
104 setw(8) << setprecision(3) <<
105 fPart->Vx() << " " <<
106 setw(8) << setprecision(3) <<
107 fPart->Vy() << " " <<
108 setw(8) << setprecision(3) <<
109 fPart->Vz() << " " <<
110 setw(8) << setprecision(3) <<
111 fPart->Px() << " " <<
112 setw(8) << setprecision(3) <<
113 fPart->Py() << " " <<
114 setw(8) << setprecision(4) <<
115 fPart->Pz() << " " <<
119 pt = TMath::Sqrt(fPart->Px()*fPart->Px()+fPart->Py()*fPart->Py());
120 p = TMath::Sqrt(fPart->Px()*fPart->Px()+fPart->Py()*fPart->Py()+fPart->Pz()*fPart->Pz());
124 setw(8) << setprecision(3) <<
125 pt << " GeV/c" << endl;
128 setw(8) << setprecision(4) <<
129 p << " GeV/c" << endl;
133 //______________________________________________________________________________
134 void AliEveMUONTrack::PrintMUONTrackInfo()
137 // information about the reconstructed/reference track; at hits and at vertex
140 Double_t radDeg = 180.0/TMath::Pi();
143 Float_t pt, bc, nbc, zc;
144 AliMUONTrackParam *mtp;
145 TObjArray *trackParamAtCluster;
148 cout << " ! no reconstructed track ..." << endl;
154 cout << " TEveTrack number " << fLabel << endl;
155 cout << " ---------------------------------------------------------------------------------------------------------------------------------" << endl;
157 cout << " Number of clusters " << fTrack->GetNClusters() << endl;
158 cout << " Match to trigger " << fTrack->GetMatchTrigger() << endl;
159 if (fTrack->GetMatchTrigger()) {
160 cout << " Chi2 tracking-trigger " << fTrack->GetChi2MatchTrigger() << endl;
161 cout << " Local trigger number " << fTrack->GetLoTrgNum() << endl;
167 cout << " TEveTrack reference number " << fLabel << endl;
168 cout << " ---------------------------------------------------------------------------------------------------------------------------------" << endl;
170 cout << " Number of clusters " << fTrack->GetNClusters() << endl;
173 trackParamAtCluster = fTrack->GetTrackParamAtCluster();
174 nparam = trackParamAtCluster->GetEntries();
177 cout << " trackParamAtCluster entries " << nparam << "" << endl;
178 cout << " ---------------------------------------------------------------------------------------------------------------------------------" << endl;
179 cout << " Number InvBendMom BendSlope NonBendSlope BendCoord NonBendCoord Z Px Py Pz P" << endl;
181 for (Int_t i = 0; i < nparam; i++) {
183 mtp = (AliMUONTrackParam*)trackParamAtCluster->At(i);
186 setw(9)<< setprecision(3) <<
189 setw(8) << setprecision(3) <<
190 mtp->GetInverseBendingMomentum() << " " <<
192 setw(8) << setprecision(3) <<
193 mtp->GetBendingSlope()*radDeg << " " <<
195 setw(8) << setprecision(3) <<
196 mtp->GetNonBendingSlope()*radDeg << " " <<
198 setw(8) << setprecision(4) <<
199 mtp->GetBendingCoor() << " " <<
201 setw(8) << setprecision(4) <<
202 mtp->GetNonBendingCoor() << " " <<
204 setw(10) << setprecision(6) <<
205 mtp->GetZ() << " " <<
207 setw(8) << setprecision(4) <<
210 setw(8) << setprecision(4) <<
213 setw(8) << setprecision(4) <<
216 setw(8) << setprecision(4) <<
224 cout << " TEveTrack parameters at vertex" << endl;
225 cout << " --------------------------------------------------------------------------------------------------------------------" << endl;
226 cout << " InvBendMom BendSlope NonBendSlope BendCoord NonBendCoord Z Px Py Pz P" << endl;
228 mtp = (AliMUONTrackParam*)fTrack->GetTrackParamAtVertex();
230 bc = mtp->GetBendingCoor();
231 nbc = mtp->GetNonBendingCoor();
233 if (bc < 0.001) bc = 0.0;
234 if (nbc < 0.001) nbc = 0.0;
235 if (zc < 0.001) zc = 0.0;
238 setw(8) << setprecision(3) <<
239 mtp->GetInverseBendingMomentum() << " " <<
241 setw(8) << setprecision(3) <<
242 mtp->GetBendingSlope()*radDeg << " " <<
244 setw(8) << setprecision(3) <<
245 mtp->GetNonBendingSlope()*radDeg << " " <<
247 setw(8) << setprecision(4) <<
250 setw(8) << setprecision(4) <<
253 setw(10) << setprecision(6) <<
256 setw(8) << setprecision(4) <<
259 setw(8) << setprecision(4) <<
262 setw(8) << setprecision(4) <<
265 setw(8) << setprecision(4) <<
270 pt = TMath::Sqrt(mtp->Px()*mtp->Px()+mtp->Py()*mtp->Py());
274 setw(8) << setprecision(3) <<
275 pt << " GeV/c" << endl;
279 //______________________________________________________________________________
280 void AliEveMUONTrack::PrintMUONTriggerTrackInfo()
283 // information about the trigger track
286 // Double_t radDeg = 180.0/TMath::Pi();
290 //______________________________________________________________________________
291 void AliEveMUONTrack::PrintESDTrackInfo()
294 // information about the reconstructed ESD track at vertex
297 Double_t radDeg = 180.0/TMath::Pi();
300 AliMUONTrackParam *mtp = (AliMUONTrackParam*)fTrack->GetTrackParamAtVertex();
303 cout << " ESD muon track " << endl;
304 cout << " -----------------------------------------------------------------------------------------------------------" << endl;
305 cout << " InvBendMom BendSlope NonBendSlope BendCoord NonBendCoord Z Px Py Pz" << endl;
309 setw(8) << setprecision(4) <<
310 mtp->GetInverseBendingMomentum() << " " <<
312 setw(8) << setprecision(3) <<
313 mtp->GetBendingSlope()*radDeg << " " <<
315 setw(8) << setprecision(3) <<
316 mtp->GetNonBendingSlope()*radDeg << " " <<
318 setw(8) << setprecision(4) <<
319 mtp->GetBendingCoor() << " " <<
321 setw(8) << setprecision(4) <<
322 mtp->GetNonBendingCoor() << " " <<
324 setw(10) << setprecision(6) <<
325 mtp->GetZ() << " " <<
327 setw(8) << setprecision(3) <<
330 setw(8) << setprecision(3) <<
333 setw(8) << setprecision(3) <<
338 pt = TMath::Sqrt(mtp->Px()*mtp->Px()+mtp->Py()*mtp->Py());
342 setw(8) << setprecision(3) <<
343 pt << " GeV/c" << endl;
346 setw(8) << setprecision(4) <<
347 mtp->P() << " GeV/c" << endl;
349 AliESDEvent* esd = AliEveEventManager::AssertESD();
351 Double_t spdVertexX = 0;
352 Double_t spdVertexY = 0;
353 Double_t spdVertexZ = 0;
354 Double_t esdVertexX = 0;
355 Double_t esdVertexY = 0;
356 Double_t esdVertexZ = 0;
358 AliESDVertex* spdVertex = (AliESDVertex*) esd->GetVertex();
359 if (spdVertex->GetNContributors()) {
360 spdVertexZ = spdVertex->GetZ();
361 spdVertexY = spdVertex->GetY();
362 spdVertexX = spdVertex->GetX();
365 AliESDVertex* esdVertex = (AliESDVertex*) esd->GetPrimaryVertex();
366 if (esdVertex->GetNContributors()) {
367 esdVertexZ = esdVertex->GetZ();
368 esdVertexY = esdVertex->GetY();
369 esdVertexX = esdVertex->GetX();
372 Float_t t0v = esd->GetT0zVertex();
376 cout << "External vertex SPD: " <<
378 spdVertex->GetNContributors() << " " <<
379 setw(8) << setprecision(3) <<
382 spdVertexZ << " " << endl;
383 cout << "External vertex ESD: " <<
385 esdVertex->GetNContributors() << " " <<
386 setw(8) << setprecision(3) <<
389 esdVertexZ << " " << endl;
390 cout << "External vertex T0: " <<
391 setw(8) << setprecision(3) <<
396 //______________________________________________________________________________
397 void AliEveMUONTrack::MUONTrackInfo()
407 if (fIsMUONTrack || fIsRefTrack) {
408 PrintMUONTrackInfo();
415 if (fIsMUONTriggerTrack) {
416 PrintMUONTriggerTrackInfo();
422 cout << " (slopes [deg], coord [cm], p [GeV/c])" << endl;
426 //______________________________________________________________________________
427 void AliEveMUONTrack::MUONTriggerInfo()
434 TEveUtil::TEveUtil::LoadMacro("MUON_trigger_info.C");
435 gROOT->ProcessLine(Form("MUON_trigger_info(%d);", fLabel));
438 cout << "This is a reference track!" << endl;
441 cout << "This is a Monte-Carlo track!" << endl;
445 AliESDEvent* esd = AliEveEventManager::AssertESD();
446 ULong64_t triggerMask = esd->GetTriggerMask();
449 cout << ">>>>>#########################################################################################################################" << endl;
452 cout << " ESD track trigger info" << endl;
453 cout << " -----------------------------------------------------" << endl;
456 cout << " Match to trigger " << fTrack->GetMatchTrigger() << endl;
458 cout << " ESD trigger mask = " << triggerMask << endl;
461 cout << "#########################################################################################################################<<<<<" << endl;
468 //______________________________________________________________________________
469 void AliEveMUONTrack::MakeMUONTrack(AliMUONTrack *mtrack)
472 // builds the track with dipole field
477 fIsMUONTrack = kTRUE;
480 fTrack = new AliMUONTrack(*mtrack);
485 Float_t ax, bx, ay, by;
486 Float_t xr[28], yr[28], zr[28];
487 Float_t xrc[28], yrc[28], zrc[28];
491 TMatrixD smatrix(2,2);
495 // middle z between the two detector planes of the trigger chambers
496 Float_t zg[4] = { -1603.5, -1620.5, -1703.5, -1720.5 };
499 Float_t pv[3] = {0., 0., 0.};
502 if (mtrack->GetMatchTrigger()) {
503 snprintf(form,1000,"MUONTrack %2d (MT)", fLabel);
505 snprintf(form,1000,"MUONTrack %2d ", fLabel);
511 AliMUONTrackParam *trackParam = 0x0;
512 if (fIsMUONTrack || fIsESDTrack) {
513 trackParam = mtrack->GetTrackParamAtVertex();
514 SetPoint(fCount,trackParam->GetNonBendingCoor(),trackParam->GetBendingCoor(),trackParam->GetZ());
518 for (Int_t i = 0; i < 28; i++) {
519 xr[i]=yr[i]=zr[i]=0.0;
523 Int_t nTrackHits = mtrack->GetNClusters();
524 TObjArray* trackParamAtCluster = mtrack->GetTrackParamAtCluster();
525 for (Int_t iHit = 0; iHit < nTrackHits; iHit++){
527 trackParam = (AliMUONTrackParam*) trackParamAtCluster->At(iHit);
530 if (IsMUONTrack() || IsESDTrack()) {
531 pt = TMath::Sqrt(trackParam->Px()*trackParam->Px()+trackParam->Py()*trackParam->Py());
532 SetLineColor(ColorIndex(pt));
534 pv[0] = trackParam->Px();
535 pv[1] = trackParam->Py();
536 pv[2] = trackParam->Pz();
540 xr[iHit] = trackParam->GetNonBendingCoor();
541 yr[iHit] = trackParam->GetBendingCoor();
542 zr[iHit] = trackParam->GetZ();
543 chr[iHit] = trackParam->GetClusterPtr()->GetChamberId();
547 SetPoint(fCount,xr[0],yr[0],zr[0]);
549 for (Int_t iHit = 1; iHit < nTrackHits; iHit++) {
550 if (chr[iHit] > 3 && chr[iHit-1] < 6) Propagate(xr,yr,zr,iHit-1,iHit);
551 SetPoint(fCount,xr[iHit],yr[iHit],zr[iHit]);
555 if (!fIsMUONTrack && !fIsESDTrack) return;
558 if (mtrack->GetMatchTrigger()) {
560 for (Int_t i = 0; i < nTrackHits; i++) {
561 if (TMath::Abs(zr[i]) > 1000.0) {
562 //printf("TEveHit %d x %f y %f z %f \n",iHit,xr[i],yr[i],zr[i]);
575 for (Int_t i = 0; i < nrc; i++) {
576 xv = (Double_t)zrc[i];
577 yv = (Double_t)xrc[i];
578 //printf("x-z: xv %f yv %f \n",xv,yv);
580 smatrix(1,1) += xv*xv;
586 res = smatrix.Invert() * sums;
593 for (Int_t i = 0; i < nrc; i++) {
594 xv = (Double_t)zrc[i];
595 yv = (Double_t)yrc[i];
596 //printf("y-z: xv %f yv %f \n",xv,yv);
598 smatrix(1,1) += xv*xv;
604 res = smatrix.Invert() * sums;
608 Float_t xtc, ytc, ztc;
609 for (Int_t ii = 0; ii < 4; ii++) {
615 //printf("tc: x %f y %f z %f \n",xtc,ytc,ztc);
617 SetPoint(fCount,xtc,ytc,ztc);
622 } // end match trigger
626 //______________________________________________________________________________
627 void AliEveMUONTrack::MakeMUONTriggerTrack(AliMUONTriggerTrack *mtrack)
630 // builds the trigger track from one point and direction
633 Float_t x1 = mtrack->GetX11();
634 Float_t y1 = mtrack->GetY11();
635 Float_t thex = mtrack->GetThetax();
636 Float_t they = mtrack->GetThetay();
638 Float_t z11 = -1600.0;
639 Float_t z22 = -1724.0;
640 Float_t dz = z22-z11;
642 Float_t x2 = x1 + dz*TMath::Tan(thex);
643 Float_t y2 = y1 + dz*TMath::Tan(they);
645 SetPoint(fCount,x1,y1,z11); fCount++;
646 SetPoint(fCount,x2,y2,z22); fCount++;
650 snprintf(form,1000,"MUONTriggerTrack %2d",mtrack->GetLoTrgNum());
656 //______________________________________________________________________________
657 void AliEveMUONTrack::MakeESDTrack(AliESDMuonTrack *mtrack)
660 // builds the track with dipole field starting from the TParticle
666 if (mtrack->GetMatchTrigger()) {
667 snprintf(form,1000,"ESDTrack %2d (MT)", fLabel);
669 snprintf(form,1000,"ESDTrack %2d ", fLabel);
675 fTrack = new AliMUONTrack();
677 // create a simple track from the ESD track
678 AliMUONESDInterface::ESDToMUON(*mtrack,*fTrack);
680 // reset track parameters at vertex to the ones at DCA
681 AliMUONTrackParam paramAtDCA;
682 AliMUONESDInterface::GetParamAtDCA(*mtrack, paramAtDCA);
683 fTrack->SetTrackParamAtVertex(¶mAtDCA);
685 MakeMUONTrack(fTrack);
689 //______________________________________________________________________________
690 void AliEveMUONTrack::MakeMCTrack(TParticle *part)
693 // builds the track with dipole field starting from the TParticle
698 fPart = new TParticle(*part);
701 snprintf(form,1000,"TEveMCTrack %2d ", fLabel);
706 Double_t vect[7], vout[7];
715 vect[0] = fPart->Vx();
716 vect[1] = fPart->Vy();
717 vect[2] = fPart->Vz();
718 vect[3] = fPart->Px()/fPart->P();
719 vect[4] = fPart->Py()/fPart->P();
720 vect[5] = fPart->Pz()/fPart->P();
721 vect[6] = fPart->P();
723 TParticlePDG *ppdg = fPart->GetPDG(1);
724 Int_t charge = (Int_t)(ppdg->Charge()/3.0);
726 Double_t zMax = -1750.0;
727 Double_t rMax = 350.0;
731 while ((vect[2] > zMax) && (nSteps < 10000) && (r < rMax)) {
733 OneStepRungekutta(charge, step, vect, vout);
734 SetPoint(fCount,vout[0],vout[1],vout[2]);
736 for (Int_t i = 0; i < 7; i++) {
739 r = TMath::Sqrt(vect[0]*vect[0]+vect[1]*vect[1]);
744 //______________________________________________________________________________
745 void AliEveMUONTrack::MakeRefTrack(AliMUONTrack *mtrack)
748 // builds the track with dipole field starting from the TParticle
754 snprintf(form,1000,"RefTrack %2d ", fLabel);
759 MakeMUONTrack(mtrack);
763 //______________________________________________________________________________
764 void AliEveMUONTrack::Propagate(Float_t *xr, Float_t *yr, Float_t *zr, Int_t i1, Int_t i2)
767 // propagate in magnetic field between hits of indices i1 and i2
770 Double_t vect[7], vout[7];
774 AliMUONTrackParam *trackParam = 0;
775 TObjArray *trackParamAtCluster = 0;
778 zMax = zr[i1]+1.5*step;
780 zMax = zr[i2]+1.5*step;
783 trackParamAtCluster = fTrack->GetTrackParamAtCluster();
785 if (IsMUONTrack() || IsESDTrack() || IsRefTrack()) {
786 trackParam = (AliMUONTrackParam*)trackParamAtCluster->At(i1);
787 charge = (Int_t)trackParam->GetCharge();
795 vect[6] = trackParam->P();
796 vect[3] = trackParam->Px()/vect[6];
797 vect[4] = trackParam->Py()/vect[6];
798 vect[5] = trackParam->Pz()/vect[6];
801 while ((vect[2] > zMax) && (nSteps < 10000)) {
803 OneStepRungekutta(charge, step, vect, vout);
804 SetPoint(fCount,vout[0],vout[1],vout[2]);
806 for (Int_t i = 0; i < 7; i++) {
813 //______________________________________________________________________________
814 void AliEveMUONTrack::OneStepRungekutta(Double_t charge, Double_t step,
815 Double_t* vect, Double_t* vout)
817 /// ******************************************************************
819 /// * Runge-Kutta method for tracking a particle through a magnetic *
820 /// * field. Uses Nystroem algorithm (See Handbook Nat. Bur. of *
821 /// * Standards, procedure 25.5.20) *
823 /// * Input parameters *
824 /// * CHARGE Particle charge *
825 /// * STEP Step size *
826 /// * VECT Initial co-ords,direction cosines,momentum *
827 /// * Output parameters *
828 /// * VOUT Output co-ords,direction cosines,momentum *
829 /// * User routine called *
830 /// * CALL GUFLD(X,F) *
832 /// * ==>Called by : <USER>, GUSWIM *
833 /// * Authors R.Brun, M.Hansroul ********* *
834 /// * V.Perevoztchikov (CUT STEP implementation) *
837 /// ******************************************************************
839 Double_t h2, h4, f[4];
840 Double_t xyzt[3], a, b, c, ph,ph2;
841 Double_t secxs[4],secys[4],seczs[4],hxp[3];
842 Double_t g1, g2, g3, g4, g5, g6, ang2, dxt, dyt, dzt;
843 Double_t est, at, bt, ct, cba;
844 Double_t f1, f2, f3, f4, rho, tet, hnorm, hp, rho1, sint, cost;
854 Double_t maxit = 1992;
855 Double_t maxcut = 11;
857 const Double_t kdlt = 1e-4;
858 const Double_t kdlt32 = kdlt/32.;
859 const Double_t kthird = 1./3.;
860 const Double_t khalf = 0.5;
861 const Double_t kec = 2.9979251e-4;
863 const Double_t kpisqua = 9.86960440109;
867 const Int_t kipx = 3;
868 const Int_t kipy = 4;
869 const Int_t kipz = 5;
872 // *. ------------------------------------------------------------------
874 // * this constant is for units cm,gev/c and kgauss
878 for(Int_t j = 0; j < 7; j++)
881 Double_t pinv = kec * charge / vect[6];
889 if (TMath::Abs(h) > TMath::Abs(rest)) h = rest;
890 //cmodif: call gufld(vout,f) changed into:
891 TGeoGlobalMagField::Instance()->Field(vout,f);
894 // * start of integration
907 secxs[0] = (b * f[2] - c * f[1]) * ph2;
908 secys[0] = (c * f[0] - a * f[2]) * ph2;
909 seczs[0] = (a * f[1] - b * f[0]) * ph2;
910 ang2 = (secxs[0]*secxs[0] + secys[0]*secys[0] + seczs[0]*seczs[0]);
911 if (ang2 > kpisqua) break;
913 dxt = h2 * a + h4 * secxs[0];
914 dyt = h2 * b + h4 * secys[0];
915 dzt = h2 * c + h4 * seczs[0];
920 // * second intermediate point
923 est = TMath::Abs(dxt) + TMath::Abs(dyt) + TMath::Abs(dzt);
925 if (ncut++ > maxcut) break;
934 //cmodif: call gufld(xyzt,f) changed into:
935 TGeoGlobalMagField::Instance()->Field(xyzt,f);
941 secxs[1] = (bt * f[2] - ct * f[1]) * ph2;
942 secys[1] = (ct * f[0] - at * f[2]) * ph2;
943 seczs[1] = (at * f[1] - bt * f[0]) * ph2;
947 secxs[2] = (bt * f[2] - ct * f[1]) * ph2;
948 secys[2] = (ct * f[0] - at * f[2]) * ph2;
949 seczs[2] = (at * f[1] - bt * f[0]) * ph2;
950 dxt = h * (a + secxs[2]);
951 dyt = h * (b + secys[2]);
952 dzt = h * (c + seczs[2]);
956 at = a + 2.*secxs[2];
957 bt = b + 2.*secys[2];
958 ct = c + 2.*seczs[2];
960 est = TMath::Abs(dxt)+TMath::Abs(dyt)+TMath::Abs(dzt);
961 if (est > 2.*TMath::Abs(h)) {
962 if (ncut++ > maxcut) break;
971 //cmodif: call gufld(xyzt,f) changed into:
972 TGeoGlobalMagField::Instance()->Field(xyzt,f);
974 z = z + (c + (seczs[0] + seczs[1] + seczs[2]) * kthird) * h;
975 y = y + (b + (secys[0] + secys[1] + secys[2]) * kthird) * h;
976 x = x + (a + (secxs[0] + secxs[1] + secxs[2]) * kthird) * h;
978 secxs[3] = (bt*f[2] - ct*f[1])* ph2;
979 secys[3] = (ct*f[0] - at*f[2])* ph2;
980 seczs[3] = (at*f[1] - bt*f[0])* ph2;
981 a = a+(secxs[0]+secxs[3]+2. * (secxs[1]+secxs[2])) * kthird;
982 b = b+(secys[0]+secys[3]+2. * (secys[1]+secys[2])) * kthird;
983 c = c+(seczs[0]+seczs[3]+2. * (seczs[1]+seczs[2])) * kthird;
985 est = TMath::Abs(secxs[0]+secxs[3] - (secxs[1]+secxs[2]))
986 + TMath::Abs(secys[0]+secys[3] - (secys[1]+secys[2]))
987 + TMath::Abs(seczs[0]+seczs[3] - (seczs[1]+seczs[2]));
989 if (est > kdlt && TMath::Abs(h) > 1.e-4) {
990 if (ncut++ > maxcut) break;
996 // * if too many iterations, go to helix
997 if (iter++ > maxit) break;
1002 cba = 1./ TMath::Sqrt(a*a + b*b + c*c);
1010 if (step < 0.) rest = -rest;
1011 if (rest < 1.e-5*TMath::Abs(step)) return;
1015 // angle too big, use helix
1020 f4 = TMath::Sqrt(f1*f1+f2*f2+f3*f3);
1029 hxp[0] = f2*vect[kipz] - f3*vect[kipy];
1030 hxp[1] = f3*vect[kipx] - f1*vect[kipz];
1031 hxp[2] = f1*vect[kipy] - f2*vect[kipx];
1033 hp = f1*vect[kipx] + f2*vect[kipy] + f3*vect[kipz];
1036 sint = TMath::Sin(tet);
1037 cost = 2.*TMath::Sin(khalf*tet)*TMath::Sin(khalf*tet);
1041 g3 = (tet-sint) * hp*rho1;
1046 vout[kix] = vect[kix] + g1*vect[kipx] + g2*hxp[0] + g3*f1;
1047 vout[kiy] = vect[kiy] + g1*vect[kipy] + g2*hxp[1] + g3*f2;
1048 vout[kiz] = vect[kiz] + g1*vect[kipz] + g2*hxp[2] + g3*f3;
1050 vout[kipx] = vect[kipx] + g4*vect[kipx] + g5*hxp[0] + g6*f1;
1051 vout[kipy] = vect[kipy] + g4*vect[kipy] + g5*hxp[1] + g6*f2;
1052 vout[kipz] = vect[kipz] + g4*vect[kipz] + g5*hxp[2] + g6*f3;
1057 //______________________________________________________________________________
1058 Int_t AliEveMUONTrack::ColorIndex(Float_t val)
1061 // returns color index in the palette for a give value
1064 Float_t threshold = 0.0;
1065 Float_t maxVal = 10.0;
1067 Float_t div = TMath::Max(1, (Int_t)(maxVal - threshold));
1068 Int_t nCol = gStyle->GetNumberOfColors();
1069 Int_t cBin = (Int_t) TMath::Nint(nCol*(val - threshold)/div);
1071 return gStyle->GetColorPalette(TMath::Min(nCol - 1, cBin));
1075 //==============================================================================
1076 // Temporary AliEveMUONTrackList
1077 //==============================================================================
1079 //______________________________________________________________________________
1080 void AliEveMUONTrackList::HackMomentumLimits(Bool_t recurse)
1082 // Find momentum limits from included tracks.
1086 for (List_i i=BeginChildren(); i!=EndChildren(); ++i)
1088 TEveTrack* track = dynamic_cast<TEveTrack*>(*i);
1091 fLimPt = TMath::Max(fLimPt, track->GetMomentum().Perp());
1092 fLimP = TMath::Max(fLimP, track->GetMomentum().Mag());
1095 FindMomentumLimits(*i, recurse);
1098 fLimPt = RoundMomentumLimit(fLimPt);
1099 fLimP = RoundMomentumLimit(fLimP);
1100 if (fMaxPt == 0) fMaxPt = fLimPt;
1101 if (fMaxP == 0) fMaxP = fLimP;