New vtuple Format

     (  When we run standard huge  pass II recdf table to study MC
      generated decay Xc0 -> x-,i+,i+,i- (R=826), we get 17,952 entries
      in mass spectrum as shown   here .
      If I work with short table (about 20 reconstructions) I get 22,568
      events. You will find the histogram below in the text. 
      The discrepancy seems to originate from vtx2_bk overflow.
      In case of real 4 prong vertex we can expect large numbers of 3
      prong and others in several vtx2 directories.
      I think we have to extend vtx2_bk common block.
      )

    The MC comparison of Hyperon decay channel Lambda_c -> Lambda pi+ pi+ pi-
  and Lambda_c ->  p K- pi+ which we already have measured, seems to point
  to a good efficiency to observe it in 10% of our statistics.
    Unfortunately, due to some mistakes in code the data of previous pass 2  
  can not be used to verify this result. We shall check it in a month.
    The GE781 Monte Carlo file
       /usr/e781/data07/work/kuropat/mcdata/lcl0i+i+i-_10783.mc 
  contains 50,0000 events, 10% of (p K- pi) decay, 70-80% of the decay
  into Lambda and 3 pion, both with realistic Xf distribution  and some
  background.
  
     The standard Recon histograms filled in Soap session are shown in
              fig.1 .

  New vtuple format which we (Kolya Kuropatkin and myself) wrote to analyze
  more complicated events than what we collected in pass 1 allows to keep
  almost all important parameters of the reconstruction.
  In pass II vtuples we allow to have a chain of secondary vertices (e.g.
  Xc0 -> x-,i+,i+,i- may have x- -> l0 i- vertex and lambda decay vertex).
  Every secondary vertex has standard parameters: coordinates, errors,
  momentum, mass, status etc. Every track (gamma) has its mama vertex,
  x,y, momentum vector, status and pid info (rich,etrd and photon).
  Similar data for gammas. We have standard part for top reconstruction,
  beam track and primary vertex. Additional blocks may be stored by
  downstream package (dstuple), v0 package for kinks (ktuple) and MC (utuple).
  The dump examples are shown below. The code will be available in next devel
  (this week).
  
  In principle, if we would save all vertex tracks of the event, all real
  photons, all well reconstructed lambdas and Kshort in secondary vertices
  and added 4 words fit_trk or 1 word fit_tseg to be able recalculate track
  errors, we already today would have complete and compact mini dst.

  
  Using GE781 generated input which I saved in utuple and simple MC match
   (window in slopes 5 mrad, 5% in momentum and best chi2) I selected 3
  samples of data.
  
     - complete match in tracking: 3 pion, 2 lambda babies,
        lambda was reconstructed by v0 package
        (resolution and efficiency estimation);
      fig.2 .

     - match for lambda daughters 
      fig.3 . 

     - complete match in tracking for 3 pion inclusively;
        (v0 package contribution to background);
      fig.4 .


  Second test I have done using  GE781 file
         
          /usr/e781/data01/mcdata/Xc0gt02_10783.mc  

  to analyze about 20000 decays Xc0 -> x- i+ i+ i- in kink and 3 vertex
  topology (charm, cascade and lambda vertices). These 2 topologies are
  processed by recon_sv using recdf entry
  
    id  name      from pr q  pid        ls_min ls_max mass_min mass_max   out 
   826 xc0_x-3pi    sv 4  0  i+i+i-x-     0.5    800. 2.270       2.670 $117004
  
  Soap histograms are shown    fig.5 .
 
  Separated entries in vtuple analyses are shown

      fig.6 .

  Only events where 3 pion were detected in vertex detector were selected.
  
  If we demand MC match for those 3 pion we get much more clear sample
  
  as shown in   fig.7 .
  
  Using MC match in pass II vtuple one can easily tune the cuts for
  any interesting reconstruction.



           ...................................................

                        Dump examples

           ...................................................


