]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODTrack.cxx
POI's and RP's for LeeYang Zeroes eventplane
[u/mrichter/AliRoot.git] / STEER / AliAODTrack.cxx
index d620a3d38b0e67c558a039504cc39a57b7b77a18..752c0ab2ae2b49379c46edffc41d65eb4bbe564f 100644 (file)
@@ -16,7 +16,7 @@
 /* $Id$ */
 
 //-------------------------------------------------------------------------
-//     AOD track implementation of AliVParticle
+//     AOD track implementation of AliVTrack
 //     Author: Markus Oldenburg, CERN
 //     Markus.Oldenburg@cern.ch
 //-------------------------------------------------------------------------
@@ -28,7 +28,7 @@ ClassImp(AliAODTrack)
 
 //______________________________________________________________________________
 AliAODTrack::AliAODTrack() : 
-  AliVParticle(),
+  AliVTrack(),
   fChi2perNDF(-999.),
   fChi2MatchTrigger(0.),
   fFlags(0),
@@ -46,6 +46,8 @@ AliAODTrack::AliAODTrack() :
 
   SetP();
   SetPosition((Float_t*)NULL);
+  SetXYAtDCA(-999., -999.);
+  SetPxPyPzAtDCA(-999., -999., -999.);
   SetPID((Float_t*)NULL);
 }
 
@@ -64,13 +66,14 @@ AliAODTrack::AliAODTrack(Short_t id,
                         Bool_t usedForVtxFit,
                         Bool_t usedForPrimVtxFit,
                         AODTrk_t ttype,
-                        UInt_t selectInfo) :
-  AliVParticle(),
-  fChi2perNDF(-999.),
+                        UInt_t selectInfo,
+                        Float_t chi2perNDF) :
+  AliVTrack(),
+  fChi2perNDF(chi2perNDF),
   fChi2MatchTrigger(0.),
   fFlags(0),
   fLabel(label),
-  fITSMuonClusterMap(itsClusMap),
+  fITSMuonClusterMap(0),
   fFilterMap(selectInfo),
   fID(id),
   fCharge(charge),
@@ -83,11 +86,13 @@ AliAODTrack::AliAODTrack(Short_t id,
  
   SetP(p, cartesian);
   SetPosition(x, isDCA);
+  SetXYAtDCA(-999., -999.);
+  SetPxPyPzAtDCA(-999., -999., -999.);
   SetUsedForVtxFit(usedForVtxFit);
   SetUsedForPrimVtxFit(usedForPrimVtxFit);
   if(covMatrix) SetCovMatrix(covMatrix);
   SetPID(pid);
-
+  SetITSClusterMap(itsClusMap);
 }
 
 //______________________________________________________________________________
@@ -105,13 +110,14 @@ AliAODTrack::AliAODTrack(Short_t id,
                         Bool_t usedForVtxFit,
                         Bool_t usedForPrimVtxFit,
                         AODTrk_t ttype,
-                        UInt_t selectInfo) :
-  AliVParticle(),
-  fChi2perNDF(-999.),
+                        UInt_t selectInfo,
+                        Float_t chi2perNDF) :
+  AliVTrack(),
+  fChi2perNDF(chi2perNDF),
   fChi2MatchTrigger(0.),
   fFlags(0),
   fLabel(label),
-  fITSMuonClusterMap(itsClusMap),
+  fITSMuonClusterMap(0),
   fFilterMap(selectInfo),
   fID(id),
   fCharge(charge),
@@ -124,10 +130,13 @@ AliAODTrack::AliAODTrack(Short_t id,
  
   SetP(p, cartesian);
   SetPosition(x, isDCA);
+  SetXYAtDCA(-999., -999.);
+  SetPxPyPzAtDCA(-999., -999., -999.);
   SetUsedForVtxFit(usedForVtxFit);
   SetUsedForPrimVtxFit(usedForPrimVtxFit);
   if(covMatrix) SetCovMatrix(covMatrix);
   SetPID(pid);
+  SetITSClusterMap(itsClusMap);
 }
 
 //______________________________________________________________________________
@@ -135,12 +144,13 @@ AliAODTrack::~AliAODTrack()
 {
   // destructor
   delete fCovMatrix;
+  delete fDetPid;
 }
 
 
 //______________________________________________________________________________
 AliAODTrack::AliAODTrack(const AliAODTrack& trk) :
