]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
o add z0 list
authorwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Oct 2013 23:21:28 +0000 (23:21 +0000)
committerwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Oct 2013 23:21:28 +0000 (23:21 +0000)
TPC/Upgrade/AliToyMCReconstruction.cxx
TPC/Upgrade/AliToyMCReconstruction.h

index 5d567d3569195a5482b5298cce599979d85acaa7..505e3954174649156165691f0e77c6667eef263b 100644 (file)
@@ -50,6 +50,7 @@ AliToyMCReconstruction::AliToyMCReconstruction() : TObject()
 , fLongT0seed(kTRUE)
 , fFillClusterRes(kFALSE)
 , fUseT0list(kTRUE)
+, fUseZ0list(kTRUE)
 , fForceAlpha(kFALSE)
 , fStreamer(0x0)
 , fInputFile(0x0)
@@ -125,12 +126,15 @@ void AliToyMCReconstruction::RunReco(const char* file, Int_t nmaxEv)
   AliExternalTrackParam *dummy;
 
   // prepare list of T0s
-  TVectorF t0list(fTree->GetEntries());
-  if (fUseT0list) {
+  TVectorF t0list(maxev);
+  TVectorF z0list(maxev);
+  if (fUseT0list || fUseZ0list) {
     for (Int_t iev=0; iev<maxev; ++iev){
       fTree->GetEvent(iev);
       const Float_t t0=fEvent->GetT0();
+      const Float_t z0=fEvent->GetZ();
       t0list[iev]=t0;
+      z0list[iev]=z0;
     }
   }
   
@@ -221,8 +225,8 @@ void AliToyMCReconstruction::RunReco(const char* file, Int_t nmaxEv)
         // in case the match with the real T0 infor is requested, find the
         //    closes T0 from the list of T0s
         fTime0 = t0seed.GetZ()-zLength/vDrift;
-        if (fUseT0list) {
-          fTime0 = FindClosestT0(t0list, fTime0);
+        if (fUseT0list || fUseZ0list) {
+          fTime0 = FindClosestT0(t0list, z0list, t0seed);
         }
         // create real seed using the time 0 from the first seed
         // set fCreateT0seed now to false to get the seed in z coordinates
@@ -3008,7 +3012,7 @@ void AliToyMCReconstruction::CopyRieman(const AliRieman &from, AliRieman &to)
 }
 
 //____________________________________________________________________________________
-Float_t AliToyMCReconstruction::FindClosestT0(const TVectorF &t0list, Float_t t0seed)
+Float_t AliToyMCReconstruction::FindClosestT0(const TVectorF &t0list, const TVectorF &z0list, AliExternalTrackParam &t0seed)
 {
   //
   // find closes T0 in a list of T0s
@@ -3017,10 +3021,20 @@ Float_t AliToyMCReconstruction::FindClosestT0(const TVectorF &t0list, Float_t t0
   Long64_t size=t0list.GetNrows();
   const Float_t *array=t0list.GetMatrixArray();
 
+  Float_t vDrift=GetVDrift();
+  Float_t zLength=GetZLength(0);
+
+  Float_t sign=(1-2*(t0seed.GetTgl()>0));
+
+  Float_t vtxCorr=0.;
+  Float_t t0=t0seed.GetZ()-zLength/vDrift;
+  
   Int_t index=0;
   Float_t minDist=1e20;
   for (Int_t it0=0; it0<size; ++it0) {
-    const Float_t dist=TMath::Abs(t0list[it0]-t0seed);
+    if (fUseZ0list) vtxCorr=sign*z0list[it0]/vDrift;
+    printf("vtxcorr %d: %.2g, %.2g\n",it0, vtxCorr, z0list[it0]);
+    const Float_t dist=TMath::Abs(t0list[it0]-t0-vtxCorr);
     if (dist<minDist) {
       index=it0;
       minDist=dist;
index f4dc86b78ec8936c1a5bd57d269f6ae1bc45fb07..c1c015ccd586bc79f804ea1dd1c2e9c8bd9864d8 100644 (file)
@@ -75,6 +75,9 @@ public:
   void   SetUseT0list(Bool_t use)       { fUseT0list=use;    }
   Bool_t GetUseT0list()  const          { return fUseT0list; }
   
+  void   SetUseZ0list(Bool_t use)       { fUseZ0list=use;    }
+  Bool_t GetUseZ0list()  const          { return fUseZ0list; }
+  
   void   SetForceAlpha(Bool_t use)       { fForceAlpha=use;    }
   Bool_t GetForceAlpha()  const          { return fForceAlpha; }
   
@@ -151,7 +154,7 @@ public:
   void MarkClustersUsed(AliTPCseed *seed);
   void ResetClustersZtoTime(AliTPCseed *seed);
 
-  Float_t FindClosestT0(const TVectorF &t0list, Float_t t0seed);
+  Float_t FindClosestT0(const TVectorF &t0list, const TVectorF &z0list, AliExternalTrackParam &t0seed);
   
   // reco settings
   Int_t  fSeedingRow;            // first row used for seeding
@@ -170,6 +173,7 @@ public:
   Bool_t   fLongT0seed;          // if we should use a t0 seed including all clusters in the seed range
   Bool_t   fFillClusterRes;      // fill cluster residuals?
   Bool_t   fUseT0list;           // if the list of T0 information should be used to guess the T0
+  Bool_t   fUseZ0list;           // if the list of Z vertex information should be used to guess the T0
   Bool_t   fForceAlpha;          // force the correct alpha for the t0 seed extrapolation
   
   TTreeSRedirector *fStreamer;   // debug streamer