Run/ev 10783       820 stream 0 record   9 Recn 859 index 010009 Len 173
-------------------------------------------------------------------------------
 nprimvert  nbeamtracks nsecvert nverttrk nsvkinks  nds  ngammarecon nuser
     1           1         2        3        0       0        2        8

  pr   q  tgt   L      sigma   L/sigma  pvtx   chi2  ndof chi2(+1)  chi2(-1)
   1   1   9  0.0462  0.0470    0.98    0.00   0.00    1    0.00     0.00

 beam stat    x0      y0       px       py      pz        pid       chi2 ndof
 -1      1  0.0708  0.2438    0.243    0.215  641.354  100900020    0.43   1

 primary   chi2  ndof nt    x        y        z       sx/dca  sy/unco    sz
 by vtx2   1.86   7    9   0.0699   0.2433  -1.6073   0.0003   0.0003   0.0262
 by recn   0.01   1    1   0.0351   0.1216  -1.8026   0.0002   0.6948   1.0039

Secondary vertices Table:
No    id   status    x        y         z        sx       sy       sz      chi2
 1 00859        0   0.0700   0.2436   -1.5609   0.0010   0.0010   0.0403   0.26
 2 04800 11005385   0.2280   0.4751  498.1709   0.2421   0.1743 170.4573   0.02

Secondary vertices Mass Table:
No  q     px       py       pz     Mass  dMass   theta    dca     unco   uchi pr
 1  1   -0.286    0.347  336.976  2.276  0.004   0.000  0.0000   0.000   0.00  1
 2  0    0.141    0.219  281.028  1.110  0.006   0.000  0.2102   0.000   0.00  2

Track Table:
No Id definition status mama Z0   x0      y0      px      py     pz    chi2  nd
 1  5 i- v0   ..  520C  0002 s2  0.0575  0.3271  0.105  0.039  55.084  0.70  21
 2  7 p+ v0   ..  520C  0002 s2  0.0020  0.1244  0.036  0.180 225.944  0.72  15
 3  8 i+      vx   10E  0001 z0  0.0337  0.2584 -0.347  0.139  14.901  9.74  18

Track partID Table:
No Id def pht etr w(e) ric e  m  i  k  p  s  x  o   miss distance
 1  5 i-   8   0   0    4 30 40 40 90  0  0  0  0  0.0000  0.0000
 2  7 p+  -1   0   0    5 20 20 20 40 90 10  0  0  0.0000  0.0000
 3  8 i+  -1   0   0   -1  0  0  0  0  0  0  0  0  0.0000  0.0000

Gamma Table;  12 adcgam in soap   2 in this Table
No  ig Det stat type dime blk mama   x0       y0      px      py     pz    chi2
 1   7  2    6    0    5   0    1 -33.5883  18.7939 -0.041  0.023   4.409  4.33
 2  11  3    7    1    8   0    1  -4.9138  -4.5939 -0.036 -0.035  35.952  3.53

Dump utuple run/ev 10783       820 recn 859
-------------------------------------------------------------------------------
 1      41    0.000    0.0678   -1.391    0.2444    0.601     -1.608    334.161
 2  131308   10.843    0.0672  -22.543    0.2446    8.610     -0.029     15.205
 3       7    0.000    0.0677   -4.920    0.2443   -1.581     -0.029     45.166
 4      18    0.770    0.0678    0.359    0.2444    0.511     -0.029    273.793
 5  360714    0.018    0.2567   -0.023    0.3562    0.466    506.126    217.976
 6  360509    1.261   -0.3337    1.850    0.2862    0.688    506.126     55.816
 7       1    0.000    0.0677   -4.182    0.2444   -1.279     -0.029     42.161
 8       1    0.000    0.0674  -15.279    0.2442   -5.828     -0.029      3.005

 run/ev 10783       822      recn_sel_id   859 IRET    44 found recn     0
 MC lam    18    -6.0644  13.74 baby    14   437.6246  11.81

Run/ev 10783       822 stream 0 record   9 Recn   0 index 000000 Len  78
-------------------------------------------------------------------------------
 nprimvert  nbeamtracks nsecvert nverttrk nsvkinks  nds  ngammarecon nuser
     0           0         0        0        0       0        0        8