-  AliVParticle(trk),
+  AliVTrack(trk),
   fChi2perNDF(trk.fChi2perNDF),
   fChi2MatchTrigger(trk.fChi2MatchTrigger),
   fFlags(trk.fFlags),
@@ -158,6 +168,8 @@ AliAODTrack::AliAODTrack(const AliAODTrack& trk) :
 
   trk.GetP(fMomentum);
   trk.GetPosition(fPosition);
+  SetXYAtDCA(trk.XAtDCA(), trk.YAtDCA());
+  SetPxPyPzAtDCA(trk.PxAtDCA(), trk.PyAtDCA(), trk.PzAtDCA());
   SetUsedForVtxFit(trk.GetUsedForVtxFit());
   SetUsedForPrimVtxFit(trk.GetUsedForPrimVtxFit());
   if(trk.fCovMatrix) fCovMatrix=new AliAODRedCov<6>(*trk.fCovMatrix);
@@ -171,12 +183,15 @@ AliAODTrack& AliAODTrack::operator=(const AliAODTrack& trk)
   // Assignment operator
   if(this!=&trk) {
 
-    AliVParticle::operator=(trk);
+    AliVTrack::operator=(trk);
 
     trk.GetP(fMomentum);
     trk.GetPosition(fPosition);
     trk.GetPID(fPID);
 
+    SetXYAtDCA(trk.XAtDCA(), trk.YAtDCA());
+    SetPxPyPzAtDCA(trk.PxAtDCA(), trk.PyAtDCA(), trk.PzAtDCA());
+    
     fChi2perNDF = trk.fChi2perNDF;
     fChi2MatchTrigger = trk.fChi2MatchTrigger;
 
@@ -457,13 +472,7 @@ void AliAODTrack::SetMatchTrigger(Int_t matchTrig){
   }
 }
 
