StiCA + iTPC mrging

Tue Apr 2
=======
Angle dependency for 15+  tracks




Angle dependency for all tracks





Tue Jun 26 2018
============
Dev updated by iTPC version
Nightly tests showed degradation in number of primaries.
What is the difference between old and new DEV versions.
Old DEV used all possible hits, even from fdead regions;
New DEV used hits only from live regions;

Example y2017:
============
file /star/rcf/test/daq/2017/155/st_physics_18155036_raw_2000012.daq, 50 events.

OLD nHits=102727  n15Prims=230.80 hitsPerTk= 29.445  //All hits used
DEV nHits=102313  n15Prims=230.20 hitsPerTk= 29.389  //Live hits used
DEV nHits=102727  n15Prims=230.60 hitsPerTk= 29.449  //All hits used

There is no big difference.

Now y2010:
=========
file=/star/rcf/test/daq/2010/029/st_physics_11029020_raw_1030002.daq 5events

OLD nHits=286172  n15Prims=453.60 hitsPerTk= 26.007  //All hits used
DEV nHits=274196  n15Prims=345.80 hitsPerTk= 24.761  //Live hits used
DEV nHits=286172  n15Prims=414.20 hitsPerTk= 25.202  //All hits used

So with live hits we have 23% decrease of primaries
Wit all hits used we have 8.6% decrease of primaries

1. Still 8% must be investigated
2. In 2010 dead regions was not properly assigned
3. What version should be used in nightly tests, all hits or live hits?
4. Same in production?









Thu May 31 2018
=============

NO iTPC case, real data, file=/star/rcf/test/daq/2016/135/st_physics_17135012_raw_2000025.daq   100 events


nPrims nHits Tracker Split Percent Comment
 242.12  27.867  StiCA.dev  0    
 240.02  27.837  StiCA.itpc  0  -0.8%  dead padrows
           
 215.02  27.093  Sti.dev  0   88.9%  
 213.22  27.057  Sti.itpc  0  -0.9%  dead padrows
 198.06  27.376  Sti.itpc  1  -7%  Big
 213.94  27.066  Sti.itpc  1   gemini
           
  237.75  28.004  CA.dev  0   98%  
  235.66  27.971  CA.itpc  0  -0.9%  
  218.96  28.276  CA.itpc  1  -7%  Same as Sti
 236.12  27.986  CA.itpc  1    gemini
           


TPC case, simulation, file AuAu200y2018_10_100evts.fzd   100evts


nPrims nHits Tracker split percent Comments
316.53 29.011 Sti.itpc 0    
316.48 29.023 Sti.itpc 1 -0.016% Same
        0         0 StiDEV 0   Crash
           
268.79 30.277 CA.itpc 0    
268.72 30.304 CA.itpc 1 0.03% Same
           
           
           
           
           
           
           
           
           
           
           
           
           
           























Thu May 10 2018
============
What was done?

1. TpcDetectorBuilder:
   a) Splitted & non splitted Tpc geometry controlled by flag from StiMaker and at the end. from StBfChain;
       Also some sectors could be defined as dead;
   b) When number of padrows for z- and z+ are different  the padraw  is automatically splitted;
   c) If some of padrows is dead, it is automatically splitted and according part is not active. It was not possible before;
   d) Z size of padrow is correct now(not twice as bigger). My test shows no influence.
   e) I removed alignment of sectors. Few millimetres of  alignment, comparing centimetres of space charge are senseless.
       Accuracy of fit depends mostly of hits accuracy, not geometry. As expected, result was not changed at all.
2. TpcHitLoader: does not load hits of the dead padrow.  It is especially important for CA 

3. Sti does not test belonging of hit to volume. So if hit really belong to another splitted volume on the same level
   it could be used in fit. I removed the check, which does not allow to use hit not belonging to current detector.

