Project

General

Profile

artg4tk

Introduction

artg4tk provides a general interface between Geant4 and art. It started with artg4 which was developed by the g-2 experiment. artg4tk is a general framework for generic detector R&D where the detector and physics configurations can easily be changed at run-time by modifying the gdml detector description file and/or the fcl file. As will be described later we extended the Geometry Description Markup Language (GDML). artg4tk makes use of the latest Geant4 developments like the physics list factory and physics constructors. At this moment artg4tk provides a library of predefined sensitive detectors in addition we provide examples gdml files, fcl files as well as analyzer modules that demonstrate how to attach a sensitive detector to a specific logical volumes and a simple analysis that shows how to access and analyze the produced hit collections:

  • CalorimeterSD producing CalorimeterHit collections represents a calorimeter which accumulates the energy deposited in a given calorimeter cell. The analyzer CheckCalorimeterHits_module.cc demonstrates how to access CalorimeterHits.
  • DRCalorimeterSD producing DRCalorimeterHit collections and the ByParticle object. In a dual readout calorimeter both Cerenkov C and scintillation S signal are read out from the same crystal and the C/S ratio is used to correct the scintillation signal. The ByParticle object keeps track of the fractions that various particles contribute to the total energy/Cerenkov deposition. The analyzer CheckDRCalorimeterHits_module.cc demonstrates how to access DRCalorimeterHits as well as the ByParticle collections.
  • HadIntAndEdepTrkSD
  • HadInteractionSD producing myInteractionArtHitData collections
  • PhotonSD producing PhotonHit collections. PhotonSd is a sensitive detector for optical photons. When an optical photon enters a photon detector volume it is killed and its final energy, position and time are registered as a PhotonHit where one optical photon produces one hit.
    The analyzer CheckPhotonHits_module.cc demonstrates how to access PhotonHits.
  • TrackerSD producing TrackerHit collections. The TrackerSD represents a tracking detector. It registers all G4Steps of a particle passing through the corresponding sensitive volume. The step length can be set by volume to assure that the Geant4 step length matches the read out geometry of the detector (e.g. the wire spacing in case of a liquid Ar TPC). The analyzer CheckTrackerHits_module.cc demonstrates how to access PhotonHits.

The examples will contain more information about the sensitive detectors and the corresponding hit collections.
This sensitive detectors are enabled by assigning them to a logical volume in the gdml file.

Defining the physics

As already mentioned in the introduction artg4tk makes use of the latest Geant4 developments like the physics list factory and physics constructors. Of particular interest for a liquid Ar TPC are access to optical physics, the ability to assign step limits to specific volumes and the ability to assign limits (time, energy) for tracking neutrons. It also allows to select a new physics list provided by the user. The physics is defined in artg4tk/pluginActions/physicsList/PhysicsList_service by default we are using the FTFP_BERT reference physics list with the default electromatnice physics and extend it using the OPTICAL, STEPLIMIT and NEUTRONLIMIT physics constructors. Below we list the parameters and the default parameters of the PhysicsList_service. By default we kill neutrons after 10 microseconds. The step limiter is enabled but the actual step limits are properties of logical volumes and therefore the value of the limit will be set in the gdml file as will be described later on. By default optical physics is enabled, the scintillation process is enabled scintillation photons can be counted but are not put on the stack for ray tracing. By enabling the full set of optical processes and providing the relevant optical properties in the gdml file larg4 can be used to do a full simulation of optical processes and trace optical photons until they are either absorbed or hit the sensitive area of a photon detector.

  PhysicsListName_( p.get<std::string>("PhysicsListName","FTFP_BERT")),
  DumpList_( p.get<bool>("DumpList",false)),
  enableNeutronLimit_(p.get<bool>("enableNeutronLimit",true)),  
  NeutronTimeLimit_(p.get<double>("NeutronTimeLimit",10.*microsecond)),
  NeutronKinELimit_(p.get<double>("NeutronKinELimit",0.0)),
  enableStepLimit_(p.get<bool>("enableStepLimit",true)),  
  enableOptical_(p.get<bool>("enableOptical",true)),
  enableCerenkov_( p.get<bool>("enableCerenkov",false)),  
  CerenkovStackPhotons_( p.get<bool>("CerenkovStackPhotons",false)),
  CerenkovMaxNumPhotons_(p.get<int>(" CerenkovMaxNumPhotons",100)),
  CerenkovMaxBetaChange_(p.get<double>("CerenkovMaxBetaChange",10.0)),
  CerenkovTrackSecondariesFirst_( p.get<bool>("CerenkovTrackSecondariesFirst",false)),
  enableScintillation_( p.get<bool>("enableScintillation",true)),
  ScintillationStackPhotons_( p.get<bool>("ScintillationStackPhotons",false)),
  ScintillationByParticleType_( p.get<bool>("ScintillationByParticleType",true)),
  ScintillationTrackInfo_( p.get<bool>("ScintillationTrackInfo",false)),
  ScintillationTrackSecondariesFirst_( p.get<bool>("ScintillationTrackSecondariesFirst",false)),
  enableAbsorption_( p.get<bool>("enableAbsorption",false)),   
  enableRayleigh_( p.get<bool>("enableRayleigh",false)),     
  enableMieHG_( p.get<bool>("enableMieHG",false)),        
  enableBoundary_( p.get<bool>("enableBoundary",false)),
  enableWLS_( p.get<bool>("enableWLS",false)),
  BoundaryInvokeSD_( p.get<bool>("BoundaryInvokeSD",false)),
  verbositylevel_( p.get<int>("Verbosity",0)),
  WLSProfile_( p.get<std::string>("WLSProfile","delta"))