Dump utuple run/ev 10783       822 not reconstructed
-------------------------------------------------------------------------------
 1      41    0.000   -0.1244   24.557    0.1882   -6.707     -6.172     48.255
 2  331108   27.928   -0.1274   24.062    0.1489  -13.197     -6.064     31.863
 3       7    0.000   -0.3904  -19.298    0.2696    6.716     -6.064      2.659
 4      18    0.440   -0.0662   34.161    0.2616    5.396     -6.064     13.736
 5      14    0.000    7.2810   30.818   -0.6109   13.110    437.625     11.814
 6       9    0.000    1.3862   54.714   12.9910  -42.028    437.625      1.925
 7       1    0.000   -0.7645  -80.990    3.1081  474.769     -6.064      0.036
 8       1    0.000   -0.3858  -18.545    0.2350    1.001     -6.064      2.627
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
                 
                 
                   Lambda_c => proton K- pion

Run/ev 10783       125 stream 0 record   2 Recn 400 ind013002 Len 109
-------------------------------------------------------------------------------
 nprimvert  nbeamtracks nsecvert nverttrk nsvkinks  nds  ngammarecon nuser
     1           1         1        3        0       0        0        4

  pr   q  tgt   L      sigma   L/sigma  pvtx   chi2  ndof chi2(+1)  chi2(-1)
   3   1   9  0.3289  0.0486    6.77    2.23   0.06    1    0.00     0.00

 beam stat    x0      y0       px       py      pz        pid       chi2 ndof
 -1      1 -0.0307 -0.5214    0.162   -0.222  636.092  100900020    1.58   1

 primary   chi2  ndof nt    x        y        z       sx/dca  sy/unco    sz
 by vtx2   1.59   5    8  -0.0310  -0.5216  -1.6232   0.0003   0.0003   0.0307
 by recn   1.01   1    1  -0.0149  -0.2608  -1.8627   0.0014   2.4908   0.8538

Secondary vertices Table:
No    id   status    x        y         z        sx       sy       sz      chi2
 1 00400        0  -0.0300  -0.5223   -1.2911   0.0004   0.0004   0.0399   1.72

Secondary vertices second Table:
No  q     px       py       pz     Mass  dMass   theta    dca     unco   uchi pr
 1  1   -0.036   -0.330  169.780  2.275  0.005   0.000  0.0000   0.000   0.00  3

Track Table:
No Id definition status mama Z0   x0      y0      px      py     pz    chi2  nd
 1  2 p-      vx   10E  0001 z0 -0.0409 -0.5210 -0.498  0.018  58.170  1.11  40
 2  3 p+      vx   10E  0001 z0 -0.0231 -0.5226  0.511  0.032  96.274  0.94  38
 3  8 i+      vx   106  0001 z0 -0.0349 -0.5545 -0.049 -0.380  15.336  3.59  26

Track partID Table:
No Id def pht etr w(e) ric e  m  i  k  p  s  x  o   miss distance
 1  2 p-   8   0   0    4  0  0  0 90  0  0  0  0  0.0000  0.0000
 2  3 p+   8   3  25    5  0  0  0  0 90  0  0  0  0.0000  0.0000
 3  8 i+   8  -1   0   -1  0  0  0  0  0  0  0  0  0.0000  0.0000

Gamma Table;   0 adcgam in soap   0 in this Table
No  ig Det stat type dime blk mama   x0       y0      px      py     pz    chi2

utuple Table:
 1     400    0.267   -0.0307   -0.229   -0.5214   -1.992     -1.586    170.223
 2       3   12.502   -0.0237    5.337   -0.5215    0.332     -1.319     95.753
 3       2   24.199   -0.0419   -8.484   -0.5215    0.344     -1.319     58.807
 4       8    3.861   -0.0349   -3.137   -0.5547  -24.795     -1.319     15.670

-------------------------------------------------------------------------------
-------------------------------------------------------------------------------


                   Lambda_c => Lambda 3 pions