4. Bug in file tpcSectorT0offset.C was fixed

   Some results of the tests are represented as a tables. For the quality of reconstruction were selected two values:
   a) nPrimGood - number of primaries tracks with nHits >=15
   b) nHitsGood - number of hits per tracks    with nHits >=15







Now NO iTPC case, real data, file=/star/rcf/test/daq/2016/135/st_physics_17135012_raw_2000025.daq
=============================================================================

nPrimGood nHitsGood Software Split Comments
219  46.5  StiDev  No  Default Sti from dev
203  43.7  Sti  No  Some padrows dead
203  43.8  Sti  Yes  No big difference
246  51.8  CA&StiDev  No  
243  51.7  CA & Sti  No 1% worse,dead regions
228  48.7  CA & Sti  Yes  6% worse, CA split
         
         


iTPC case, simulation, file AuAu200y2018_10_100evts.fzd


nPrimGood nHitsGood Software Split Comments
324 48.8 Sti No  
324 48.8 Sti Yes No difference
320 53.6 StiCA No Not clear
320 53.6 StiCA Yes Same
315 48.6 Sti No 20 inactive
311 53.6 StiCA No 20 inactive, 1% less
         
         
         






Thu Apr 26
========
Simu iTpc
split = 0
======
nGlob =      33320 <nGlob> =    666.40
nGgoo =      25691 <nGgoo> =    513.82  Ggoo/Gtot=0.771
nPrim =      16511 <nPrim> =       330.22   Ptot/Gtot=0.496
nPgoo =      15915 <nPgoo> =     318.30  Pgoo/Ggoo=0.619

Tpc Hits =   1537112 used    810624(52.74%) perTrack 24.328
Tpc Gits =   1537112 used    734410(47.78%) perTrack 28.586

split=1
======-------------------------------------------------------------------------
nGlob =      33071 <nGlob> =    661.42
nGgoo =      26031 <nGgoo> =    520.62 Ggoo/Gtot=0.787
nPrim =       16703 <nPrim> =      334.06 Ptot/Gtot  =0.505
nPgoo =      16183 <nPgoo> =      323.66 Pgoo/Ggoo=0.622

Tpc Hits =   1537112 used    826472(53.77%) perTrack 24.991
Tpc Gits =   1537112 used    755913(49.18%) perTrack 29.039

All parameters better for split=1 but only 1%  So practically the same.
========================================================
DAQ  /star/rcf/test/daq/2016/135/st_physics_17135012_raw_2000025.daq
Split=0
=====----------------------------------------------------------------------------
nGlob =      48982 <nGlob> =    979.64
nGgoo =      29361 <nGgoo> =  587.22  Ggoo/Gtot=0.599
nPrim =       4815 <nPrim> =       96.30  Ptot/Gtot=0.098
nPgoo =       3692 <nPgoo> =     73.84  Pgoo/Ggoo=0.126

Tpc Hits =   2159142 used    885697(41.02%) perTrack 18.082
Tpc Gits =   2159142 used    692405(32.07%) perTrack 23.582
----------------------------------------------------------------------------
Split=1
======
nGlob =      47392 <nGlob> =    947.84
nGgoo =      29286 <nGgoo> =  585.72  Ggoo/Gtot=0.618
nPrim =       7349 <nPrim> =      146.98  Ptot/Gtot=0.155
nPgoo =       5646 <nPgoo> =    112.92  Pgoo/Ggoo=0.193

Tpc Hits =   2159142 used    881079(40.81%) perTrack 18.591
Tpc Gits =   2159142 used    705513(32.68%) perTrack 24.090



Thu Apr 19
=========

ForeignHit=Off VolumeSize=exact
=========================




ForeignHit=On VolumeSize=exact
=========================


ForeignHit=On VolumeSize=extended





     All these pictures were for all the tracks. Now for tracks iTPC sector


ForeignHit=Off VolumeSize=exact
=========================





ForeignHit=Ofn VolumeSize=exact




