LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
A module for optical MC testing and library building. More...
Classes | |
class | MaterialPointFilter |
Filters a point according to the material at that point. More... | |
Public Types | |
using | ModuleType = EDProducer |
template<typename UserConfig , typename KeysToIgnore = void> | |
using | Table = Modifier::Table< UserConfig, KeysToIgnore > |
Public Member Functions | |
LightSource (fhicl::ParameterSet const &pset) | |
void | produce (art::Event &evt) |
void | beginRun (art::Run &run) |
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 Member Functions | |
simb::MCTruth | Sample () |
void | checkMaterials () const |
Throws an exception if any of the configured materials is not present. More... | |
bool | readParametersFromInputFile () |
Private Attributes | |
std::string | fVersion |
std::ifstream | fInputFile |
std::string | fFileName |
char | fDummyString [256] |
TTree * | fPhotonsGenerated |
TLorentzVector | fShotPos |
TLorentzVector | fShotMom |
Int_t | fEvID |
int | fSourceMode |
bool | fFillTree |
int | fPosDist |
int | fTDist |
int | fPDist |
std::set< std::string > const | fSelectedMaterials |
Names of materials to consider scintillation from. More... | |
int | fXSteps |
int | fYSteps |
int | fZSteps |
sim::PhotonVoxelDef | fThePhotonVoxelDef |
int | fVoxelCount |
int | fCurrentVoxel |
geo::Vector_t | fTPCCenter |
std::vector< double > | fRegionMin |
std::vector< double > | fRegionMax |
bool | fUseCustomRegion |
geo::Point_t | fCenter |
Central position of source [cm]. More... | |
bool | fPointSource |
double | fT |
double | fSigmaX |
double | fSigmaY |
double | fSigmaZ |
double | fSigmaT |
double | fP |
double | fSigmaP |
int | fN |
double const | fNMaxF |
Maximum number of attempted samplings (factor on top of fN ). More... | |
int | fFirstVoxel |
int | fLastVoxel |
CLHEP::HepRandomEngine & | fEngine |
geo::GeometryCore const & | fGeom |
Geometry service provider (cached). More... | |
Static Private Attributes | |
static const int | kUNIF = 0 |
static const int | kGAUS = 1 |
static const int | kFILE = 0 |
static const int | kSCAN = 1 |
A module for optical MC testing and library building.
Light source event generator which simulate an extended isotropic photon source.
The light source can be run in two modes, file mode or scan mode. Each requires the specification of a different set of parameters.
Light source position, intensity and shape are supplied on an event by event basis in a text file. See the example provided for the format. Pararmeters required:
int32 SourceMode = 0 - sets light source to file mode string FileName - file of per event light source specifications int32 PosDist - how to distribute production points sampled in momentum, position int32 PDist and time ranges specified. For all of these : int32 TDist 0 = uniform and 1 = gauss bool FillTree - whether to write a tree of photon production points to fileservice
Upon reaching the end of the file, the light source will loop back to the first point. hence a one line text file will give a constant light source size, position and intensity.
Divide volume into cuboidal regions and produce an isotropic light source in each, using one region per event. User can specify either to use the full detector volume or some custom specified volume.
This mode is used when building a fast photon sim library, and performing volume scan sensitivity studies.
int32 SourceMode = 1 - sets light source to scan mode int32 N - number of photons to shoot from each point double P - peak photon momentum (or energy) in eV double SigmaP - momentum distribution width double XSteps - Number of regions to divide volume into in each direction double YSteps double ZSteps double T0 - Peak time of photon production double SigmaT - time distribution width int32 PosDist - how to distribute production points sampled in momentum, position int32 PDist and time ranges specified. For all of these : int32 TDist 0 = uniform and 1 = gaussian bool FillTree - whether to write a tree of photon production points to fileservice bool UseCustomRegion - supply our own volume specification or use the full detector volume? vdouble[3] RegionMin - bounding corners of the custom volume specification vdouble[3] RegionMax (only used if UseCustomRegion=true)
This is a partial list of the supported configuration parameters:
SelectMaterials
(list of strings, default: empty): if specified, generation points are required to be in a volume with any of the materials included in this list; a useful value is SelectMaterials: [ "LAr" ]
, which generates photons only in liquid argon; the rest of the constraints are also respected (that means that if the configured generation volume has none of the selected materials, generation can go on forever: see NMaxFactor
configuration parameter)NMaxFactor
(real value, default: 100 times N
): as a safety valve, do not attempt more than this times the requested number of photons: for example, in an event where 500 photons are required, with NMax: 20
no more than 10000 generations will be attempted; this is useful if the generation volume efficiency can't be guaranteed to be high (e.g. if only generation in liquid argon is requested in a generation volume that is entirely made of steel). Definition at line 131 of file LightSource_module.cc.
|
inherited |
Definition at line 17 of file EDProducer.h.
|
inherited |
Definition at line 26 of file Producer.h.
|
explicit |
Definition at line 264 of file LightSource_module.cc.
References checkMaterials(), art::detail::EngineCreator::createEngine(), fCurrentVoxel, fDummyString, fEngine, fEvID, fFileName, fFillTree, fFirstVoxel, fGeom, fInputFile, fLastVoxel, fN, fNMaxF, fP, fPDist, fPhotonsGenerated, fPointSource, fPosDist, fRegionMax, fRegionMin, fSelectedMaterials, fShotMom, fShotPos, fSigmaP, fSigmaT, fSigmaX, fSigmaY, fSigmaZ, fSourceMode, fT, fTDist, fThePhotonVoxelDef, fUseCustomRegion, fVoxelCount, fXSteps, fYSteps, fZSteps, sim::PhotonVoxelDef::GetNVoxels(), phot::PhotonVisibilityService::GetVoxelDef(), sim::PhotonVoxelDef::GetVoxelSize(), kFILE, and kSCAN.
|
virtual |
Reimplemented from art::EDProducer.
Definition at line 373 of file LightSource_module.cc.
References geo::GeometryCore::DetectorName(), fCurrentVoxel, fFirstVoxel, fGeom, art::fullRun(), and art::Run::put().
|
private |
Throws an exception if any of the configured materials is not present.
Definition at line 541 of file LightSource_module.cc.
References art::errors::Configuration, e, fGeom, fSelectedMaterials, mat, and geo::GeometryCore::ROOTGeoManager().
Referenced by LightSource().
|
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().
|
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().
|
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().
|
virtual |
Implements art::EDProducer.
Definition at line 381 of file LightSource_module.cc.
References e, fCenter, fCurrentVoxel, fDummyString, fFileName, fFirstVoxel, fInputFile, fLastVoxel, fSigmaX, fSigmaY, fSigmaZ, fSourceMode, fThePhotonVoxelDef, sim::PhotonVoxel::GetCenter(), sim::PhotonVoxelDef::GetPhotonVoxel(), phot::PhotonVisibilityService::IsBuildJob(), kFILE, kSCAN, art::Event::put(), readParametersFromInputFile(), Sample(), art::errors::ServiceNotFound, and phot::PhotonVisibilityService::StoreLightProd().
|
private |
Reads from fInputFile
all other parameters in one line.
ifstream::good()
). Definition at line 609 of file LightSource_module.cc.
References DEFINE_ART_MODULE, fCenter, fInputFile, fN, fP, fSigmaP, fSigmaT, fSigmaX, fSigmaY, fSigmaZ, fT, x, y, and z.
Referenced by produce().
|
inherited |
Definition at line 16 of file Modifier.cc.
References art::ModuleBase::moduleDescription(), and art::ProductRegistryHelper::registerProducts().
|
private |
Definition at line 453 of file LightSource_module.cc.
References evgen::LightSource::MaterialPointFilter::accept(), simb::MCTruth::Add(), simb::MCParticle::AddTrajectoryPoint(), e, fCenter, fEngine, fFillTree, fGeom, fN, fNMaxF, fP, fPDist, fPhotonsGenerated, fPointSource, fPosDist, fSelectedMaterials, fShotMom, fShotPos, fSigmaP, fSigmaT, fSigmaX, fSigmaY, fSigmaZ, fT, fTDist, kGAUS, simb::kSingleParticle, simb::MCTruth::NParticles(), part, simb::MCTruth::SetOrigin(), and x.
Referenced by produce().
|
inherited |
|
inherited |
Definition at line 49 of file ModuleBase.cc.
References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().
|
private |
Central position of source [cm].
Definition at line 226 of file LightSource_module.cc.
Referenced by produce(), readParametersFromInputFile(), and Sample().
|
private |
Definition at line 217 of file LightSource_module.cc.
Referenced by beginRun(), LightSource(), and produce().
|
private |
Definition at line 191 of file LightSource_module.cc.
Referenced by LightSource(), and produce().
|
private |
Definition at line 245 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 197 of file LightSource_module.cc.
Referenced by LightSource().
|
private |
Definition at line 190 of file LightSource_module.cc.
Referenced by LightSource(), and produce().
|
private |
Definition at line 201 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 242 of file LightSource_module.cc.
Referenced by beginRun(), LightSource(), and produce().
|
private |
Geometry service provider (cached).
Definition at line 246 of file LightSource_module.cc.
Referenced by beginRun(), checkMaterials(), LightSource(), and Sample().
|
private |
Definition at line 189 of file LightSource_module.cc.
Referenced by LightSource(), produce(), and readParametersFromInputFile().
|
private |
Definition at line 243 of file LightSource_module.cc.
Referenced by LightSource(), and produce().
|
private |
Definition at line 237 of file LightSource_module.cc.
Referenced by LightSource(), readParametersFromInputFile(), and Sample().
|
private |
Maximum number of attempted samplings (factor on top of fN
).
Definition at line 240 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 233 of file LightSource_module.cc.
Referenced by LightSource(), readParametersFromInputFile(), and Sample().
|
private |
Definition at line 204 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 194 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 227 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 202 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 222 of file LightSource_module.cc.
Referenced by LightSource().
|
private |
Definition at line 221 of file LightSource_module.cc.
Referenced by LightSource().
|
private |
Names of materials to consider scintillation from.
Definition at line 207 of file LightSource_module.cc.
Referenced by checkMaterials(), LightSource(), and Sample().
|
private |
Definition at line 196 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 195 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 234 of file LightSource_module.cc.
Referenced by LightSource(), readParametersFromInputFile(), and Sample().
|
private |
Definition at line 232 of file LightSource_module.cc.
Referenced by LightSource(), readParametersFromInputFile(), and Sample().
|
private |
Definition at line 229 of file LightSource_module.cc.
Referenced by LightSource(), produce(), readParametersFromInputFile(), and Sample().
|
private |
Definition at line 230 of file LightSource_module.cc.
Referenced by LightSource(), produce(), readParametersFromInputFile(), and Sample().
|
private |
Definition at line 231 of file LightSource_module.cc.
Referenced by LightSource(), produce(), readParametersFromInputFile(), and Sample().
|
private |
Definition at line 200 of file LightSource_module.cc.
Referenced by LightSource(), and produce().
|
private |
Definition at line 228 of file LightSource_module.cc.
Referenced by LightSource(), readParametersFromInputFile(), and Sample().
|
private |
Definition at line 203 of file LightSource_module.cc.
Referenced by LightSource(), and Sample().
|
private |
Definition at line 214 of file LightSource_module.cc.
Referenced by LightSource(), and produce().
|
private |
Definition at line 220 of file LightSource_module.cc.
|
private |
Definition at line 223 of file LightSource_module.cc.
Referenced by LightSource().
|
private |
Definition at line 180 of file LightSource_module.cc.
|
private |
Definition at line 216 of file LightSource_module.cc.
Referenced by LightSource().
|
private |
Definition at line 210 of file LightSource_module.cc.
Referenced by LightSource().
|
private |
Definition at line 211 of file LightSource_module.cc.
Referenced by LightSource().
|
private |
Definition at line 212 of file LightSource_module.cc.
Referenced by LightSource().
|
staticprivate |
Definition at line 185 of file LightSource_module.cc.
Referenced by LightSource(), and produce().
|
staticprivate |
Definition at line 184 of file LightSource_module.cc.
Referenced by Sample().
|
staticprivate |
Definition at line 186 of file LightSource_module.cc.
Referenced by LightSource(), and produce().
|
staticprivate |
Definition at line 183 of file LightSource_module.cc.