Mistake in Endcap simulation (ecalgeo.g) causing iron to be inserted in air gaps!!

******************

Note added Aug.13

Further study showed that there is a bug in the code of ecalgeo.g (or at a higher level) that causes [Ecal_] Air to be created and to have the properties of Iron. We can stop it from happening with a simple code change, but do not know why. A software bug report is in the process of being submited.

*********************************************************************

 

 

In ecalgeo.g there are two separate variables defining the properties of air. One is called Air and the other is called CAir. Checking the Star database I found that CAir seems to be defined correctly, but Air is defined with the properties of Iron.

 The mistake appears in /afs/rhic.bnl.gov/star/packages/DEV/StarDb/VmcGeometry/y2005.h. This is probably an old mistake that has been propagated for years. Starsim uses this header file to define material properties.

Consequences of error may include changes in shower shape simulation and based on my current studies results in a 20% loss of energy in the towers in the simulations. When Hal received the simulation program it had a 20% fudge factor in it to increase the energy which now appears to not be needed.

The mistake was discovered when I attempted to perform a test of the simulation program by turning the shower max into air. When I did that I lost energy. For an input energy of E=25.8GeV, I had been getting 20.28GeV energy from the towers (using the original sampling fraction of 5%?). After turning the shower max into Air there was only 18.03GeV in the towers! I then turned the shower max into CAir which got me 20.63 GeV and it seemed reasonable to me to get a tiny amount more energy in the towers for shower max made of air.

I then changed Air into CAir in block ESHM and got 20% more energy in the tower. What we think was happening is that the program was putting iron into the air gaps in the shower max. However, there are many places in the program where Air is used instead of CAir so Hal has tried to find all of them, change them and has run new simulations which show a much more linear behaviour. 

 Fig. 1 Reconstructed energy divided by the generated Energy for a single gamma thrown at the endcap using a modified ecalgeo.g with CAir instead of Air. The red and blue points are for eta values of 1.16 and 1.85 respectively.

 

Fig. 2 Reconstruced Energy divided by the generated energy for a single photon thrown at the endcap using the original ecalgeo.g. Different values of eta are plotted.

The mistake is in the variable ECAL_AIR shown below.