Investigating Issues with Track Reconstruction and Simulation in Run 14

Dmitri Smirnov

September—October, 2018

Updated

Details

Real Data Samples and Options

From official production web page:

  • SL16d, AuAu 200GeV run 2014 reproduction with HFT tracking (fixed PXL code)
    DbV20160418 P2014a pxlHit istHit
    btof mtd mtdCalib BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt
    
  • SL17d, AuAu 200GeV run 2014 st_physics data reproduction with selected trigger and w/o HFT tracking by request of JetCorr PWG
    DbV20150316 DbV20170712_trg_Calibrations FiltTrg_JetCorrTrgs P2014a
    btof mtd mtdCalib BEmcChkStat CorrX OSpaceZ2 OGridLeak3D -hitfilt
    
  • Test file
    /star/rcf/test/daq/2014/086/st_physics_15086051_raw_2500017.daq
    

Simulation Samples and Options

From official production web page:

  • Original set of options from nightly test
    fzin tpcRS y2014a AgML pxlFastSim istFastSim usexgeom FieldOn MakeEvent Sti
    NoSsdIt NoSvtIt StiHftC TpcHitMover TpxClu Idst BAna l0 Tree logger genvtx tpcDB
    bbcSim btofsim vpdSim mtdSim tags emcY2 EEfs evout geantout -dstout IdTruth big
    MiniMcMk cl
    
  • For the test of "baseline" code remove cl option

Data

Let's compare

  • P16id, AuAu 200GeV run 2014 reproduction with HFT tracking (fixed PXL code)
    P2014a btof mtd mtdCalib BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt
    
  • P17id, AuAu 200GeV run 2014 st_physics data reproduction with selected trigger and w/o HFT tracking by request of JetCorr PWG
    P2014a pxlHit istHit btof mtd mtdCalib BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt
    
    P2014a btof mtd mtdCalib BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt
    

Observations

  • Comparing SL16d and SL17d
  • Using the same options the number of global tracks is different
  • Geometries differ according to messages in log files

    SL16d

    StiMaker:INFO  - TGeoManager::CloseGeometry : 282755 nodes/ 2991 volume UID's in The STAR Geometry Manager
    

    SL17d, AGML2

    StiMaker:INFO  - TGeoManager::CloseGeometry : 281515 nodes/ 2975 volume UID's in The STAR Geometry Manager
    

Looking for Problematic Code Changes

  • Use git-bisect to pinpoint the modification causing the change in global track numbers
  • Search between SL16f (good) and SL16g (bad)
  • "good" — same number of global tracks as in SL16f
  • "bad" — different number of global tracks w.r.t SL16f
  • "skip" — code cannot be compiled
  • The offending change is somewhere between bef93dd5 and 215fb8e2

Changes Causing the Drop in Global Tracks

  • Complete code diff available here

diff --git a/StRoot/Sti/StiKalmanTrack.cxx b/StRoot/Sti/StiKalmanTrack.cxx
index 5d008fb3ed..af3cf64a34 100644
--- a/StRoot/Sti/StiKalmanTrack.cxx
+++ b/StRoot/Sti/StiKalmanTrack.cxx
@@ -1551,7 +1551,7 @@ void StiKalmanTrack::print(const char *opt) const
 #include "TProfile.h"
 #endif // APPROX_DEBUG
 //_____________________________________________________________________________