ForeignHit=On VolumeSize=extended
=============================









Thu Apr 14
================================
                   StEvent Hits
                  ===========

To speed up iTPC development  I saved hits made by TpcRS into file
Then used event.root file as input. In result I got disaster.

After investigation I found:
1.  .fzd file keeps information about mag field, event.root not
2. In result field becomes zero. Reconstruction is completely wrong

3. Addition option fieldOn helps if field is normal.
4. If field is reverse , option revereseField does not help. Field is still positive.
    Probaly it is the bug in BFChain or very inconvenient feature.

After additional SetAttr("magFacktor",-1)  it is working now
        
                  iTPC and splitted volume problem
                 ==========================
    ...............................................................................................................                   B
    ___________________________________________ ______________________________________
    |__________________________________________| |_____________________________________|
                                        A                               ................................................................................................

   It is case of splitted along Z Tpc volumes. For both ones some hits outside of volumes
  When track is crossing volume A ity does not see hits of volume B. And vice versa.

  In track finder line of code skipping hits from other volume removed. Now tailed hits from B are
  seen in A. And vice versa.

  Case with iTPC sector more complicated.
  ...................................................................................................................
  _____________________________________________
  |____________________________________________|
                               TPC                                   ...............................................................................................................
                                                                                  ____________________________________________
                                                                                 |____________________________________________|
                                                                                                                  iTPC                                                                       

Now TPC and iTPC rows are on different layers. When in TPC layer track missed TPC it messed iTPC as well.
So TPC tailed hits lost. Same, on iTPC layer iTPC tailed hits are lost.

The way to solve is even if track is missing the volume in Z direction to say it is in.


Now this version under the testing







Wed Mar 28 2018
 ================================
Loosing efficiency eta=0 iTPC case
================================
Searching hits and detectors, seed finder etc... in Sti, the part of code not touched by me.
I do know it not well. Now deficiency in ETA=0 evidently related splitting sectors by -ve and +ve Z

After investigation of Sti code I found something new for me:
1. StiHits assigned not to volume/detector but layer angle and layer radius of detector, ignoring Z

2. That means, if we have two detectors with the same layer angle and  radius, and different Z,
    they will  have common hits.
3. So it is possible, looking hit for one detector, got hit from the other one.

4. In Sti code this case is checked and such hit ignored. But for iTpc case it is not evident decision.
   I removed this check.

Here are two distributions with and without this check:
------------------------------------------------------------------








This one without check:
----------------------------





So efficiency is better. Why?
Splited Tpc sectors have the common hits now, which in Z=0 is good. No boundary effects.
But for Tpc & iTpc sectors it is not the case, layers are different.

But in the case of touching Tpc & iTpc sectors the strategy should be more sophisticated.
What was done:
1. When we got hit in some detector we multiplicate it and place these geminies  into neighbouring detectors
2. Sti seed finder was modified to avoid more then one such hit in the track
3. same for track finder
4. What is not clear how it works for CA




=====================================================================
IRAK&DEV iTPC input Sti hits outside node
=====================================================================

In File(s) 0.log
nFiles =1 nEvents = 10 <nEvents>=10
nGlob =       4674 <nGlob>   =    467.40 nGlobMax= 1569
nGgoo =       3881 <nGgoo> =    388.10 nGgooMax= 1281 Ggoo/Gtot=0.830
nPrim =       2534 <nPrim>    =    253.40 nPrimMax=  852 Ptot/Gtot=0.542
nPgoo =       2490 <nPgoo>  =    249.00 nPgooMax=  839 Pgoo/Ggoo=0.642

Tpc Hits =    219862 used    125655(57.15%) perTrack 26.884

Tpc Gits =    219862 used    117757(53.56%) perTrack 30.342
=====================================================================
IRAK&DEV iTPC giveOut is ON
=====================================================================

