c-dilks / clas12Tags

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

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, point the environment variable SIM_HOME:

  • At JLAB: /group/clas12/packages/
  • On CVMFS: /cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/soft

Then:

source $SIM_HOME/setup.csh
module load clas12

The above will load gemc/4.4.2 by default. To load tag 5.3, in addition to the above, use module switch:

module switch gemc/5.3

To run GEMC you can select one of the gcards in $GEMC/../config. For example:

gemc $GEMC/../config/rga-fall2018.gcard -N=nevents -USE_GUI=0 

The configurations in the gcards are detailed here.

The gcards filenames containting _binaryField refers to setups using the cmag binary field maps.

Release notes for tags not installed at JLab or on CVMFS:

Release notes for previous versions, not installed at JLab or on CVMFS:

4.3.2 4.3.1 4.3.0 4a.2.4
4a.2.3 4a.2.2 4a.2.1 4a.2.0
4a.1.0 4a.0.2 4a.0.1 4a.0.0
3a.1.0 3a.1.0 3a.0.2 3a.0.1
3a.0.0


Upcoming developments:

  • Upgrade geant4 to 10.7.p03 🔜
  • RF Frequency > RF Period (+fix), read from DB
  • Geometry / Run Number
  • gcards reorganized to new repository
  • RICH digitization (Connor Pecar)


Portal to Off-site farms CLAS12 Simulations

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



Docker

The clas12Tags are installed on CVMFS. Provided you can mount cvmfs, you can use the jeffersonlab/clas12software:cvmfs docker image to run gemc.

For example:

docker run -it --rm -v /cvmfs:/cvmfs  jeffersonlab/clas12software:cvmfs  bash

To run it interactively using noVNC:

docker run -it --rm -v /cvmfs:/cvmfs -p 8080:8080 jeffersonlab/clas12software:cvmfs  bash

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



About


Languages

Language:C 69.6%Language:C++ 28.4%Language:Perl 0.5%Language:Python 0.5%Language:CMake 0.5%Language:HTML 0.3%Language:Shell 0.2%