The physics list factory also allows to select a new physics list provided by the user. But how to build your own custom physics list is beyond the scope of this write up.
Note always switch off physics processes that you don't need. For example in case of a liquid Argon TPC when you don't use Geant4 to calculate the number of created scintillation photons and want to do the calculation in the SimDriftElectrons instead make sure that enableScintillation is set to false. The difference for 10000 muons in processing time is quite significant:

with enableScintillation true, no stacking we get the following timing results :
real 1m10.736s
user 0m26.227s
sys 0m2.959s

with enableScintillation false we get:
real 0m45.669s
user 0m22.305s
sys 0m1.911s

GDML

Introduction and Extensions

We use the Geometry Description Markup Language (GDML):
  • to define geometry, material properties, optical properties etc.
  • we make use of formulae and loops to keep the gdml file compact and human readable
  • to assign optical surfaces
We use two ways of extending gdml:
  1. making use of the gdml <auxiliary> tag:
    • to assign sensitive detectors of predefined type to logical volumes. This will automatically trigger the creation and filling of the appropriate hit collections that are then written out in the art event stream. The combination of the logical volume name and the copy number assigned when placing a copy of the logical volume provides a unique ID that can be used for channel mapping.
    • to assign electric fields.
    • to assign step limits to specific volumes. This is e.g. important to match the Geant4 step length to the readout pitch of a liquid Ar TPC.
  2. extending the xml schema:
    • Visualization attributes (color and visibility).

Building and running artg4tk

In the following we show how to build and run and larg4 example. In this example we just run the Geant4 simulation and a module which analyzes the SimEnergyDeposit in the event. Later on drift of electrons and photon lookup will be added to arrive at a more complete example.

source /grid/fermiapp/products/larsoft/setup
setup mrb
mkdir artg4tk_dev
cd artg4tk_dev
export MRB_PROJECT=artg4tk
mrb newDev -v v8_02_00 -q e17:prof
source ./localProducts_artg4tk_v8_02_00_e17_prof/setup
cd srcs
mrb g -b  origin/feature/wenzel_fixbuild artg4tk
cd $MRB_BUILDDIR
mrbsetenv
mrb b -j4
cd examples
art -c eic_calo.fcl

Examples that demonstrate the use of the different sensitive Detectors and Hits

CalorimeterSD DRCalorimeterSD HadIntAndEdepTrkSD HadInteractionSD PhotonSD TrackerSD

Dual readout Calorimeter (DRCalorimeterSD, PhotonSD)

here we show a simulation that can be used to study the properties and performance of a dual readout calorimeter. Such a calorimeter addresses the following principal contributions to hadron energy resolution and non-linearity:
  • fluctuations in nuclear binding energy loss dominate the energy resolution resulting in a non-linear, non-Gaussian hadron response. It can be demonstrated that this can be mitigated using dual readout where both Cerenkov C and scintillation S signal are read out from the same crystal and the C/S ratio is used to correct the scintillation signal. We show that we can achieve linear and Gaussian response and improved hadronic resolution.
  • Sampling fluctuations in the sharing of the shower energy between the active and passive materials in sampling calorimeters are eliminated by making the calorimeter homogeneous and totally active.
  • Difference in the ’sampling fractions’ (i.e. ratio in the effective energy loss) between the different materials in the sampling calorimeters can be eliminated by making the calorimeters homogeneous.
  • While leakage fluctuations due to escaping neutrinos, neutrons and muons can not be avoided, tails of the hadronic shower escaping the detector can be minimized by using dense high density modern heavy metal crystals. The availability of such crystals means that full containment of hadronic showers can be achieved with a total absorption calorimeter small enough to fit into a collider detector. All materials are dense with a nuclear interaction length lambda in a range from 21 cm (PWO and PbF_2) to 23 cm (BGO)

Besides heavy crystals the other enabling technology is the development of on-detector readout devices, e.g., SiPMs, MCPs, etc., which allow that individual crystal calorimeter cells can be organized in a highly granular configuration that would allow the use of Particle Flow Algorithms to further improve the performance.

The following image shows the simulation of a pi+ shower in a dual readout calorimeter consisting of PbF2 crystals.

shower induced by a 5GeV pi+ in a PbF crystal calorimeter

Percentage contribution of various particles to the energy deposited by 5GeV pi+ in a PbF crystal calorimeter

Percentage contribution of various particles to the energy deposited by 5GeV pi+ in a PbF crystal calorimeter

Percentage contribution of various particles to the produced cerenkov light produced by 5GeV pi+ in a PbF crystal calorimeter

Percentage contribution of various particles to the produced cerenkov light produced by 5GeV pi+ in a PbF crystal calorimeter

The following image shows the simulation of a electron shower in a dual readout calorimeter consisting of PbF2 crystals.

shower induced by a 5GeV electron in a PbF crystal calorimeter

Percentage contribution of various particles to the energy deposited by 5GeV electron in a PbF crystal calorimeter

Percentage contribution of various particles to the energy deposited by 5GeV electron in a PbF crystal calorimeter

Percentage contribution of various particles to the produced cerenkov light produced by 5GeV electron in a PbF crystal calorimeter

Percentage contribution of various particles to the produced cerenkov light produced  by 5GeV electron in a PbF crystal calorimeter