LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Module to generate particles created by radiological decay, patterned off of SingleGen
.
More...
Public Types | |
using | ModuleType = EDProducer |
template<typename UserConfig , typename KeysToIgnore = void> | |
using | Table = Modifier::Table< UserConfig, KeysToIgnore > |
Public Member Functions | |
RadioGen (fhicl::ParameterSet const &pset) | |
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) |
void | fillProductDescriptions () |
void | registerProducts (ProductDescriptions &productsToRegister) |
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) |
std::unique_ptr< Worker > | makeWorker (WorkerParams const &wp) |
template<typename T , BranchType BT> | |
ViewToken< T > | consumesView (InputTag const &tag) |
template<typename T , BranchType BT> | |
ViewToken< T > | mayConsumeView (InputTag const &tag) |
Protected Member Functions | |
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 () |
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, std::string const &PathToFile) |
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::string | fPathToFile |
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 |
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 193 of file RadioGen_module.cc.
|
inherited |
Definition at line 17 of file EDProducer.h.
|
inherited |
Definition at line 26 of file Producer.h.
|
private |
Definition at line 205 of file RadioGen_module.cc.
|
private |
Definition at line 203 of file RadioGen_module.cc.
|
explicit |
Definition at line 288 of file RadioGen_module.cc.
References addvolume(), art::errors::Configuration, util::counter(), art::detail::EngineCreator::createEngine(), defaulttimewindow(), dumpNuclideSettings(), util::enumerate(), fBq, fEngine, fIsFirstSignalSpecial, fMaterial, fNuclide, fPathToFile, fT0, fT1, fX0, fX1, fY0, fY1, fZ0, fZ1, readfile(), and t1.
|
private |
Adds all volumes with the specified name to the coordinates. Volumes must be boxes aligned to the world frame axes.
Definition at line 480 of file RadioGen_module.cc.
References geo::ROOTGeometryNavigator::apply(), fX0, fX1, fY0, fY1, fZ0, fZ1, and geo::origin().
Referenced by RadioGen().
|
private |
Definition at line 933 of file RadioGen_module.cc.
References dirCalc().
Referenced by Ar42Gamma3(), Ar42Gamma4(), Ar42Gamma5(), and SampleOne().
|
private |
Definition at line 943 of file RadioGen_module.cc.
References Ar42Gamma2(), and dirCalc().
Referenced by SampleOne().
|
private |
Definition at line 954 of file RadioGen_module.cc.
References Ar42Gamma2(), dirCalc(), and fEngine.
Referenced by Ar42Gamma5(), and SampleOne().
|
private |
Definition at line 975 of file RadioGen_module.cc.
References Ar42Gamma2(), Ar42Gamma4(), dirCalc(), and fEngine.
Referenced by SampleOne().
|
privatevirtual |
Reimplemented from art::EDProducer.
Definition at line 454 of file RadioGen_module.cc.
References geo::GeometryCore::DetectorName(), art::fullRun(), and art::Run::put().
|
protectedinherited |
Definition at line 61 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().
|
protectedinherited |
|
protectedinherited |
Definition at line 75 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().
|
protectedinherited |
|
inherited |
Definition at line 68 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().
|
private |
Returns the start and end of the readout window.
Definition at line 1043 of file RadioGen_module.cc.
References DEFINE_ART_MODULE, detinfo::makeDetectorTimings(), detinfo::DetectorPropertiesData::NumberTimeSamples(), and detinfo::DetectorPropertiesData::ReadOutWindowSize().
Referenced by RadioGen().
|
private |
Definition at line 678 of file RadioGen_module.cc.
References fEngine.
Referenced by Ar42Gamma2(), Ar42Gamma3(), Ar42Gamma4(), Ar42Gamma5(), and SampleOne().
|
inherited |
Definition at line 22 of file Producer.cc.
References art::detail::Producer::beginJobWithFrame(), and art::detail::Producer::setupQueues().
|
inherited |
Definition at line 65 of file Producer.cc.
References art::detail::Producer::beginRunWithFrame(), art::RangeSet::forRun(), art::RunPrincipal::makeRun(), r, art::RunPrincipal::runID(), and art::ModuleContext::scheduleID().
|
inherited |
Definition at line 85 of file Producer.cc.
References art::detail::Producer::beginSubRunWithFrame(), art::RangeSet::forSubRun(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::SubRunPrincipal::subRunID().
|
inherited |
Definition at line 30 of file Producer.cc.
References art::detail::Producer::endJobWithFrame().
|
inherited |
Definition at line 75 of file Producer.cc.
References art::detail::Producer::endRunWithFrame(), art::RunPrincipal::makeRun(), r, art::ModuleContext::scheduleID(), and art::Principal::seenRanges().
|
inherited |
Definition at line 95 of file Producer.cc.
References art::detail::Producer::endSubRunWithFrame(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::Principal::seenRanges().
|
inherited |
Definition at line 105 of file Producer.cc.
References art::detail::Producer::checkPutProducts_, e, art::EventPrincipal::makeEvent(), art::detail::Producer::produceWithFrame(), and art::ModuleContext::scheduleID().
|
inherited |
Definition at line 44 of file Producer.cc.
References art::detail::Producer::respondToCloseInputFileWithFrame().
|
inherited |
Definition at line 58 of file Producer.cc.
References art::detail::Producer::respondToCloseOutputFilesWithFrame().
|
inherited |
Definition at line 37 of file Producer.cc.
References art::detail::Producer::respondToOpenInputFileWithFrame().
|
inherited |
Definition at line 51 of file Producer.cc.
References art::detail::Producer::respondToOpenOutputFilesWithFrame().
|
private |
Prints the settings for the specified nuclide and volume.
Definition at line 1029 of file RadioGen_module.cc.
References fBq, fMaterial, fNuclide, fT0, fT1, fX0, fX1, fY0, fY1, fZ0, and fZ1.
Referenced by RadioGen().
|
inherited |
Definition at line 10 of file Modifier.cc.
References art::ProductRegistryHelper::fillDescriptions(), and art::ModuleBase::moduleDescription().
|
inherited |
Definition at line 43 of file ModuleBase.cc.
References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().
|
inherited |
Definition at line 37 of file ModuleBase.cc.
References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.
|
protectedinherited |
Definition at line 82 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().
|
protectedinherited |
Definition at line 96 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().
|
protectedinherited |
|
inherited |
Definition at line 89 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().
|
inherited |
Definition at line 13 of file ModuleBase.cc.
References art::errors::LogicError.
Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().
|
privatevirtual |
unique_ptr allows ownership to be transferred to the art::Event after the put statement
Implements art::EDProducer.
Definition at line 461 of file RadioGen_module.cc.
References fNuclide, simb::kSingleParticle, MF_LOG_DEBUG, art::Event::put(), SampleOne(), simb::MCTruth::SetOrigin(), and trackidcounter.
|
private |
Definition at line 695 of file RadioGen_module.cc.
References alphaintegral, alphaspectrum, betaintegral, betaspectrum, f, fNuclide, gammaintegral, gammaspectrum, neutronintegral, neutronspectrum, spectrumname, and y.
Referenced by RadioGen().
|
inherited |
Definition at line 16 of file Modifier.cc.
References art::ModuleBase::moduleDescription(), and art::ProductRegistryHelper::registerProducts().
|
private |
Definition at line 895 of file RadioGen_module.cc.
References fEngine, nbinsx, and x.
Referenced by samplespectrum().
|
private |
Checks that the node represents a box well aligned to world frame axes.
Definition at line 538 of file RadioGen_module.cc.
References simb::MCTruth::Add(), simb::MCParticle::AddTrajectoryPoint(), Ar42Gamma2(), Ar42Gamma3(), Ar42Gamma4(), Ar42Gamma5(), dirCalc(), energy, fBq, fEngine, fIsFirstSignalSpecial, fMaterial, fNuclide, fT0, fT1, fX0, fX1, fY0, fY1, fZ0, fZ1, part, geo::GeometryCore::ROOTGeoManager(), samplespectrum(), and trackidcounter.
Referenced by produce().
|
private |
Definition at line 831 of file RadioGen_module.cc.
References alphaintegral, alphaspectrum, betaintegral, betaspectrum, e, fEngine, gammaintegral, gammaspectrum, neutronspectrum, samplefromth1d(), and spectrumname.
Referenced by SampleOne().
|
inherited |
|
inherited |
Definition at line 49 of file ModuleBase.cc.
References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().
|
private |
Definition at line 268 of file RadioGen_module.cc.
Referenced by readfile(), and samplespectrum().
|
private |
Definition at line 267 of file RadioGen_module.cc.
Referenced by readfile(), and samplespectrum().
|
private |
Definition at line 270 of file RadioGen_module.cc.
Referenced by readfile(), and samplespectrum().
|
private |
Definition at line 269 of file RadioGen_module.cc.
Referenced by readfile(), and samplespectrum().
|
private |
Radioactivity in Becquerels (decay per sec) per cubic cm.
Definition at line 249 of file RadioGen_module.cc.
Referenced by dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
Definition at line 275 of file RadioGen_module.cc.
Referenced by Ar42Gamma4(), Ar42Gamma5(), dirCalc(), RadioGen(), samplefromth1d(), SampleOne(), and samplespectrum().
|
private |
Definition at line 258 of file RadioGen_module.cc.
Referenced by RadioGen(), and SampleOne().
|
private |
List of regexes of materials in which to generate the decays. Example: "LAr".
Definition at line 248 of file RadioGen_module.cc.
Referenced by dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
List of nuclides to simulate. Example: "39Ar".
Definition at line 246 of file RadioGen_module.cc.
Referenced by dumpNuclideSettings(), produce(), RadioGen(), readfile(), and SampleOne().
|
private |
Definition at line 260 of file RadioGen_module.cc.
Referenced by RadioGen().
|
private |
Beginning of time window to simulate in ns.
Definition at line 250 of file RadioGen_module.cc.
Referenced by dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
End of time window to simulate in ns.
Definition at line 251 of file RadioGen_module.cc.
Referenced by dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
Bottom corner x position (cm) in world coordinates.
Definition at line 252 of file RadioGen_module.cc.
Referenced by addvolume(), dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
Top corner x position (cm) in world coordinates.
Definition at line 255 of file RadioGen_module.cc.
Referenced by addvolume(), dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
Bottom corner y position (cm) in world coordinates.
Definition at line 253 of file RadioGen_module.cc.
Referenced by addvolume(), dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
Top corner y position (cm) in world coordinates.
Definition at line 256 of file RadioGen_module.cc.
Referenced by addvolume(), dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
Bottom corner z position (cm) in world coordinates.
Definition at line 254 of file RadioGen_module.cc.
Referenced by addvolume(), dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
Top corner z position (cm) in world coordinates.
Definition at line 257 of file RadioGen_module.cc.
Referenced by addvolume(), dumpNuclideSettings(), RadioGen(), and SampleOne().
|
private |
Definition at line 272 of file RadioGen_module.cc.
Referenced by readfile(), and samplespectrum().
|
private |
Definition at line 271 of file RadioGen_module.cc.
Referenced by readfile(), and samplespectrum().
|
private |
Definition at line 274 of file RadioGen_module.cc.
Referenced by readfile().
|
private |
Definition at line 273 of file RadioGen_module.cc.
Referenced by readfile(), and samplespectrum().
|
private |
Definition at line 266 of file RadioGen_module.cc.
Referenced by readfile(), and samplespectrum().
|
private |
Serial number for the MC track ID.
Definition at line 259 of file RadioGen_module.cc.
Referenced by produce(), and SampleOne().