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) |
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.
|
explicit |
Definition at line 270 of file LightSource_module.cc.
void evgen::LightSource::beginRun | ( | art::Run & | run | ) |
Definition at line 378 of file LightSource_module.cc.
|
private |
Throws an exception if any of the configured materials is not present.
Definition at line 550 of file LightSource_module.cc.
void evgen::LightSource::produce | ( | art::Event & | evt | ) |
Definition at line 387 of file LightSource_module.cc.
|
private |
Reads from fInputFile
all other parameters in one line.
ifstream::good()
). Definition at line 621 of file LightSource_module.cc.
|
private |
Definition at line 461 of file LightSource_module.cc.
|
private |
Central position of source [cm].
Definition at line 231 of file LightSource_module.cc.
|
private |
Definition at line 222 of file LightSource_module.cc.
|
private |
Definition at line 196 of file LightSource_module.cc.
|
private |
Definition at line 250 of file LightSource_module.cc.
|
private |
Definition at line 202 of file LightSource_module.cc.
|
private |
Definition at line 195 of file LightSource_module.cc.
|
private |
Definition at line 206 of file LightSource_module.cc.
|
private |
Definition at line 247 of file LightSource_module.cc.
|
private |
Geometry service provider (cached).
Definition at line 251 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 242 of file LightSource_module.cc.
|
private |
Maximum number of attempted samplings (factor on top of fN
).
Definition at line 245 of file LightSource_module.cc.
|
private |
Definition at line 238 of file LightSource_module.cc.
|
private |
Definition at line 209 of file LightSource_module.cc.
|
private |
Definition at line 199 of file LightSource_module.cc.
|
private |
Definition at line 232 of file LightSource_module.cc.
|
private |
Definition at line 207 of file LightSource_module.cc.
|
private |
Definition at line 227 of file LightSource_module.cc.
|
private |
Definition at line 226 of file LightSource_module.cc.
|
private |
Names of materials to consider scintillation from.
Definition at line 212 of file LightSource_module.cc.
|
private |
Definition at line 201 of file LightSource_module.cc.
|
private |
Definition at line 200 of file LightSource_module.cc.
|
private |
Definition at line 239 of file LightSource_module.cc.
|
private |
Definition at line 237 of file LightSource_module.cc.
|
private |
Definition at line 234 of file LightSource_module.cc.
|
private |
Definition at line 235 of file LightSource_module.cc.
|
private |
Definition at line 236 of file LightSource_module.cc.
|
private |
Definition at line 205 of file LightSource_module.cc.
|
private |
Definition at line 233 of file LightSource_module.cc.
|
private |
Definition at line 208 of file LightSource_module.cc.
|
private |
Definition at line 219 of file LightSource_module.cc.
|
private |
Definition at line 225 of file LightSource_module.cc.
|
private |
Definition at line 228 of file LightSource_module.cc.
|
private |
Definition at line 185 of file LightSource_module.cc.
|
private |
Definition at line 221 of file LightSource_module.cc.
|
private |
Definition at line 215 of file LightSource_module.cc.
|
private |
Definition at line 216 of file LightSource_module.cc.
|
private |
Definition at line 217 of file LightSource_module.cc.
|
staticprivate |
Definition at line 190 of file LightSource_module.cc.
|
staticprivate |
Definition at line 189 of file LightSource_module.cc.
|
staticprivate |
Definition at line 191 of file LightSource_module.cc.
|
staticprivate |
Definition at line 188 of file LightSource_module.cc.