How to add a new detector simulation to GSTAR and the Big Full Chain

Under:

This document is written by Mikhail Kopytine on October 28, 2002.

BBC is used as an example.

  • Add the geometry and materials description: pams/geometry/bbcmgeo/bbcmgeo.g -- new file (work done by Yiqun Wang)
  • Select the appropriate hit type for the detector. For the BBC, it is a calorimetric hit with time-of-flight information; therefore, I use g2t_ctf_hit. pams/sim/g2t/g2t_bbc.F and pams/sim/g2t/g2t_bbc.idl are new files.
  • g2t_volume_id.g needs to be modified. This function returns volume ID defined within the function itself with a separate scheme for every subsystem; response simulation needs to know about the scheme and use it consistently when it makes decisions about volume elements. In GEANT, volume ID is encoded as an array representing the path to the volume, where array positions correspond to the levels of the hierarchical tree of volumes, and the array elements are IDs of the embedding volumes. Typically, a volume ID returned encodes this hierarchical information within a single integer number where different decimal places correspond to the levels of the tree. For example, here is the addition to the previous version needed to get the BBC code to work.
  • Now we get to the BFC code: St_geant_Maker.cxx needs to be modified to read the hits from the new subsystem. Here are the changes introduced to make this happen. BBCH stands for BBC hit according to the convention; BPOL is the name of the sensitive element as described in pams/geometry/bbcmgeo/bbcmgeo.g . Notice that g2t/St_g2t_bbc_Module.h is a wrapper generated by the infrastructure (based on g2t_bbc.F and g2t_bbc.idl), but one needs to include it in St_geant_Maker.cxx.
  • Finally, StBbcSimulationMaker is a particular StMaker to simulate BBC response. It needs to conform to the standards from classes derived from StMaker. These standards are described by Victor Perevoztchikov. To store the GSTAR hits, it uses the St_g2t_ctf_hit class which is our chosen class (table) for the BBC hit. It existed before.