Charge trapping using comscw.f routine

Dear Fluka users,

I’m trying to model response function of CdTe detector. To account for charge trapping inside detector I’m using Hecht equation by modifying energy deposition with comscw.f routine. To get the proper response I have to know the exact coordinate of interaction of the particle inside detector which leads to energy deposition. To get the exact coordinate of interaction I use Xtrack(1) value. The result of modelling seems good, but still I have some questions about usage of this value and comscw.f routine:
1). Is it appropriate to use Xtrack(1), Ytrack(1), Ztrack(1) as a coordinates of of the point of interaction of particle which leads to energy deposition?
2). When I use XA, YA, ZA as a coordinates of the point of interaction of particle the program does not account for Hecht equation, the the result of the modelling looks like comscw.f routine doesn’t exist at all. How to use XA, YA, ZA in a proper way, do they describe the point of interaction of the particle inside detector?
3).In case if question (1) is wrong how to get the coordinate of the point of interaction which leads to energy deposition for every particle inside detector including secondary particles?

I put my input file with comscw.f in the attachment. Since the server doesn’t allowed to upload comscw.f with it native extension, I changed it extension to ‘log’.

Thank you in advance,

AlexyCdTe.inp (3.5 KB) comscw.log (5.9 KB)

Hi Alexy,

Indeed, the DETECT card was conceived to score energy deposition (on
an event by event basis and with optional trigger functionality) on a per-region
basis, i.e. regardless of the position. The XA,YA,ZA passed to COMSCW
in this particular case are -infinity (-AINFNT), preventing your logics block
from being active.

Note that in your problem (120-keV photons on CdTe) you’ll have two
contributions to your scored energy deposition:

  • Particles depositing energy along the step (electrons). For these
    contributions you’ll have NTRACK=MTRACK=1 and you can pick up the end
    position of the step from XTRACK(1),YTRACK(1),ZTRACK(1). Since energy
    is deposited continuously along the step, it’s difficult to define or
    agree upon the “point” where deposition happens. What you can do is
    examine the length of the steps with TTRACK(1) or, probably more
    pertinent for you in view of your Hecht law stuff, the difference
    ZTRACK(1)-ZTRACK(0). If you see that ZTRACK(0) does not differ
    appreciably from ZTRACK(1) and your weighting factor is essentially the same
    for either Z, then the “ambiguity” should be irrelevant and you’ll be fine.

  • Particles (electrons AND photons!) dropping below threshold. For these
    two particle species, energy is deposited on the spot, NTRACK=0 and
    one would be tempted to pick up the position from
    XTRACK(0),YTRACK(0),ZTRACK(0)… However, as per the comment in the
    include file, when NTRACK=MTRACK=0, then the position and
    energy are not stored in the TRACKR common. Taking {X,Y,Z}TRACK(0) is
    therefore not guaranteed to provide the actual position. I now fail to
    see an obvious way to bypass this.

    As an alternative way to proceed, you could try intercepting energy
    deposition events within the main entry of mgdraw.f via the DTRACK
    variable and the drop below threshold event in entry ENDRAW in the
    same routine. You could start e.g. by dumping the z coordinate and
    the deposited energy to a file (weighted with your Hecht law) and
    doing the post-processing (build a histogram) a posteriori.