-void AliAODTrack::SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh){
-//
-// Set the MUON hit pattern (1 bit per chamber) 
-  fITSMuonClusterMap=(fITSMuonClusterMap&0xffff00ff)|(hitsPatternInTrigCh<<8);
-}
-
-Int_t AliAODTrack::HitsMT(Int_t istation, Int_t iplane, Char_t *cathode){
+Int_t AliAODTrack::HitsMT(Int_t istation, Int_t iplane, Option_t *cathode){
 //
 // Retrieve hit information for MUON identified by  (station, plane, cathode)
   if(cathode){
@@ -528,111 +537,26 @@ Int_t AliAODTrack::HitsMT(Int_t istation, Int_t iplane, Char_t *cathode){
 }
 
 Int_t AliAODTrack::HitsMuonChamber(Int_t MuonChamber){
-// Retrieve hit information for MUON Chamber
-  switch(MuonChamber){
-    case 11:
-      return HitsMT(1,1);
-    case 12:
-      return HitsMT(1,2);
-    case 13:
-      return HitsMT(2,1);
-    case 14:
-      return HitsMT(2,2);
-    default:
-      printf("Unknown MUON chamber: %d\n",MuonChamber);
-      return 0;
+  //
+  // Retrieve hit information for MUON Tracker/Trigger Chamber
+  // WARNING: chamber number start from 1 instead of 0
+  
+  if (MuonChamber > 0 && MuonChamber < 11) {
+    return ((GetMUONClusterMap() & BIT(MuonChamber-1)) != 0) ? 1 : 0;
+  } else {
+    switch(MuonChamber){
+      case 11:
+       return HitsMT(1,1);
+      case 12:
+       return HitsMT(1,2);
+      case 13:
+       return HitsMT(2,1);
+      case 14:
+       return HitsMT(2,2);
+      default:
+       printf("Unknown MUON chamber: %d\n",MuonChamber);
+       return 0;
+    }
   }
 }
 
-
-
-Bool_t AliAODTrack::PropagateTo(Double_t xk, Double_t b) {
-  //----------------------------------------------------------------
-  // Propagate this track to the plane X=xk (cm) in the field "b" (kG)
-  // This is in local coordinates!!!
-  //----------------------------------------------------------------
-
-  Double_t alpha = 0.;
-  Double_t localP[3] = {Px(), Py(), Pz()}; // set global (sic!) p
-  Global2LocalMomentum(localP, Charge(), alpha); // convert global to local momentum
-
-  AliAODVertex *origin = (AliAODVertex*)fProdVertex.GetObject();
-  Double_t localX[3] = {origin->GetX(), origin->GetY(), origin->GetZ()}; // set global (sic!) location of first track point
-  Global2LocalPosition(localX, alpha); // convert global to local position
-
-  Double_t &fX = localX[0];
-
-  Double_t dx=xk-fX;
-  if (TMath::Abs(dx)<=kAlmost0)  return kTRUE;
-
-  Double_t crv=localP[0]*b*kB2C;
-  if (TMath::Abs(b) < kAlmost0Field) crv=0.;
-
-  Double_t f1=localP[1], f2=f1 + crv*dx;
-  if (TMath::Abs(f1) >= kAlmost1) return kFALSE;
-  if (TMath::Abs(f2) >= kAlmost1) return kFALSE;
-
-  Double_t &fP0=localX[1], &fP1=localX[2], &fP2=localP[0], &fP3=localP[1], &fP4=localP[2];
-  /* covariance matrix to be fixed! 
-  Double_t 
-  &fC00=fC[0],
-  &fC10=fC[1],   &fC11=fC[2],  
-  &fC20=fC[3],   &fC21=fC[4],   &fC22=fC[5],
-  &fC30=fC[6],   &fC31=fC[7],   &fC32=fC[8],   &fC33=fC[9],  
-  &fC40=fC[10],  &fC41=fC[11],  &fC42=fC[12],  &fC43=fC[13], &fC44=fC[14];
-  */
-  Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2);
-
-  fX=xk;
-  fP0 += dx*(f1+f2)/(r1+r2);
-  fP1 += dx*(r2 + f2*(f1+f2)/(r1+r2))*fP3;
-  fP2 += dx*crv;
-
-  //f = F - 1
-   
-  //Double_t f02=    dx/(r1*r1*r1);            
-  Double_t cc=crv/fP4;
-  Double_t f04=0.5*dx*dx/(r1*r1*r1);         f04*=cc;
-  //Double_t f12=    dx*fP3*f1/(r1*r1*r1);
-  Double_t f14=0.5*dx*dx*fP3*f1/(r1*r1*r1);  f14*=cc;
-  //Double_t f13=    dx/r1;
-  Double_t f24=    dx;                       f24*=cc;
-  
-  /* covariance matrix to be fixed!
-  //b = C*ft
-  Double_t b00=f02*fC20 + f04*fC40, b01=f12*fC20 + f14*fC40 + f13*fC30;
-  Double_t b02=f24*fC40;
-  Double_t b10=f02*fC21 + f04*fC41, b11=f12*fC21 + f14*fC41 + f13*fC31;
-  Double_t b12=f24*fC41;
-  Double_t b20=f02*fC22 + f04*fC42, b21=f12*fC22 + f14*fC42 + f13*fC32;
-  Double_t b22=f24*fC42;
-  Double_t b40=f02*fC42 + f04*fC44, b41=f12*fC42 + f14*fC44 + f13*fC43;
-  Double_t b42=f24*fC44;
-  Double_t b30=f02*fC32 + f04*fC43, b31=f12*fC32 + f14*fC43 + f13*fC33;
-  Double_t b32=f24*fC43;
-  
-  //a = f*b = f*C*ft
-  Double_t a00=f02*b20+f04*b40,a01=f02*b21+f04*b41,a02=f02*b22+f04*b42;
-  Double_t a11=f12*b21+f14*b41+f13*b31,a12=f12*b22+f14*b42+f13*b32;
-  Double_t a22=f24*b42;
-
-  //F*C*Ft = C + (b + bt + a)
-  fC00 += b00 + b00 + a00;
-  fC10 += b10 + b01 + a01; 
-  fC20 += b20 + b02 + a02;
-  fC30 += b30;
-  fC40 += b40;
-  fC11 += b11 + b11 + a11;
-  fC21 += b21 + b12 + a12;
-  fC31 += b31; 
-  fC41 += b41;
-  fC22 += b22 + b22 + a22;
-  fC32 += b32;
-  fC42 += b42;
-  */
-  
-  Local2GlobalMomentum(localP, alpha); // convert local to global momentum
-  SetP(localP);
-
-  return kTRUE;
-}