In File(s) 0.log
nFiles =1 nEvents = 10 <nEvents>=10
nGlob =       5579 <nGlob>   =    557.90 nGlobMax= 1865
nGgoo =       3878 <nGgoo> =    387.80 nGgooMax= 1279 Ggoo/Gtot=0.695
nPrim =       2647 <nPrim>    =    264.70 nPrimMax=  868 Ptot/Gtot=0.474
nPgoo =       2474 <nPgoo>  =    247.40 nPgooMax=  822 Pgoo/Ggoo=0.638

Tpc Hits =    461116 used    129689(28.13%) perTrack 23.246

Tpc Gits =    461116 used    115405(25.03%) perTrack 29.759

=====================================================================




iRAK&Eval  iTPC giveOut==ON insideG==On
=====================================================================

   

Second peek for globals is not understood
But for primaries it desappeared



The last fact what I found is Sti seed finder is working only inside one Sector.


=============================================================================================================
=============================================================================================================
=============================================================================================================



Thu Mar 1 2018
============
In StTpcRtsHitMaker Z(timeBucket) Y2018


In StTpcRtsHitMaker Z(timeBucket) Y2017



Mon Feb 26 2018
=============
Wrong hits. Hits outside of volume;
==========================

  <=12 >12 iTPC InTot
After Geant 0 0 0  
TpcRs        
Before Mover  115   88   7 210
After   Mover  115   88   7 210
 HitLoad  120   85   7 212

Wrong hits >10cm

geant         0.0           N=0
TpcRs
InpMover   24.6 +- 9.1 N=112
OutMover  24.6 +- 9.1 N=112
InpLoader  24.6 +- 9.1 N=112
HitLoader  24.6 +- 9.1 N=112



===============================================================================================================

Tue Feb 13 2018
=============
Merging done, 30 directories 70 files
Problem with geometry of iTPC not solved yet.
Small test, provided by Irakli gives assert, hit is outside of detector.
It is in  average 125 cases per event.
Always the hit in other side of membrane
It is outside from 10 to 40 cm

After switching off the assert I run 11 events.






=========================================================================================================
 Irakli provides directory where everything related Sti iTPC is placed
  /gpfs01/star/pwg/iraklic/iTPC/CleanSlate

Questions & problems
=================
  1.  Do I need CleanSlate/StarVMC/Rotations? I did not find where they are used?
  2.  Do I need StTrsMaker? It is not used any more
  3.  I do not see TPCCATracker. Is it really not modified? Geometry of iTPC is very different.
  4. There is a lot of changes in Sti related to "Alignment" Is it related to iTPC?
  5. In addition in Sti should not be any alignment codes. Sti must use already aligned data.
     It is not responsability of Sti to do alignment
  6. Also we have two parallel approaches to alignments, Yuri and Jason ones. Evident that here we have Yuri's code.
  7. There is a HUGE amount  of modifications in Sti which was already removed long time ago. Not the latest code of Sti was used
      in input. Could we use standard Sti for iTPC. And if not, why?
  8. There is a __NEW_TPCCATracker__ cpp flag. That means that NEW and OLD tracker should have different libraries.
      Support is not easy. QUESTION: if _NEW_TPCCATracker__ is ON, old TPC will work properly?

  9. In StdEdxY2Maker flag __Use_dNdx__ is ON, but official id OFF. For iTPC only  ON or not

10. In StiDetectorBuilder.cxx, removing:

     nameP.ReplaceAll("HALL_1/CAVE_1/","");
     nameP.ReplaceAll("TpcRefSys_1/","");
     nameP.ReplaceAll("IDSM_1/","");
     nameP.ReplaceAll("PXMO_1/","");
     nameP.ReplaceAll("IBMO_1/","");
     nameP.ReplaceAll("TPCE_1/","");

    Does it contradict to our approach?

11. Some asserts in Sti are commented out. In official version the are not crashed.
     Does it mean that in iTPC version it will crash?