Difference between revisions of "HOWTO use hdgeant4 as a beam Monte Carlo generator"

From GlueXWiki
Jump to: navigation, search
(Monte Carlo beam generation in hdgeant4)
(GENBEAM 'postconv')
Line 81: Line 81:
 
describes a triplet conversion that takes place inside the TPOL converter. The first electron listed is the forward-going one of the pair, while the
 
describes a triplet conversion that takes place inside the TPOL converter. The first electron listed is the forward-going one of the pair, while the
 
second is the recoiling atomic electron from the triplet process. In the case of a coherent pair production event, the second electron <product>
 
second is the recoiling atomic electron from the triplet process. In the case of a coherent pair production event, the second electron <product>
tag is omitted from the second <vertex>.
+
tag is omitted from the second <vertex>. The weight parameter in the <reaction> tag for GENBEAM 'postconv' simulations is always set to zero
 +
and can be ignored; these events are already weighted by the differential cross section at the generation stage, and do not need to be assigned
 +
different weights at simulation time. Instructions for how to use the GENBEAM 'postconv' option to estimate the trigger efficiency and analyzing
 +
power of the TPOL are given in [[
 +
 
 
<pre>
 
<pre>
 
</pre>
 
</pre>

Revision as of 22:27, 21 May 2021

Internal beam generator in hdgeant

In HOWTO to generate electromagnetic background the use of the BEAM card in control.in to activate the built-in coherent photon beam generator was described. One use case for this internal beam generator is to model beam-related scattering background that overlays the signals from hadronic reactions produced by the beam interacting in the GlueX target. Now that we have large samples of random and PS triggers to provide a more accurate representation of these backgrounds, that functionality is no longer widely used for physics simulations. However, there are other use cases for the built-in coherent beam generator that remain relevant, including the following.

  1. simulation of the PS acceptance
  2. simulation of the beam transverse intensity and polarization profile
  3. simulation of the TPOL trigger, acceptance, and analyzing power
  4. simulation of Compton and Bethe Heitler reactions in the GlueX target
  5. any other process whose acceptance might be sensitive to the transverse beam position and momentum profile

In order to support the full range of possible applications listed above, I decided to introduce a new feature to control.in, in addition to the BEAM card. This new feature is enabled by the GENBEAM card. When the GENBEAM feature is active, hdgeant switches from functioning primarily as a particle track simulator that follows particles and induces interactions as they traverse the setup geometry to a Monte Carlo generator that generates output records consisting not of detector hits, but either a single beam particle or an interaction vertex with final state positions and momenta to be simulated later. In this way, GENBEAM transforms hdgeant from a simulation to an event generator, with the one proviso that the results of the generator are dependent in a significant way on the beamline geometry and the specific beam properties from the conditions database for the run number specified in the control.in file.

GENBEAM 'precol'

This is the simplest GENBEAM option. All photons above the minimum energy specified in the BEAM card are included in the output, with one photon per event. There are no detector hits in the output hddm file. The only content in the output events is the <reaction> tag, as illustrated in the example below.

    <reaction type="0" weight="0">
      <beam type="Photon">
        <momentum E="8.8443" px="-2.36241e-05" py="-0.000160787" pz="8.8443" />
        <polarization Px="2.98534e-17" Py="0.487544" Pz="8.86341e-06" />
      </beam>
      <vertex>
        <product decayVertex="0" id="1" mech="0" parentid="0" pdgtype="11" type="Electron">
          <momentum E="12.0003" px="-0.000104861" py="2.44356e-05" pz="12.0003" />
        </product>
        <origin t="-78.2157" vx="0.0370969" vy="0.0463277" vz="-2400" />
      </vertex>
      <random seed1="691877422" seed2="281623319" seed3="709975947" seed4="912931183" />
    </reaction>

The meaning of this reaction tag is as follows. The leading <beam> tag tells the energy, momentum, and polarization of the beam photon that was generated for this event. The <vertex> tag following that gives the 4-momentum of the radiating electron that produced the photon, together with projection of the electron momentum vector forward onto the reference plane at z=-24m, just upstream of the entrance to the primary collimator. The impact position of the beam photon on the reference plane is not given explicitly, but it can be computed by linearly propagating the electron ray from the reference plane back to the radiator at z=-100m, and then forward again along the photon momentum direction. The random seeds in <random> are saved so the event can be generated again by replay.

GENBEAM 'postcol'

This is the same as the 'precol' GENBEAM option, except that only beam photons above the minimum energy specified in the BEAM card that make it all the way through the beam collimation system to a second reference plane at z=-18m are included in the output. The event count specified in the TRIG card is the total number of radiated photons, so to get 1000 events in the output file with GENBEAM 'postcol', the control.in file might need to have TRIG 4000. As with GENBEAM 'precol', there are no detector hits in the output hddm file, the only content in the output events is the <reaction> tag. The content and meaning of the <reaction> tag is the same for GENBEAM 'precol' and GENBEAM 'postcol', the only difference is that 'precol' includes all photons produced at the radiator in the output file, while 'postcol' only includes those that make it through the secondary collimator without being absorbed or scattering.

Monte Carlo beam generation in hdgeant4

The hdgeant4 simulation supports the 'precol' and 'postcol' GENBEAM options in control.in the same as hdgeant, but in addition it also provides two other GENBEAM options, 'postconv' and 'BHgen'. When 'postconv' is active, the built-in photon beam generator configured according to the standard BEAM options is used to generate coherent bremsstrahlung photons, which are propagated down the beamline through the collimators to the position of the TPOL converter. All photons that stop before reaching the TPOL converter are dropped from the output record, but those that reach the converter are forced to undergo conversion at a random depth within the converter target.

GENBEAM 'postconv'

The QED differential cross section with full polarization dependence is applied in the Monte Carlo simulation of this process, which takes place either coherently from an atom in the converter (coherent pair production) or else incoherently from a single electron (triplet production). An example of the latter is shown in the following output event produced by hdgeant4 with GENBEAM 'postconv' activated in the control.in file.

    <reaction type="0" weight="0">
      <beam type="Photon">
        <momentum E="10.835" px="-0.000177278" py="-5.44413e-05" pz="10.835" />
        <polarization Px="0.0011168" Py="0.00412377" Pz="3.89926e-08" />
      </beam>
      <vertex>
        <product decayVertex="0" id="1" mech="0" parentid="0" pdgtype="11" type="Electron">
          <momentum E="11.9997" px="-0.000117054" py="1.90218e-05" pz="11.9997" />
        </product>
        <origin t="-74.2076" vx="0.137271" vy="0.039639" vz="-2400" />
      </vertex>
      <vertex>
        <product decayVertex="1" id="2" mech="1447972675" parentid="1" pdgtype="-11" type="Positron">
          <momentum E="4.13102" px="0.00145518" py="0.000154387" pz="4.13102" />
        </product>
        <product decayVertex="1" id="3" mech="1447972675" parentid="1" pdgtype="11" type="Electron">
          <momentum E="6.70397" px="-0.00179934" py="-0.000355582" pz="6.70397" />
        </product>
        <product decayVertex="1" id="4" mech="1447972675" parentid="1" pdgtype="11" type="Electron">
          <momentum E="0.000559377" px="0.000166887" py="0.000146754" pz="4.89378e-05" />
        </product>
        <origin t="-44.7902" vx="0.0726302" vy="-0.0150264" vz="-1518.09" />
      </vertex>
      <random seed1="1955466792" seed2="75289136" seed3="709975949" seed4="912931185" />
    </reaction>

The leading <beam> photon and radiator <vertex> elements are the same as described above under GENBEAM 'precol'. The second <vertex> element describes a triplet conversion that takes place inside the TPOL converter. The first electron listed is the forward-going one of the pair, while the second is the recoiling atomic electron from the triplet process. In the case of a coherent pair production event, the second electron <product> tag is omitted from the second <vertex>. The weight parameter in the <reaction> tag for GENBEAM 'postconv' simulations is always set to zero and can be ignored; these events are already weighted by the differential cross section at the generation stage, and do not need to be assigned different weights at simulation time. Instructions for how to use the GENBEAM 'postconv' option to estimate the trigger efficiency and analyzing power of the TPOL are given in [[