-int StiKalmanTrack::approx(int mode)
+int StiKalmanTrack::approx(int mode,int nNodes)
 {
 static int nCall=0; nCall++;
 StiDebug::Break(nCall);
@@ -1572,7 +1572,7 @@ if(!myCanvas) {
 #endif // APPROX_DEBUG

 const double BAD_XI2[2]={99,22},XI2_FACT=9;
-int nNode,nNodeIn,iNode=0;
+int nNode,nNodeIn;
 double Xi2=0;
   StiHitErrs hr;
 //             Loop over nodes and collect global xyz
@@ -1583,8 +1583,7 @@ double Xi2=0;
   THelixFitter circ;
   THelixTrack  cirl;
   int zeroH = -1;
-  for (source=rbegin();(targetNode=source());++source) {
-    iNode++;
+  for (source=begin();(targetNode=source())&&nNode<nNodes;++source) {
     if (!targetNode->isValid())        continue;
     const StiHit * hit = targetNode->getHit();
     if (!hit)                          continue;
@@ -1614,29 +1613,20 @@ double Xi2=0;
   if (zeroH) circ.Set(kZEROCURV);
   circ.MakeErrs();

+  circ.Backward();
   double s=0,xyz[3];
-  double curv = circ.GetRho();
-  iNode = 0;
-  for (source=rbegin();(targetNode=source());++source) {
-    iNode++;
-    if (!targetNode->isValid())        continue;
-    const StiHit *hit = targetNode->getHit();
-    if (hit) {
+  const StiHit *hit = firstNode->getHit();
+  assert(hit);
   xyz[0] = hit->x_g();
   xyz[1] = hit->y_g();
   xyz[2] = hit->z_g();
-    } else {
-      xyz[0] = targetNode->x_g();
-      xyz[1] = targetNode->y_g();
-      xyz[2] = targetNode->z_g();
-    }
   double ds = circ.Path(xyz[0],xyz[1]);
+  double curv = circ.GetRho();
   circ.Move(ds);
-    s+=ds;
   cirl = circ;
-    double alfa = targetNode->getAlpha();
+  double alfa = firstNode->getAlpha();
   cirl.Rot(-alfa);
-    StiNodePars P = targetNode->fitPars();
+  StiNodePars P = firstNode->fitPars();
   P.x()  =  cirl.Pos()[0];
   P.y()  =  cirl.Pos()[1];
   P.z()  =  cirl.Pos()[2];
@@ -1650,18 +1640,12 @@ double Xi2=0;
   P._cosCA = cirl.Dir()[0]/cirl.GetCos();
   P._sinCA = cirl.Dir()[1]/cirl.GetCos();
   if (fabs(P._cosCA)>0.99 || fabs(P._sinCA)>0.99) P.ready();
-
-    targetNode->fitPars() = P;
-    int ians = targetNode->nudge();
-    if(ians) {nNode--; targetNode->setInvalid();continue;}
-    P = targetNode->fitPars();
-    StiNodeErrs &E = targetNode->fitErrs();
+  firstNode->fitPars() = P;
+  P = firstNode->fitPars();
+  StiNodeErrs &E = firstNode->fitErrs();
   cirl.StiEmx(E.G());
   TCL::vscale(&(E._cPX),hh,&(E._cPX),5);
   E._cPP*=hh; E._cTP*=hh;
-    if ((mode&1)==0 && Xi2>XI2_FACT) E*=Xi2/XI2_FACT;
-    E.check("In aprox");
-  }
   if (Xi2>BAD_XI2[mode])return 2;
   if (nNode==nNodeIn)  return 0;
   if (nNode<2)         return 3;


Changes Causing the Drop in Global Tracks

  • Complete code diff available here

diff --git a/StRoot/Sti/StiKalmanTrackFinder.cxx b/StRoot/Sti/StiKalmanTrackFinder.cxx
index d7493f55f8..b457dd5fd3 100644
--- a/StRoot/Sti/StiKalmanTrackFinder.cxx
+++ b/StRoot/Sti/StiKalmanTrackFinder.cxx
@@ -184,12 +184,9 @@ Int_t StiKalmanTrackFinder::Fit(StiKalmanTrack *track, Double_t rMin) {

   do { //technical do
     track->setFlag(-1);
-    status = track->approx(0); // should be filled by track->initialize()
-    if (status)        {nTSeed++; errType = abs(status)*100 + kApproxFail; break;}
     status = track->fit(kOutsideIn);
     if (status)        {nTSeed++; errType = abs(status)*100 + kFitFail; break;}
     status = extendTrack(track,rMin); // 0 - can't extend. 1 - can extend and refit -1 - can extend and can't refit.
-    if (status != kExtended)                               {nTFail++; errType = abs(status)*100 + kExtendFail; break;}
     if (_trackFilter){
       status = _trackFilter->filter(track);
       if (status) {nTFilt++; errType = abs(status)*100 + kCheckFail; break;}

Fixing Later Releases

  • Identified changes can be reverted in the current code (2018-09-27)
  • The number of global tracks increases as expected

    In fact, per event numbers can be higher than before 2016-06-29

Update October 10 (26), 2018

Summary

  • Consider effect of reverting the changes in approx(). See previous slides for details
  • Run 14. Observe annoying inconsistency in the global track counts:
    • Number of "good" globals as reported in log files increases!
    • MuEvent.mEventSummary.mNumberOfGoodTracks decreases!
  • Run 18
    • Number of "good" globals as reported in log files about the same (?)
    • MuEvent.mEventSummary.mNumberOfGoodTracks decreases!
    • 560 $\to$ 520 averge number of tracks per event
  • In the following:
    Red: Baseline code as of 10/15/18
    Blue: With reverted changes related to approx()
    Magenta: Ratio of Blue/Red:

Run 14, Real Data

  • We compare STAR code as of 2018-10-15 ("baseline") and its patched version with reverted changes related to approx() function ("~approx()")

Run 14 Data, "baseline" vs "~approx()"

Run 14 Data, "baseline" vs "~approx()"

Run 14 Data, "baseline" vs "~approx()"

Run 14 Data, "baseline" vs "~approx()"

Run 14, Real Data

  • We compare STAR code as of 2018-10-15 ("baseline") and ds-jc-fix-victor-2

Run 14 Data, "baseline" vs "~approx()"

Run 14 Data, "baseline" vs "~approx()"

Run 14 Data, "baseline" vs "~approx()"

Run 14 Data, "baseline" vs "~approx()"

Run 18 Data, Code "baseline" vs "~approx()"

Run 18 Data, Code "baseline" vs "~approx()"

Run 18 Data, Code "baseline" vs "~approx()"

Run 18 Data, Code "baseline" vs "~approx()"