Run/ev 10783        15 stream 0 record  14 Recn 866 ind 021016 Length 185
-------------------------------------------------------------------------------
 nprimvert  nbeamtracks nsecvert nverttrk nsvkinks  nds  ngammarecon nuser
     1           1         2        5        0       0        0        9

  pr   q  tgt   L      sigma   L/sigma  pvtx   chi2  ndof chi2(+1)  chi2(-1)
   3   1   6  0.1474  0.0709    2.08    0.07   2.25    1    0.00     0.00

 beam stat    x0      y0       px       py      pz        pid       chi2 ndof
 -1      1  0.0234  0.5976    0.191    0.447  635.414  100900020    0.06   1

 primary   chi2  ndof nt    x        y        z       sx/dca  sy/unco    sz
 by vtx2   1.23   8   11   0.0218   0.5931  -6.0242   0.0003   0.0003   0.0523
 by recn   0.16   1    1   0.0107   0.2950  -6.0600   0.0008   6.7588   0.2151

Secondary vertices Table:
No    id   status    x        y         z        sx       sy       sz      chi2
 1 14866        0   0.0231   0.5924   -5.9356   0.0020   0.0015   0.0618   0.48
 2 03800 11080905   0.5012   0.3480   87.3599   0.1600   0.2410  17.5717   1.10

Secondary vertices second Table:
No  q     px       py       pz     Mass  dMass   theta    dca     unco   uchi pr
 1  1    0.975   -0.058   78.855  2.295  0.000   0.000  0.0000   0.000   0.00  3
 2  0    0.198   -0.014   39.121  1.120  0.006   0.000  0.5459   0.000   0.00  2

Track Table:
No Id definition status mama Z0   x0      y0      px      py     pz    chi2  nd
 1  5 p+ v0   Nv  520C  0002 s2  0.7501 -0.0152  0.863 -0.073  31.608  0.68  21
 2  7 i+      vx   106  0001 z0  0.3062  0.6221  0.685  0.070  14.343  2.27  26
 3  9 i+      vx   106  0001 z0  0.1053  0.5276  0.231 -0.189  16.926  0.50  27
 4 10 i-      vx   106  0001 z0 -0.0764  0.6429 -0.139  0.075   8.465  1.43  26
 5 13 i- v0   Nv  5204  0002 s2  0.3676  0.3743 -0.676  0.092   7.513  5.35   1

Track partID Table:
No Id def pht etr w(e) ric e  m  i  k  p  s  x  o   miss distance
 1  5 p+  -1   2   7   -1  0  0  0  0  0  0  0  0  0.0000  0.0000
 2  7 i+   8  -1   0   -1  0  0  0  0  0  0  0  0  0.0000  0.0000
 3  9 i+  -1  -1   0   -1  0  0  0  0  0  0  0  0  0.0000  0.0000
 4 10 i-  -1  -1   0   -1  0  0  0  0  0  0  0  0  0.0000  0.0000
 5 13 i-   8  -1   0   -1  0  0  0  0  0  0  0  0  0.0000  0.0000

Gamma Table;   0 adcgam in soap   0 in this Table
No  ig Det stat type dime blk mama   x0       y0      px      py     pz    chi2

utuple Table: run/ev 10783        15 recn ID866
No      id  dZ(Chi2)    x         tx       y         ty         Zo         P
 1     866    0.186    0.0219   12.430    0.5927   -0.792     -6.183     80.512
 2       7  168.104    0.3067   47.276    0.6199    4.558     -5.952     14.427
 3       9  174.509    0.1057   13.576    0.5290  -10.595     -5.998     16.918
 4      10   63.232   -0.0756  -16.967    0.6435    8.512     -5.952      8.487
 5     432   37.259    0.0243    5.687    0.5925   -0.703     -5.998     40.694
 6       0   -1.000    0.0683    5.367    0.6751   -3.481     31.262     32.951
 7       0   -1.000    0.0161    7.049    0.2188   11.117     31.262      7.743
 8       5    5.784    1.0341   27.737    0.0104   -3.420     31.262     32.951
 9      13   30.925    1.6132  -88.148    2.3421   10.860     31.262      7.743
-------------------------------------------------------------------------------
 sel_status  1 lam_origin  3 higs  0 chi2_match  403.8
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------




                  Xc0 => x-, 3 pions (3 secondary vertizes)


