Module to generate particles created by radiological decay, patterned off of SingleGen
.
More...
Public Member Functions | |
RadioGen (fhicl::ParameterSet const &pset) | |
Public Member Functions inherited from art::EDProducer | |
EDProducer (fhicl::ParameterSet const &pset) | |
template<typename Config > | |
EDProducer (Table< Config > const &config) | |
std::string | workerType () const |
Public Member Functions inherited from art::detail::Producer | |
virtual | ~Producer () noexcept |
Producer (fhicl::ParameterSet const &) | |
Producer (Producer const &)=delete | |
Producer (Producer &&)=delete | |
Producer & | operator= (Producer const &)=delete |
Producer & | operator= (Producer &&)=delete |
void | doBeginJob (SharedResources const &resources) |
void | doEndJob () |
void | doRespondToOpenInputFile (FileBlock const &fb) |
void | doRespondToCloseInputFile (FileBlock const &fb) |
void | doRespondToOpenOutputFiles (FileBlock const &fb) |
void | doRespondToCloseOutputFiles (FileBlock const &fb) |
bool | doBeginRun (RunPrincipal &rp, ModuleContext const &mc) |
bool | doEndRun (RunPrincipal &rp, ModuleContext const &mc) |
bool | doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc) |
bool | doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc) |
bool | doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed) |
Public Member Functions inherited from art::Modifier | |
~Modifier () noexcept | |
Modifier () | |
Modifier (Modifier const &)=delete | |
Modifier (Modifier &&)=delete | |
Modifier & | operator= (Modifier const &)=delete |
Modifier & | operator= (Modifier &&)=delete |
Public Member Functions inherited from art::ModuleBase | |
virtual | ~ModuleBase () noexcept |
ModuleBase () | |
ModuleDescription const & | moduleDescription () const |
void | setModuleDescription (ModuleDescription const &) |
std::array< std::vector< ProductInfo >, NumBranchTypes > const & | getConsumables () const |
void | sortConsumables (std::string const ¤t_process_name) |
template<typename T , BranchType BT> | |
ViewToken< T > | consumesView (InputTag const &tag) |
template<typename T , BranchType BT> | |
ViewToken< T > | mayConsumeView (InputTag const &tag) |
Private Types | |
typedef int | ti_PDGID |
typedef double | td_Mass |
Private Member Functions | |
void | produce (art::Event &evt) |
void | beginRun (art::Run &run) |
std::size_t | addvolume (std::string const &volumeName) |
void | SampleOne (unsigned int i, simb::MCTruth &mct) |
Checks that the node represents a box well aligned to world frame axes. More... | |
TLorentzVector | dirCalc (double p, double m) |
void | readfile (std::string nuclide, std::string const &filename) |
void | samplespectrum (std::string nuclide, int &itype, double &t, double &m, double &p) |
void | Ar42Gamma2 (std::vector< std::tuple< ti_PDGID, td_Mass, TLorentzVector >> &v_prods) |
void | Ar42Gamma3 (std::vector< std::tuple< ti_PDGID, td_Mass, TLorentzVector >> &v_prods) |
void | Ar42Gamma4 (std::vector< std::tuple< ti_PDGID, td_Mass, TLorentzVector >> &v_prods) |
void | Ar42Gamma5 (std::vector< std::tuple< ti_PDGID, td_Mass, TLorentzVector >> &v_prods) |
double | samplefromth1d (TH1D &hist) |
template<typename Stream > | |
void | dumpNuclideSettings (Stream &&out, std::size_t iNucl, std::string const &volumeName={}) const |
Prints the settings for the specified nuclide and volume. More... | |
std::pair< double, double > | defaulttimewindow () const |
Returns the start and end of the readout window. More... | |
Private Attributes | |
std::vector< std::string > | fNuclide |
List of nuclides to simulate. Example: "39Ar". More... | |
std::vector< std::string > | fMaterial |
List of regexes of materials in which to generate the decays. Example: "LAr". More... | |
std::vector< double > | fBq |
Radioactivity in Becquerels (decay per sec) per cubic cm. More... | |
std::vector< double > | fT0 |
Beginning of time window to simulate in ns. More... | |
std::vector< double > | fT1 |
End of time window to simulate in ns. More... | |
std::vector< double > | fX0 |
Bottom corner x position (cm) in world coordinates. More... | |
std::vector< double > | fY0 |
Bottom corner y position (cm) in world coordinates. More... | |
std::vector< double > | fZ0 |
Bottom corner z position (cm) in world coordinates. More... | |
std::vector< double > | fX1 |
Top corner x position (cm) in world coordinates. More... | |
std::vector< double > | fY1 |
Top corner y position (cm) in world coordinates. More... | |
std::vector< double > | fZ1 |
Top corner z position (cm) in world coordinates. More... | |
bool | fIsFirstSignalSpecial |
int | trackidcounter |
Serial number for the MC track ID. More... | |
std::vector< std::string > | spectrumname |
std::vector< std::unique_ptr< TH1D > > | alphaspectrum |
std::vector< double > | alphaintegral |
std::vector< std::unique_ptr< TH1D > > | betaspectrum |
std::vector< double > | betaintegral |
std::vector< std::unique_ptr< TH1D > > | gammaspectrum |
std::vector< double > | gammaintegral |
std::vector< std::unique_ptr< TH1D > > | neutronspectrum |
std::vector< double > | neutronintegral |
CLHEP::HepRandomEngine & | fEngine |
Additional Inherited Members | |
Public Types inherited from art::EDProducer | |
using | ModuleType = EDProducer |
using | WorkerType = WorkerT< EDProducer > |
Public Types inherited from art::detail::Producer | |
template<typename UserConfig , typename KeysToIgnore = void> | |
using | Table = Modifier::Table< UserConfig, KeysToIgnore > |
Public Types inherited from art::Modifier | |
template<typename UserConfig , typename UserKeysToIgnore = void> | |
using | Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore > |
Static Public Member Functions inherited from art::EDProducer | |
static void | commitEvent (EventPrincipal &ep, Event &e) |
Protected Member Functions inherited from art::ModuleBase | |
ConsumesCollector & | consumesCollector () |
template<typename T , BranchType = InEvent> | |
ProductToken< T > | consumes (InputTag const &) |
template<typename Element , BranchType = InEvent> | |
ViewToken< Element > | consumesView (InputTag const &) |
template<typename T , BranchType = InEvent> | |
void | consumesMany () |
template<typename T , BranchType = InEvent> | |
ProductToken< T > | mayConsume (InputTag const &) |
template<typename Element , BranchType = InEvent> | |
ViewToken< Element > | mayConsumeView (InputTag const &) |
template<typename T , BranchType = InEvent> | |
void | mayConsumeMany () |
Module to generate particles created by radiological decay, patterned off of SingleGen
.
The module generates the products of radioactive decay of some known nuclides. Each nuclide decay producing a single particle (with exceptions, as for example argon(A=42)), whose spectrum is specified in a ROOT file to be found in the FW_SEARCH_PATH
path, and it can be a alpha, beta, gamma or neutron. In case multiple decay channels are possible, each decay is stochastically chosen weighting the channels according to the integral of their spectrum. The normalization of the spectrum is otherwise ignored.
Nuclides can be added by making the proper distributions available in a file called after the name used for it in the Nuclide
configuration parameter (e.g 14C.root
if the nuclide key is 14C
): check the existing nuclide files for examples.
A special treatment is encoded for argon(A=42) and radon(A=222) (and, "temporary", for nichel(A=59) ).
Decays happen only in volumes specified in the configuration, and with a rate also specified in the configuration. Volumes are always box-shaped, and can be specified by coordinates or by name. In addition, within each volume decays will be generated only in the subvolumes matching the specified materials.
X0
, Y0
, Z0
, X1
, Y1
, Z1
(lists of real numbers, optional): if specified, they describe the box volumes where to generate decays; all lists must have the same size, and each entry i
defines the box between coordinates (X0[i], Y0[i], Z0[i])
and (X1[i], Y1[i], Z1[i])
expressed in world coordinates and in centimeters;Volumes
(list of strings, optional): if specified, each entry represents all the volumes in the geometry whose name exactly matches the entry; the volumes are added after the ones explicitly listed by their coordinates (configuration parameters X0
, Y0
, Z0
, X1
, Y1
and Z1
); each volume name counts as one entry, even if it expands to multiple volumes; Volumes
can be omitted if volumes are specified with the coordinate parameters;Nuclide
(list of strings, mandatory): the list of decaying nuclides, one per volume entry; note that each of the elements in X0
(and the other 5 coordinate parameters) and each of the elements in Volumes
counts as one entry, even for entries of the latter which match multiple volumes (in that case, all matching volumes are assigned the same nuclide parameters); since documentation is never maintained, refer to the code for a list of the supported materials; a subset of them is: 39Ar
, 60Co
, 85Kr
, 40K
, 232Th
, 238U
, 222Rn
, 59Ni
and 42Ar
;Material
(list of regular expressions, mandatory): for each nuclide, the name of the materials allowed to decay in this mode; this name is a regular expression (C++ default std::regex
), which needs to match the name of the material as specified in the detector geometry (usually in GDML format); a material is mandatory for each nuclide; if no material selection is desired, the all-matching pattern ".*"
can be used;BqPercc
(list of real numbers, mandatory): activity of the nuclides, in the same order as they are in Nuclide
parameter; each value is specified as becquerel per cubic centimeter;T0
, T1
(list of real values, optional): range of time when the decay may happen, in simulation time; each nuclide is assigned a time range; differently from the other parameters, the list of times can be shorter than the number of nuclides, in which case all the nuclides with no matching time range will be assigned the last range specified; as a specially special case, if no time is specified at all, the time window is assigned as from one readout window (detinfo::DetectorPropertiesData::ReadOutWindowSize()
) before the nominal hardware trigger time (detinfo::DetectorClocksData::TriggerTime()
) up to a number of ticks after the trigger time equivalent to the full simulated TPC waveform (detinfo::DetectorPropertiesData::NumberTimeSamples()
); this makes it a quite poor default, so you may want to avoid it. Definition at line 185 of file RadioGen_module.cc.
|
private |
Definition at line 195 of file RadioGen_module.cc.
|
private |
Definition at line 194 of file RadioGen_module.cc.
|
explicit |
Definition at line 280 of file RadioGen_module.cc.
|
private |
Adds all volumes with the specified name to the coordinates. Volumes must be boxes aligned to the world frame axes.
Definition at line 431 of file RadioGen_module.cc.
|
private |
Definition at line 872 of file RadioGen_module.cc.
|
private |
Definition at line 881 of file RadioGen_module.cc.
|
private |
Definition at line 891 of file RadioGen_module.cc.
|
private |
Definition at line 910 of file RadioGen_module.cc.
|
privatevirtual |
Reimplemented from art::EDProducer.
Definition at line 405 of file RadioGen_module.cc.
|
private |
Returns the start and end of the readout window.
Definition at line 979 of file RadioGen_module.cc.
|
private |
Definition at line 606 of file RadioGen_module.cc.
|
private |
Prints the settings for the specified nuclide and volume.
Definition at line 962 of file RadioGen_module.cc.
|
privatevirtual |
unique_ptr allows ownership to be transferred to the art::Event after the put statement
Implements art::EDProducer.
Definition at line 412 of file RadioGen_module.cc.
|
private |
Definition at line 623 of file RadioGen_module.cc.
|
private |
Definition at line 835 of file RadioGen_module.cc.
|
private |
Checks that the node represents a box well aligned to world frame axes.
Definition at line 495 of file RadioGen_module.cc.
|
private |
Definition at line 767 of file RadioGen_module.cc.
|
private |
Definition at line 259 of file RadioGen_module.cc.
|
private |
Definition at line 258 of file RadioGen_module.cc.
|
private |
Definition at line 261 of file RadioGen_module.cc.
|
private |
Definition at line 260 of file RadioGen_module.cc.
|
private |
Radioactivity in Becquerels (decay per sec) per cubic cm.
Definition at line 240 of file RadioGen_module.cc.
|
private |
Definition at line 266 of file RadioGen_module.cc.
|
private |
Definition at line 249 of file RadioGen_module.cc.
|
private |
List of regexes of materials in which to generate the decays. Example: "LAr".
Definition at line 239 of file RadioGen_module.cc.
|
private |
List of nuclides to simulate. Example: "39Ar".
Definition at line 238 of file RadioGen_module.cc.
|
private |
Beginning of time window to simulate in ns.
Definition at line 241 of file RadioGen_module.cc.
|
private |
End of time window to simulate in ns.
Definition at line 242 of file RadioGen_module.cc.
|
private |
Bottom corner x position (cm) in world coordinates.
Definition at line 243 of file RadioGen_module.cc.
|
private |
Top corner x position (cm) in world coordinates.
Definition at line 246 of file RadioGen_module.cc.
|
private |
Bottom corner y position (cm) in world coordinates.
Definition at line 244 of file RadioGen_module.cc.
|
private |
Top corner y position (cm) in world coordinates.
Definition at line 247 of file RadioGen_module.cc.
|
private |
Bottom corner z position (cm) in world coordinates.
Definition at line 245 of file RadioGen_module.cc.
|
private |
Top corner z position (cm) in world coordinates.
Definition at line 248 of file RadioGen_module.cc.
|
private |
Definition at line 263 of file RadioGen_module.cc.
|
private |
Definition at line 262 of file RadioGen_module.cc.
|
private |
Definition at line 265 of file RadioGen_module.cc.
|
private |
Definition at line 264 of file RadioGen_module.cc.
|
private |
Definition at line 257 of file RadioGen_module.cc.
|
private |
Serial number for the MC track ID.
Definition at line 250 of file RadioGen_module.cc.