Warning, /geant4/examples/advanced/HGCal_testbeam/README is written in an unsupported language. File is not indexed.
0001 -------------------------------------------------------------------
0002
0003 =========================================================
0004 Geant4 - an Object-Oriented Toolkit for Simulation in HEP
0005 =========================================================
0006
0007 Example HGCal_testbeam
0008 ----------------------
0009
0010 This example is based on the Geant4 standalone application developed
0011 by Thorben Quast for the CMS HGCal studies:
0012 https://github.com/ThorbenQuast/HGCal_TB_Geant4.
0013
0014 The goal of this example is to demonstrate a test beam setup used
0015 in HEP experiments, and as a base for the validation studies and
0016 comparison with experiment data.
0017
0018 It presents a test beam setup used in the HGCal studies in October
0019 2018. It can be easily extended to other configurations.
0020
0021 Details on the High Granularity Calorimeter (HGCal) can be found
0022 i.a. in the Technical Design Report:
0023 https://cds.cern.ch/record/2293646/files/CMS-TDR-019.pdf
0024
0025 1. Detector description
0026 -----------------------
0027
0028 Detector construction in this example assumes that the setup is
0029 constructed with different elements placed one behind another along
0030 z axis (beam axis).
0031 There are 3 configurations user can choose from, and could be set
0032 with UI command:
0033
0034 /HGCalTestbeam/setup/configuration <ID>
0035
0036 where <ID> by default is equal to 0, which means the HGCal testbeam
0037 setup used in October 2018.
0038 <ID> 1 builds the same calorimeter setup, but places in front of it
0039 several beamline elements.
0040 <ID> 2 builds a very simplistic test configuration.
0041
0042 Whenever a silicon wafer or SiPM is placed in the detector, a sensitive
0043 volume is attached to it, and will be used to collect signal.
0044
0045 Silicon wafer is divided into cells (pixels), and each individual pixel
0046 can collect signal.
0047
0048 In order to change the maximum step size allowed in silicon pixels:
0049
0050 /HGCalTestbeam/setup/stepSilicon <STEP>
0051
0052 where <STEP> is value of the max step size in micrometres. By default
0053 <STEP> is equal to 30 um.
0054
0055 2. Signal
0056 ---------
0057
0058 Energy deposited within silicon pixels and SiPMs is registered in the
0059 sensitive detectors. Each deposit is added individually to the vector
0060 of hits, in order to allow the digitisation.
0061
0062 Digitisation is performed at the end of the event. It accumulates the
0063 energy deposits within pixels, taking into account the time cut on the
0064 arrival of signal (global time of energy deposit). By default no time
0065 cut is applied which means all the deposits are counted. It can be set
0066 using UI command:
0067
0068 /HGCalTestbeam/hits/timeCut <TIME>
0069
0070 where <TIME> is the maximum global time of the energy deposit that
0071 would be counted into the signal within the pixel.
0072
0073 Another hit parameter is TOA (time of arrival) which is calculated
0074 as time of the energy deposit which added to the digitised pixel energy
0075 exceeds the threshold. By default the threshold is equal to 0, which
0076 means that any hit will exceed the value, so TOA of pixel equals to
0077 the time of the first energy deposit. It can be set using UI command:
0078
0079 /HGCalTestbeam/hits/toaThreshold <ENERGY_THRESHOLD>
0080
0081 where <ENERGY_THRESHOLD> indicates the threshold the sum of energy
0082 needs to exceed to be counted as time of arrival.
0083
0084 Additionally, for silicon pixels, time of the last energy deposit
0085 (within the time window) is recorded.
0086
0087 3. Output
0088 ---------
0089
0090 Output with event signal is stored in ntuple and saved to a ROOT file.
0091 Its name can be set with UI command:
0092
0093 /HGCalTestbeam/output/file <NAME>
0094
0095 Created TTree "hits" contains following branches:
0096
0097 +---------------------------------+-----------------+------+-------------------------------------------+
0098 | Branch | Type | Unit | Description |
0099 +---------------------------------+-----------------+------+-------------------------------------------+
0100 | event | int | - | |
0101 | pdgID | vector<int> | - | PDG code of primary particles |
0102 | beamEnergy | vector<double> | GeV | initial energy of primaries |
0103 | beamX_cm | vector<double> | cm | initial X position of primaries |
0104 | beamY_cm | vector<double> | cm | initial Y position of primaries |
0105 | beamZ_cm | vector<double> | cm | initial Z position of primaries |
0106 | siliconHits_ID | vector<int> | - | ID of hits in Si (=1e3*waferID+cellID) |
0107 | siliconHits_x_cm | vector<double> | cm | X position of Si pixel |
0108 | siliconHits_y_cm | vector<double> | cm | Y position of Si pixel |
0109 | siliconHits_z_cm | vector<double> | cm | Z position of Si pixel |
0110 | siliconHits_Edep_keV | vector<double> | keV | energy deposited within Si pixel |
0111 | siliconHits_EdepNonIonizing_keV | vector<double> | keV | non-ionizing energy deposit (Si) |
0112 | siliconHits_TOA_ns | vector<double> | ns | time of arrival for Si pixel |
0113 | siliconHits_TOA_last_ns | vector<double> | ns | time of last arrival for Si pixel |
0114 | siliconHits_type | vector<int> | - | hit type for Si pixel (=0) |
0115 | SiPMHits_ID | vector<int> | - | ID of hits in SiPM (=1e3*sensorID+cellID) |
0116 | SiPMHits_x_cm | vector<double> | cm | X position of SiPM |
0117 | SiPMHits_y_cm | vector<double> | cm | Y position of SiPM |
0118 | SiPMHits_z_cm | vector<double> | cm | Z position of SiPM |
0119 | SiPMHits_Edep_keV | vector<double> | keV | energy deposited within SiPM |
0120 | SiPMHits_EdepNonIonizing_keV | vector<double> | keV | non-ionizing energy deposit (SiPM) |
0121 | SiPMHits_TOA_ns | vector<double> | ns | time of arrival for SiPM |
0122 | SiPMHits_type | vector<int> | - | hit type for SiPM (= 1) |
0123 | signalSum_HGCAL_GeV | double | GeV | sum of energy deposited in Si pixels |
0124 | COGZ_HGCAL_cm | double | cm | energy-weighted shower depth in z |
0125 | NHits_HGCAL | int | - | number of Si pixel hits |
0126 | signalSum_AHCAL_GeV | double | GeV | sum of energy deposited in SiPMs |
0127 | COGZ_AHCAL_cm | double | cm | energy-weighted shower depth in z |
0128 | NHits_AHCAL | int | - | number of SiPM hits |
0129 +---------------------------------+-----------------+------+-------------------------------------------+
0130
0131 4. Primary particle generator
0132 -----------------------------
0133
0134 Particle gun is used as a default primary particle generator.
0135 It can be controlled with standard UI commands (/gun/) and with
0136 additional ones introduced by the messenger:
0137
0138 /HGCalTestbeam/generator/momentumSpread <VALUE>
0139 to change constant particle energy to Gaussian distribution with
0140 sigma expressed in units of the initial energy (e.g. <VALUE>=0.05
0141 means sigma of 0.05 * E). By default it equals to 0 and constant
0142 energy value is used.
0143
0144 /HGCalTestbeam/generator/beamSpread <none/Gaussian/flat>
0145 to define type of beam position spread. By default none is used.
0146
0147 /HGCalTestbeam/generator/beamSpreadX <SIZE>
0148 to define size of beam spread along x axis. It is sigma of a
0149 Gaussian distribution, or half-width of a flat distribution.
0150
0151 /HGCalTestbeam/generator/beamSpreadY <SIZE>
0152 to define size of beam spread along y axis. It is sigma of a
0153 Gaussian distribution, or half-width of a flat distribution.
0154
0155 /HGCalTestbeam/generator/fBeamZ0 <POSITION>
0156 to define beam position along z axis. By default edge of the
0157 world volume is used.
0158
0159 Additionally, if installation was done with ROOT package (CMake
0160 was able to locate it), an option of input read from the ROOT file
0161 is enabled. It can be activated with
0162
0163 /HGCalTestbeam/generator/fReadInputFile true
0164
0165 /HGCalTestbeam/generator/fPathInputFile <FILE>
0166 sets the path to the input file.
0167
0168 /HGCalTestbeam/generator/startFromEvent <N>
0169 allows to start simulation from Nth event.
0170
0171 Please note that in current implementation input from file needs to be
0172 executed in a non-multithreaded mode (or with 1 thread).
0173
0174 Input file needs to have following structure:
0175 - TDirectory "VirtualDetector"
0176 - TNtuple "HGCAL" with branches:
0177 +---------+-------+------+-------------------------------+
0178 | Branch | Type | Unit | Description |
0179 +---------+-------+------+-------------------------------+
0180 | EventID | float | - | ID of event |
0181 | PDGid | float | - | Particle type (PDG code) |
0182 | x | float | mm | Initial X position |
0183 | y | float | mm | Initial Y position |
0184 | Px | float | MeV | Initial momentum along X axis |
0185 | Py | float | MeV | Initial momentum along Y axis |
0186 | Pz | float | MeV | Initial momentum along Z axis |
0187 +---------+-------+------+-------------------------------+
0188
0189 Several particles may belong to the same event, in which case all
0190 of them are read from the input file.
0191 Z position is set to Z position of the entrance of the HGCal detector.
0192
0193 5. How to run the example
0194 -------------------------
0195
0196 Example can be run in interactive mode, with visualisation:
0197
0198 ./HGCal_testbeam
0199
0200 It will execute init_vis.mac and vis.mac.
0201
0202 To run in a batch mode, specify the path to the macro:
0203
0204 ./HGCal_testbeam run.mac
0205
0206 which will run 10 single-electron events, with beam energy of 30 GeV.
0207 The beam position is smeared with Gaussian with x/y sigma of 1.5 cm.
0208 The momentum is smeared with Gaussian with sigma of 5% (2.5 GeV).
0209 Z beam position is set to -1 m.
0210 Maximum step size in Si pixel is 20 um.
0211 The name of the created file is output_eM_smeared_30GeV_10events.root.
0212
0213 6. Additional settings
0214 ----------------------
0215
0216 6.1. Particle input from ROOT file
0217 ----------------------------------
0218
0219 If ROOT is found by CMake, it allows to use ROOT file as the input to
0220 the primary generator. See more in the description of "4. Primary
0221 particle generator".
0222
0223 ./HGCal_testbeam readFromFile.mac
0224
0225 Macro readFromFile.mac can be used but name of the input file should
0226 be specified (not provided with the example). This mode is meant to
0227 be used in the validation with experimental data with geant-val.