Run/ev 10783      1025 stream 0 record   8 Recn 826 index 013008 Len 231
-------------------------------------------------------------------------------
 nprimvert  nbeamtracks nsecvert nverttrk nsvkinks  nds  ngammarecon nuser
     1           1         3        8        0       0        0        9

  pr   q  tgt   L      sigma   L/sigma  pvtx   chi2  ndof chi2(+1)  chi2(-1)
   4   0  10  1.2997  0.0698   18.62    2.94   1.84    1    0.00     0.00

 beam stat    x0      y0       px       py      pz        pid       chi2 ndof
 -1      1  0.0881  0.0992    0.108    0.123  607.434  100900020    4.53   1

 primary   chi2  ndof nt    x        y        z       sx/dca  sy/unco    sz
 by vtx2   0.96   6   10   0.0878   0.0997  -0.0205   0.0003   0.0003   0.0143
 by recn   0.22   1    1   0.0440   0.0493   0.3027   0.0007   0.6757   1.0275

Secondary vertices Table:
No    id   status    x        y         z        sx       sy       sz      chi2
 1 20826        0   0.0894   0.0984    1.2750   0.0002   0.0002   0.0684   1.78
 2 07000 28010645   0.1112   0.1099   43.3678   0.1907   0.9213 198.1560   0.04
 3 04000 11004385   0.4551   0.0509  439.8680   0.2221   0.2932 108.9783   0.01

Secondary vertices Mass Table:
No  q     px       py       pz     Mass  dMass   theta    dca     unco   uchi pr
 1  0    0.755   -0.141  512.976  2.471  0.000   0.000  0.0000   0.000   0.00  4
 2 -1    0.281    0.129  242.903  1.322  0.010   0.000  0.0000   0.000   0.00  1
 3  0    0.252   -0.028  208.631  1.116  0.006   0.000  0.1365   0.000   0.00  2

Track Table:
No Id definition status mama Z0   x0      y0      px      py     pz    chi2  nd
 1  2 i-      vx   10E  0001 z0  0.0951  0.1059 -0.150 -0.229  39.622  1.17  45
 2  3 i- v0   ..  520C  0002 s2  0.0978  0.1850 -0.705  0.147  34.272  0.95  26
 3  4 i- v0   ..  520C  0003 s3  0.1132  0.1100  0.006 -0.097  35.517  0.72  21
 4  5 p+ v0   ..  520C  0003 s3 -0.0232  0.1047  0.246  0.069 173.114  0.67  15
 5  6 i+      vx   10E  0001 z0  0.0876  0.0993  0.166 -0.120 121.181  0.90  45
 6  7 i+      vx   10E  0001 z0  0.0838  0.0980  0.521  0.056 109.269  0.74  41
 7 13 x- v0   vx  1102  0021 z0  0.0874  0.0977  0.219  0.152 242.903  0.53  13

Track partID Table:
No Id def pht etr w(e) ric e  m  i  k  p  s  x  o   miss distance
 1  2 i-  -1   1   0    3 50 60 90  0  0  0  0  0  0.0000  0.0000
 2  3 i-  -1   2   0    2 80 90 40  0  0  0  0  0  0.0000  0.0000
 3  4 i-  -1   0   0    1 90  0  0  0  0  0  0  0  0.0000  0.0000
 4  5 p+  -1   1   0    6  0  0  0  0  0 90 10  0  0.0000  0.0000
 5  6 i+   8   1   0    4  0  0  0 90  0  0  0  0  0.0000  0.0000
 6  7 i+  -1   1   0    3 70 90 90 50  0  0  0  0  0.0000  0.0000
 7 13 x-  -1  -1   0   -1  0  0  0  0  0  0  0  0  0.0000  0.0000

Tracks at Decay Vertex
No Id definition status mama Z0   x0      y0      px      py     pz    chi2  nd
 8 13 x- v0   vx  1402  0021 d2  0.1264  0.1247  0.219  0.152 242.903  0.53  13

