new MC resolution test
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Jan 2009 09:48:43 +0000 (09:48 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Jan 2009 09:48:43 +0000 (09:48 +0000)
- spatial resolution of the Kalman propagator
- variance/covariance of the Kalman propagator in the TRD

TRD/AliTRDtrackerV1.h
TRD/qaRec/AliTRDtrackInfo/AliTRDtrackInfo.cxx
TRD/qaRec/AliTRDtrackInfo/AliTRDtrackInfo.h
TRD/qaRec/AliTRDtrackingResolution.cxx

index 1dee8f0..9ad8dd3 100644 (file)
@@ -99,6 +99,7 @@ public:
   Int_t           LoadClusters(TTree *cTree);
   Int_t           LoadClusters(TClonesArray *clusters);
   Int_t           PropagateBack(AliESDEvent *event);
+  static Int_t    PropagateToX(AliTRDtrackV1 &t, Double_t xToGo, Double_t maxStep);
   Int_t           ReadClusters(TClonesArray* &array, TTree *in) const;
   Int_t           RefitInward(AliESDEvent *event);
   static void     SetNTimeBins(Int_t nTimeBins){fgNTimeBins = nTimeBins; }
@@ -139,7 +140,6 @@ protected:
   Bool_t         GetTrackPoint(Int_t index, AliTrackPoint &p) const;   
   Int_t          MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *sseed, Int_t *ipar);
   AliTRDtrackV1* MakeTrack(AliTRDseedV1 *seeds, Double_t *params);
-  static Int_t   PropagateToX(AliTRDtrackV1 &t, Double_t xToGo, Double_t maxStep);
   AliTRDtrackV1* SetTrack(AliTRDtrackV1 *track);
   AliTRDseedV1*  SetTracklet(AliTRDseedV1 *tracklet);
 
index 2a13c99..cc013ea 100644 (file)
@@ -25,6 +25,8 @@
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
+#include "TDatabasePDG.h"
+
 #include "AliTrackReference.h"
 #include "AliExternalTrackParam.h"
 #include "AliLog.h"
@@ -32,6 +34,7 @@
 #include "AliTRDseedV1.h"
 #include "AliTRDtrackV1.h"
 #include "AliTRDgeometry.h"
+#include "AliTRDtrackerV1.h"
 
 #include <cstdio>
 #include <cstdlib>
@@ -394,3 +397,51 @@ Bool_t AliTRDtrackInfo::AliMCinfo::GetDirections(Float_t &x0, Float_t &y0, Float
   return kTRUE;
 }
 
+//___________________________________________________
+void AliTRDtrackInfo::AliMCinfo::PropagateKalman(Double_t dx[kNTrackRefs], Double_t dy[kNTrackRefs], Double_t dz[kNTrackRefs], Double_t dp[kNTrackRefs], Double_t c[kNTrackRefs][15], Double_t step) const
+{
+// Propagate Kalman from the first TRD track reference to 
+// last one and save residuals in the y, z and pt.
+// 
+// This is to calibrate the dEdx and MS corrections
+
+  for(Int_t itr=kNTrackRefs; itr--;){
+    dx[itr] = -1.; dy[itr] = 100.; dz[itr] = 100.; dp[itr] = 100.;
+  }
+  if(!fNTrackRefs) return;
+
+  // Initialize TRD track to the first track reference
+  AliTrackReference *tr = fTrackRefs[0];
+  AliTRDtrackV1 tt;
+  Double_t xyz[3]={tr->X(),tr->Y(),tr->Z()};
+  Double_t pxyz[3]={tr->Px(),tr->Py(),tr->Pz()};
+  Double_t var[6] = {1.e-4, 1.e-4, 1.e-4, 1.e-4, 1.e-4, 1.e-4};
+  Double_t cov[21]={
+    var[0],  0.,  0.,  0.,  0.,  0.,
+         var[1],  0.,  0.,  0.,  0.,
+              var[2],  0.,  0.,  0.,
+                   var[3],  0.,  0.,
+                        var[4],  0.,
+                             var[5]
+  };
+  TDatabasePDG db;
+  const TParticlePDG *pdg=db.GetParticle(fPDG);
+  tt.Set(xyz, pxyz, cov, Short_t(pdg->Charge()));
+  tt.SetMass(pdg->Mass());
+  
+  Double_t x0 = tr->LocalX();
+  const Double_t *cc = 0x0;
+  for(Int_t itr=1, ip=0; itr<fNTrackRefs; itr++){
+    tr = fTrackRefs[itr];
+    if(!AliTRDtrackerV1::PropagateToX(tt, tr->LocalX(), step)) continue;
+
+    //if(update) ...
+    dx[ip] = tt.GetX() - x0;
+    dy[ip] = tt.GetY() - tr->LocalY();
+    dz[ip] = tt.GetZ() - tr->Z();
+    dp[ip] = tt.Pt()- tr->Pt();
+    cc = tt.GetCovariance();
+    memcpy(c[ip], cc, 15*sizeof(Double_t));
+    ip++;
+  }
+}
index 8de816c..95c41b5 100644 (file)
@@ -73,6 +73,7 @@ public:
     Int_t   GetPDG() const {return fPDG;}
     Bool_t  GetDirections(Float_t &x0, Float_t &y0, Float_t &z0, Float_t &dydx, Float_t &dzdx, Float_t &pt, UChar_t &s) const;
     AliTrackReference const* GetTrackRef(Int_t ref=0) const {return fTrackRefs[ref];}
+    void    PropagateKalman(Double_t dx[kNTrackRefs], Double_t dy[kNTrackRefs], Double_t dz[kNTrackRefs], Double_t dpt[kNTrackRefs], Double_t c[kNTrackRefs][15], Double_t step = 2.) const;
 
   protected:
     Int_t   fLabel;             // MC label  
index 2c5fd84..f7a3c07 100644 (file)
@@ -314,6 +314,26 @@ TH1* AliTRDtrackingResolution::PlotResolution(const AliTRDtrackV1 *track)
   Int_t label = fMC->GetLabel();
   Float_t p, pt, x0, y0, z0, dx, dy, dz, dydx, dzdx;
 
+  if(fDebugLevel>=1){
+    Double_t DX[12], DY[12], DZ[12], DPt[12], COV[12][15];
+    fMC->PropagateKalman(DX, DY, DZ, DPt, COV);
+    (*fDebugStream) << "MCkalman"
+      << "pdg="  << pdg
+      << "dx0="  << DX[0]
+      << "dx1="  << DX[1]
+      << "dx2="  << DX[2]
+      << "dy0="  << DY[0]
+      << "dy1="  << DY[1]
+      << "dy2="  << DY[2]
+      << "dz0="  << DZ[0]
+      << "dz1="  << DZ[1]
+      << "dz2="  << DZ[2]
+      << "dpt0=" << DPt[0]
+      << "dpt1=" << DPt[1]
+      << "dpt2=" << DPt[2]
+      << "\n";
+  }
+
   AliTRDseedV1 *fTracklet = 0x0;  
   for(Int_t ily=0; ily<AliTRDgeometry::kNlayer; ily++){
     if(!(fTracklet = fTrack->GetTracklet(ily)) ||