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 Member Functions | |
LightSource (fhicl::ParameterSet const &pset) | |
void | produce (art::Event &evt) |
void | beginRun (art::Run &run) |
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 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 |
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 () |
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 129 of file LightSource_module.cc.
|
explicit |
Definition at line 268 of file LightSource_module.cc.
|
virtual |
Reimplemented from art::EDProducer.
Definition at line 376 of file LightSource_module.cc.
|
private |
Throws an exception if any of the configured materials is not present.
Definition at line 548 of file LightSource_module.cc.
|
virtual |
Implements art::EDProducer.
Definition at line 385 of file LightSource_module.cc.
|
private |
Reads from fInputFile
all other parameters in one line.
ifstream::good()
). Definition at line 619 of file LightSource_module.cc.
|
private |
Definition at line 459 of file LightSource_module.cc.
|
private |
Central position of source [cm].
Definition at line 229 of file LightSource_module.cc.
|
private |
Definition at line 220 of file LightSource_module.cc.
|
private |
Definition at line 194 of file LightSource_module.cc.
|
private |
Definition at line 248 of file LightSource_module.cc.
|
private |
Definition at line 200 of file LightSource_module.cc.
|
private |
Definition at line 193 of file LightSource_module.cc.
|
private |
Definition at line 204 of file LightSource_module.cc.
|
private |
Definition at line 245 of file LightSource_module.cc.
|
private |
Geometry service provider (cached).
Definition at line 249 of file LightSource_module.cc.
|
private |
Definition at line 192 of file LightSource_module.cc.
|
private |
Definition at line 246 of file LightSource_module.cc.
|
private |
Definition at line 240 of file LightSource_module.cc.
|
private |
Maximum number of attempted samplings (factor on top of fN
).
Definition at line 243 of file LightSource_module.cc.
|
private |
Definition at line 236 of file LightSource_module.cc.
|
private |
Definition at line 207 of file LightSource_module.cc.
|
private |
Definition at line 197 of file LightSource_module.cc.
|
private |
Definition at line 230 of file LightSource_module.cc.
|
private |
Definition at line 205 of file LightSource_module.cc.
|
private |
Definition at line 225 of file LightSource_module.cc.
|
private |
Definition at line 224 of file LightSource_module.cc.
|
private |
Names of materials to consider scintillation from.
Definition at line 210 of file LightSource_module.cc.
|
private |
Definition at line 199 of file LightSource_module.cc.
|
private |
Definition at line 198 of file LightSource_module.cc.
|
private |
Definition at line 237 of file LightSource_module.cc.
|
private |
Definition at line 235 of file LightSource_module.cc.
|
private |
Definition at line 232 of file LightSource_module.cc.
|
private |
Definition at line 233 of file LightSource_module.cc.
|
private |
Definition at line 234 of file LightSource_module.cc.
|
private |
Definition at line 203 of file LightSource_module.cc.
|
private |
Definition at line 231 of file LightSource_module.cc.
|
private |
Definition at line 206 of file LightSource_module.cc.
|
private |
Definition at line 217 of file LightSource_module.cc.
|
private |
Definition at line 223 of file LightSource_module.cc.
|
private |
Definition at line 226 of file LightSource_module.cc.
|
private |
Definition at line 183 of file LightSource_module.cc.
|
private |
Definition at line 219 of file LightSource_module.cc.
|
private |
Definition at line 213 of file LightSource_module.cc.
|
private |
Definition at line 214 of file LightSource_module.cc.
|
private |
Definition at line 215 of file LightSource_module.cc.
|
staticprivate |
Definition at line 188 of file LightSource_module.cc.
|
staticprivate |
Definition at line 187 of file LightSource_module.cc.
|
staticprivate |
Definition at line 189 of file LightSource_module.cc.
|
staticprivate |
Definition at line 186 of file LightSource_module.cc.