Such digitisation module should have the header and the data handling part similar to a geometry module, but instead of blocks, describing detector geometry, it describes how a specific detector response in each separate element is produced, taken into account multiple hit overlap, noises, thresholds etc.
When a user reads measured quantities from hits, standard GEANT user's facilities, like the transformation from local coordinates to MRS, are automatically available, thus allowing to use significantly more dense hit formats.
To select a hit set to be analyzed, a AgFHIT0(Cset,Cdet) function should be called, where Cset and Cdet are 4-letter names of an STAR system and its sensitive detector. The function returns OK if the selected set contains hits, and the digitisation of this systemwas allowed by control cards, otherwise the digitisation should be abandoned.
After the initialization call is successfully done, the AgSTAR interface is ready to provide sequentially all hits in each detector element by performing the AGFHIT1 (IH, ITRA, NUMBV, HITS) function.
Here the output arguments of the function are :
In this way in the digitization routine the user does not need neither to introduce arrays to accumulate the information from different detector elements in parallel, nor even to know the full number of the detector elements. Moreover, if a user needs to know the space position of a hit, he can simply use the GEANT routine GDTOM to translate a point in the current detector element to the Master Reference System, after the content of the necessary common blocks is restored by the AGFPATH routine.
Below is an example how all hits in the TPC can be read and analized:
Module TPCEDIG is the TPC digitization Author P.Nevski Created on sunday afternoon * integer AgFHIT0,AgFHIT1,i,ih,itra,NumBV(5) real hits(15),Esum * check AgFHIT0('TPCE','TPAD') == ok Do While (AgFHIT1(ih,itra,NumBV,hits) == ok) If (abs(IH)==1) then * we are getting a new padraw Esum=0 CALL AGFPATH(NumBV) endif * Esum=Esum+abs(HITS(11)) * If (IH<=0) then * this is the last hit in the padraw print *,' Padrow number ',(NumBV(i),i=1,3), ' energy sum is ',Esum endif enddo END