]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/AliRICHHelix.cxx
track matching macros from Alberto
[u/mrichter/AliRoot.git] / RICH / AliRICHHelix.cxx
1 #include "AliRICHHelix.h" //class header
2 #include <TPolyLine3D.h>  //Draw()
3
4 ClassImp(AliRICHHelix)
5 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 AliRICHHelix::AliRICHHelix(Double_t p,Double_t theta,Double_t phi,Double_t bz):TObject(),
7   fX0(TVector3(0,0,0)),
8   fP0(TVector3(0,0,0)),
9   fX(TVector3(0,0,0)),
10   fP(TVector3(0,0,0)),
11   fLen(0),
12   fQ(0),
13   fBz(bz),
14   fPosRad(TVector2(0,0)),
15   fPosPc(TVector2(0,0)),
16   fPloc(TVector3(0,0,0)) 
17 {
18   fP0.SetMagThetaPhi(p,theta*TMath::DegToRad(),phi*TMath::DegToRad());     fP=fP0;
19 }
20 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 void  AliRICHHelix::Print(Option_t *opt) const
22 {
23 // Debug printout
24   Printf("%s helix for Q=%i in B=(0,0,%.2f) tesla",opt,fQ,fBz);
25   Printf("Helix parametrised  @ x0=(%6.2f,%6.2f,%6.2f) cm p0=(%6.2f,%6.2f,%6.2f) GeV  P=%.2f GeV Theta=%.2f Phi=%.2f degrees", 
26                                 fX0.X(),fX0.Y(),fX0.Z(),    fP0.Px(),fP0.Py(),fP0.Pz(), fP0.Mag(),fP0.Theta()*TMath::RadToDeg(),fP0.Phi()*TMath::RadToDeg());
27   Printf("@ %7.2f cm           x=(%6.2f,%6.2f,%6.2f) cm  p=(%6.2f,%6.2f,%6.2f) GeV  P=%.2f GeV Theta=%.2f Phi=%.2f degrees",
28            fLen,              fX.X(), fX.Y(), fX.Z(),       fP.Px(),fP.Py(),fP.Pz(), fP.Mag(), fP.Theta()*TMath::RadToDeg(),fP.Phi()*TMath::RadToDeg());
29   Printf("             in LORS   rad=(%5.2f,%5.2f)  pc=(%5.2f,%5.2f)",fPosRad.X(), fPosRad.Y(),fPosPc.X(),fPosPc.Y());
30 }
31 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32 void AliRICHHelix::Draw(const Option_t *)
33 {
34 // Draw helix by a set of points seperated by 1 cm distance 
35   
36   const Int_t kNpoints=500;
37   TPolyLine3D *pHelDraw = new TPolyLine3D(kNpoints); pHelDraw->SetLineColor(kGreen);
38   for(Int_t i=0;i<kNpoints;i++) {
39     Propagate(i);
40     pHelDraw->SetPoint(i,fX.X(),fX.Y(),fX.Z());
41   }  
42   pHelDraw->Draw();
43 }