Dump utuple run/ev 10783      1025 recn 826
-------------------------------------------------------------------------------
 1      64    0.004    0.0873    1.482    0.1003   -0.358     -0.029    505.092
 2  370708    7.697    0.0840    4.784    0.0987    0.481      1.210    108.687
 3  370608   14.368    0.0873    1.383    0.1006   -1.018      0.489    120.557
 4  370209    7.063    0.0944   -3.778    0.1063   -5.833      1.210     39.904
 5   11323   35.454    0.0876    0.901    0.0999    0.519      0.489    235.945
 6      18    1.017    0.0863    0.922    0.1314   -0.167     46.195    201.361
 7  360309    1.055    0.2921  -20.578    0.7810    4.482     46.195     34.582
 8  360514    0.826    0.2168    1.108   -0.0360    0.388    434.802    165.540
 9  360409    0.434    0.4724    0.060    0.7252   -2.733    434.802     35.821



                  Xc0 => x-, 3 pions (kink)

Run/ev 10783      1025 stream 0 record   9 Recn 826 index 013009 Len 173
-------------------------------------------------------------------------------
 nprimvert  nbeamtracks nsecvert nverttrk nsvkinks  nds  ngammarecon nuser
     1           1         1        4        1       0        0        9

  pr   q  tgt   L      sigma   L/sigma  pvtx   chi2  ndof chi2(+1)  chi2(-1)
   4   0  10  1.2997  0.0698   18.62    2.57   1.84    1    0.00     0.00

 beam stat    x0      y0       px       py      pz        pid       chi2 ndof
 -1      1  0.0881  0.0992    0.108    0.123  607.434  100900020    4.53   1

 primary   chi2  ndof nt    x        y        z       sx/dca  sy/unco    sz
 by vtx2   0.96   6   10   0.0878   0.0997  -0.0205   0.0003   0.0003   0.0143
 by recn   0.18   1    1   0.0440   0.0494   0.3349   0.0006   0.6447   0.9765

Secondary vertices Table:
No    id   status    x        y         z        sx       sy       sz      chi2
 1 17826        0   0.0894   0.0984    1.2750   0.0002   0.0002   0.0684   1.78

Secondary vertices Mass Table:
No  q     px       py       pz     Mass  dMass   theta    dca     unco   uchi pr
 1  0    0.719   -0.166  473.072  2.505  0.000   0.000  0.0000   0.000   0.00  4

Track Table:
No Id definition status mama Z0   x0      y0      px      py     pz    chi2  nd
 1  2 i-      vx   10E  0001 z0  0.0951  0.1059 -0.150 -0.229  39.622  1.17  45
 2  6 i+      vx   10E  0001 z0  0.0876  0.0993  0.166 -0.120 121.181  0.90  45
 3  7 i+      vx   10E  0001 z0  0.0838  0.0980  0.521  0.056 109.269  0.74  41
 4 13 x- k1   vx   902  0101 z0  0.0874  0.0977  0.183  0.127 203.000  0.53  13

Track partID Table:
No Id def pht etr w(e) ric e  m  i  k  p  s  x  o   miss distance
 1  2 i-  -1   1   0    3 50 60 90  0  0  0  0  0  0.0000  0.0000
 2  6 i+   8   1   0    4  0  0  0 90  0  0  0  0  0.0000  0.0000
 3  7 i+  -1   1   0    3 70 90 90 50  0  0  0  0  0.0000  0.0000
 4 13 x-  -1  -1   0   -1  0  0  0  0  0  0  0  0  0.0000  0.0000

Dump utuple run/ev 10783      1025 recn 826
-------------------------------------------------------------------------------
 1      64    0.004    0.0873    1.482    0.1003   -0.358     -0.029    505.092
 2  370708    7.697    0.0840    4.784    0.0987    0.481      1.210    108.687
 3  370608   14.368    0.0873    1.383    0.1006   -1.018      0.489    120.557
 4  370209    7.063    0.0944   -3.778    0.1063   -5.833      1.210     39.904
 5   11323   35.454    0.0876    0.901    0.0999    0.519      0.489    235.945
 6      18    1.017    0.0863    0.922    0.1314   -0.167     46.195    201.361
 7  360309    1.055    0.2921  -20.578    0.7810    4.482     46.195     34.582
 8  360514    0.826    0.2168    1.108   -0.0360    0.388    434.802    165.540
 9  360409    0.434    0.4724    0.060    0.7252   -2.733    434.802     35.821

-------------------------------------------------------------------------------
-------------------------------------------------------------------------------

vmatveev@fnal.gov