SMT hits issue
The following plots illustrate the problem. Technical information is also provided.

Pure bbbar hard interaction evts bbbar + ZB evts
bbbar + MC minimum bias evts
Single neutrino evts + ZB


Comments


Bug fix

Apparently, "DetId" (detctor identificator in a packed form) for MC and data are not identical. As a result, hits are corrupt, or lost from the entire "p-side" of SMT when MC and data are merged in "smtdigi". Here are deatils from Alex and Lisa:
In Barrels that have only double-sided ladders (Barrel=2,3,4,5)

in bbbar_only sample:
on the p-side there are 2446 bbbar strips
on the n-side there are 2918 bbbar strips

in bbbar+zb sample:
on the p-side there are      0 bbbar strips
on the n-side there are 3021 bbbar strips
Hello all,
finally I guess I found at least the main source of the problem.

A crucial point required for  smtdigi package to work correctly is that
d0gstar hits entering smtdigi are  sorted in tkHitList in the ascending
order of detector id. This requirement is necessary because smtdigi
collects charge from all hits belonging to one detector element (ladder or
wedge), then goes to the next detector element, collects all charge, etc.
Pileup package does not do any hit ordering. It is done in a simple inline
function which is a part of smtdigi and called compareDetId which accesses
DetIds of two sequencial hits and then the tkHitList is sorted according to
the DetIds. This procedure works correctly for ordering MC hits only and
zerobias hits only which agrees with our observations. The problem shows up
when we try to order a combination of MC and ZB.  The reason is that DetId
are created differently in d0gstar MC and smt_real2mc packages.
Since d0gstar hit knows only about  system, barrel, layer, ladder this is
what we pack as hit DetId. On the other hand, when converting real data hit
into MC format we already know  system, barrel, layer, ladder, view and
strip number. Therefore when we do       detid =
SmtAddress::Encoder(dettype,barrel,layer,ladder,view,Bstrnum);
in smt_real2mc we always have larger encoded number then when we do in
simpp
     detid = SmtAddress::Encoder(dettype,barrel,layer,ladder,1,0);
Therefore for hit from ZB DetId will ALWAYS be larger than for MC hit
belonging to the same barrel,layer,ladder. For example, all true MC hits
belonging to bar 1 lay 3 lad 1 view 1 (view is always 1 for MC hits) have
DetId 321 while ZB hits range from 3662145 to 5112129 depending on the
strip number.

As a consequence, all MC hits enter the list first followed by all ZB hits.
So hits belonging to the same detector element will be in different parts
of the list and will be never merged correctly.

The most straightforward solution would be to change detid in smt_real2mc
from
      detid =
SmtAddress::Encoder(dettype,barrel,layer,ladder,view,Bstrnum);
to
      detid = SmtAddress::Encoder(dettype,barrel,layer,ladder,view,0);
but this will require rerunning zero bias samples.

The less painful solution is to modify compareDetId function. Now it gets
only DetId. Then we can unpack this DetId to exatact barrel, layer, ladder,
view and strip number. If strip number is not zero (it will happen for ZB
hits) do
detid = SmtAddress::Encoder(dettype,barrel,layer,ladder,view,0);
and compare DetId after that modification.
I guess Slava or Alex can fix it. Then it needs to be tested obviously.
Cheers
Lisa

bb+ZB evts. after fix in smtdigi

Back to p17 MC verification web site

Details on the samples, mc_runjob setup , etc.
(is taken from this location: 
/rooms/ksu2/mc_write/raw2sim_out/ D0Raw2Sim_x-p14.09.00-maxopt-Linux-ZB_40E30.szelitch.set1-992566/ d0raw2sim_40E30_zeroB_all_0000193355_mrg_200-238.raw_p14.06.00 )
/work/dulac-clued0/mikeh/minbias/
d0gstar_p14.09.00_NumEv-0_minbias-incl_cdf-cteq5l_algo
_mcp14_lancs_18017_05054034440
/work/cole-clued0/eno/d0raw2sim/head_p17/overlay_output/
job_output/d0gstar/d0gstar_p17.05.01_NumEv-2000_05182152659
/prj_root/1161/sim_write/avto/p17.06.01
This one is just hard scattering event:
/prj_root/1161/sim_write/avto/p17.06.00/run11_3/dest_allcunks/d0sim/
d0sim_p17.06.00_NumEv-0_dzero_clued0_05195113620

and this one is the same hard scattering event but with zero bias overlay:
/prj_root/1161/sim_write/avto/p17.06.00/run21_3/dest_p1706_allchunks/d0sim
d0sim_p17.06.00_NumEv-0_dzero_clued0_05192001250

=====

Comments to avto@fnal.gov