Skip to content

gemc/clas12Tags

Repository files navigation

The clas12Tags repository

The clas12Tags repository maintains a version of gemc dedicated to the JLab CLAS12 experiments, with the CLAS12 detector geometry and gcards for the various experiment configurations.

It is tagged more frequently than the main gemc repository - as needed by CLAS12 experiments.

The tags distributed as tarball and maintained as modules are tested. Some versions may be deleted because they contain bugs or inaccuracies. The release notes for those versions are accumulated in the releases notes for each distributed tag.

Alt CLAS12

The CLAS12 detector in the simulation. The electron beam is going from left to right.

Clas12Tags versions installed at JLab on /site and on CVMFS:



To load gemc through the clas12 environment at JLab:

  • tcsh: source /cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/sw/setup.csh
  • bash, zsh: source /cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/sw/setup.sh

To switch to a different version of gemc use module switch. For example:

module switch gemc/5.10

To run GEMC you can select one of the gcards in the clas12-config installed on cvmfs. For example:

gemc /cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/sw/noarch/clas12-config/dev/gemc/rga-fall2018.gcard -N=nevents -USE_GUI=0 

Alternatively the gcards can be downloaded from https://github.com/JeffersonLab/clas12-config


Portal to Off-site farms CLAS12 Simulations

GEMC simulations can be run on the Open Science Grid (OSG) using the CLAS12 Simulation Submission Portal.




How to get and compile the clas12Tags

Load the environment as described above.

Get the desired tag from here and unpack it (using 5.X as an example):

wget https://github.com/gemc/clas12Tags/archive/refs/tags/5.X.tar.gz
tar -xvf 5.X.tar.gz

Then compile gemc:

cd clas12_tags-5.X/source
scons -jN OPT=1

where N is the number of cores available.


How to make changes to the clas12Tags

clas12Tags is a repo with source code and geometry derived from gemc/source. Modifications should be made to the gemc/source repo by forking it and making a pull request.

Note: gemc uses static function to load specific clas12 code (ugly, fixed in gemc3). In particular the BMT and FMT hit processes have these two functions:

bmtConstants BMT_HitProcess::bmtc = initializeBMTConstants(-1);
fmtConstants FMT_HitProcess::fmtc = initializeFMTConstants(-1);

that should be changed to:

bmtConstants BMT_HitProcess::bmtc = initializeBMTConstants(1);
fmtConstants FMT_HitProcess::fmtc = initializeFMTConstants(1);

to initialize properly BMT and FMT and avoid seg fault when those detectors are used. This is done in the clas12Tags repo.

Changing Configurations

Magnetic Fields

ASCII:

You can scale magnetic fields using the SCALE_FIELD option. To do that copy the gcard somewhere first, then modify it. The gcard can work from any location. Example on how to run at 80% torus field (inbending) and 60% solenoid field:

<option name="SCALE_FIELD" value="TorusSymmetric, -0.8"/>
<option name="SCALE_FIELD" value="clas12-newSolenoid, 0.6"/>

Hydrogen, Deuterium or empty target

By default, the target cell is filled with liquid hydrogen by specifying the "lh2" target variation. To use liquid deuterium instead use the variation "lD2" instead.

To use an empty target instead, use the SWITCH_MATERIALTO option.

<option name="SWITCH_MATERIALTO" value="G4_lH2, G4_Galactic"/>

Event Vertex


While the gcards takes care of the target volumes positions (for example, in rga_spring2019 it is moved upstream by 3cm), it is up to the generators and the LUND files to place the event in the correct location.

The surveyed target positions are listed below:

  • rga_spring2018: -1.94cm
  • rga_fall2018: -3.0cm
  • rgk_fall2018_FTOn: -3.0cm
  • rgk_fall2018_FTOff: -3.0cm
  • rgb_spring2019: -3.0cm
  • rga_spring2019: -3.0cm
  • rgb_fall2019: -3.0cm

Removing a detector or a volume


You can remove/comment out the <detector> tag in the gcard to remove a whole system. To remove individual elements, use the existance tag in the gcard. For example, to remove the forward micromegas:

<detector name="FMT">
    <existence exist="no" />
</detector>


Detector Sources


The CLAS12 detector geometry sources are kept in the detector git repository.

The CLAS12 geometry services are kept in the java geant4 factory git repository.


FTOn, FTOff configurations


The default configuration for the first experiment is with "FTOn" (Figure 1, Left): complete forward tagger is fully operational. The other available configuration is "FTOff" (Figure 1, Right): the Forward Tagger tracker is replaced with shielding, and the tungsten cone is moved upstream.

The simulations in preparation of the first experiment should use the default version FTOn. FTOff will be used only by experts for special studies in preparation for the engineering run.

FT On configuration: Full, OperationalForward Tagger. FT Off configuration: FT Tracker replaced by shielding, Tungsten Cone moved upstream, FT if turned off.

To change configuration from FTOn to FTOff, replace the keywords and variations from:

<detector name="ft" factory="TEXT" variation="FTOn"/>
<detector name="beamline" factory="TEXT" variation="FTOn"/>
<detector name="cadBeamline/" factory="CAD"/>

to:

<detector name="ft" factory="TEXT" variation="FTOff"/>
<detector name="beamline" factory="TEXT" variation="FTOff"/>
<detector name="cadBeamlineFTOFF/" factory="CAD"/>

Feedback

Please use CLAS12 discourse for feedback on anything clas12tags related:

https://clas12.discourse.group