|
| PhotonLibraryPropagation (fhicl::ParameterSet const &) |
|
| PhotonLibraryPropagation (PhotonLibraryPropagation const &)=delete |
|
| PhotonLibraryPropagation (PhotonLibraryPropagation &&)=delete |
|
PhotonLibraryPropagation & | operator= (PhotonLibraryPropagation const &)=delete |
|
PhotonLibraryPropagation & | operator= (PhotonLibraryPropagation &&)=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) |
|
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) |
|
Fast simulation of propagating the photons created from SimEnergyDeposits.
This module does a fast simulation of propagating the photons created from SimEnergyDeposits, which is the Geant4 output after each step, to each of the optical detectors. This simulation is done using the PhotonLibrary, which stores the visibilities of each optical channel with respect to each optical voxel in the TPC volume, to avoid propagating single photons using Geant4. At the end of this module a collection of the propagated photons either as sim::SimPhotonsLite
or as sim::SimPhotons
is placed into the art event.
Keep in mind that at this stage the LArG4 main module is not capable of running the full optical simulation, because the necessary code has not yet been written.
In the future when the PhotonLibrary has the propagation time included, it could be possible to enhance sim::SimPhotons
and sim::SimPhotonsLite
to contain the propagation time. At this point the time recorded for the photon is the creation time of the photon.
The steps this module takes are:
- to take
sim::SimEnergyDeposits
produced by larg4Main,
- use Ionisation and Scintillation to calculate the amount of scintillated photons,
- use the PhotonLibrary (visibilities) to determine the amount of visible photons at each optical channel,
- visible photons = the amount of scintillated photons calculated times the visibility at the middle of the Geant4 step for a given optical channel.
- and if
sim::SimPhotonsLite
produced:
- since a
sim::SimPhotonsLite
only keeps a set of times with the number of photons produced at each time for a given OpChannel number:
- for each time (as an integer in [ns]) photons are produced along the Geant4 step (taking into account the rise time and decay time of the fast and slow components of the scintillation process),
- count the amount of photons emitted at that time.
the total amount of visible photons produced during the current Geant4 step equals the sum of counts for each time.
- the total amount of visible photons produced during the current Geant4 step is determined by throwing a random number from a Poisson distribution with a mean of the amount of visible photons calculated above.
and if sim::SimPhotons
produced:
- since a
sim::SimPhotons
keeps a collection of photons (sim::OnePhoton
) for a given OpChannel number:
- each single photon produced by this algorithm is just a copy containing the same information about:
- energy (set to a constant value = 9.7e-6, which is equivalent to a wavelength of 128 nm, it should actually be 126.6 nm!!),
- initial position,
- time (as an integer in [ns]) the photon is produced along the Geant4 Step (taking into account the rise time and decay time of the fast and slow components of the scintillation process),
- the total amount of photon copies produced during the current Geant4 step is determined by throwing a random number from a Poisson distribution with a mean of the amount of visible photons calculated above.
This module should only be run for the fast optical simulation even though it can create sim::SimPhotonsLite
and sim::SimPhotons
as data products. If there is need to create sim::SimPhotons
, there are some considerations you must be aware of. Since the amount of sim::SimPhotons
produced even at low energies and in small geometries quickly exceeds the memory capacity of the job, right now it is actually impossible to produce sim::SimPhotons
for any realistic geometry. A possible way around the problem is to implement a scaling of the produced sim::SimPhotons
, to only produce a fraction of them.
Definition at line 141 of file PhotonLibraryPropagation_module.cc.
void phot::PhotonLibraryPropagation::produce |
( |
art::Event & |
e | ) |
|
|
overrideprivatevirtual |
Implements art::EDProducer.
Definition at line 188 of file PhotonLibraryPropagation_module.cc.
References larg4::ISCalcSeparate::CalcIonAndScint(), DEFINE_ART_MODULE, util::end(), sim::SimEnergyDeposit::End(), sim::OnePhoton::Energy, fDoSlowComponent, fEDepTags, fISAlg, fPhotonEngine, fRiseTimeFast, fRiseTimeSlow, fScintTimeEngine, art::ProductRetriever::getValidHandle(), sim::OnePhoton::InitialPosition, sim::SimEnergyDeposit::MidPoint(), n, art::Event::put(), detinfo::LArProperties::ScintFastTimeConst(), detinfo::LArProperties::ScintSlowTimeConst(), sim::OnePhoton::SetInSD, sim::SimEnergyDeposit::T0(), sim::OnePhoton::Time, and sim::LArG4Parameters::UseLitePhotons().
192 auto const* larp = lar::providerFrom<detinfo::LArPropertiesService>();
196 auto const nOpChannels = pvs->NOpChannels();
197 unique_ptr<vector<sim::SimPhotons>> photCol{
new vector<sim::SimPhotons>{}};
198 auto& photonCollection{*photCol};
199 photonCollection.resize(nOpChannels);
200 unique_ptr<vector<sim::SimPhotonsLite>> photLiteCol{
new vector<sim::SimPhotonsLite>{}};
201 auto& photonLiteCollection{*photLiteCol};
202 photonLiteCollection.resize(nOpChannels);
203 for (
unsigned int i = 0; i < nOpChannels; ++i) {
204 photonLiteCollection[i].OpChannel = i;
205 photonCollection[i].SetChannel(i);
207 vector<vector<sim::SimEnergyDeposit>
const*> edep_vecs;
209 auto const& edep_handle = e.
getValidHandle<vector<sim::SimEnergyDeposit>>(label);
210 edep_vecs.push_back(edep_handle);
212 for (
auto const& edeps : edep_vecs) {
213 for (
auto const&
edep : *edeps) {
215 auto const& p =
edep.MidPoint();
216 auto const& Visibilities = pvs->GetAllVisibilities(p);
219 <<
"There is no entry in the PhotonLibrary for this position in space. " 225 double nphot =
static_cast<int>(isCalcData.numPhotons);
227 double nphot_fast =
static_cast<int>(GetScintYield(
edep, *larp) * nphot);
229 double nphot_slow = nphot - nphot_fast;
230 for (
unsigned int channel = 0; channel < nOpChannels; ++channel) {
231 auto visibleFraction = Visibilities[channel];
232 if (visibleFraction == 0.0) {
237 if (nphot_fast > 0) {
239 auto n =
static_cast<int>(randpoisphot.fire(nphot_fast * visibleFraction));
240 for (
long i = 0; i <
n; ++i) {
243 larp->ScintFastTimeConst(),
245 ++photonLiteCollection[channel].DetectedPhotons[time];
250 auto n = randpoisphot.fire(nphot_slow * visibleFraction);
251 for (
long i = 0; i <
n; ++i) {
254 larp->ScintSlowTimeConst(),
256 ++photonLiteCollection[channel].DetectedPhotons[time];
265 if (nphot_fast > 0) {
267 auto n = randpoisphot.fire(nphot_fast * visibleFraction);
272 GetScintTime(
fRiseTimeFast, larp->ScintFastTimeConst(), randflatscinttime);
274 photonCollection[channel].insert(photonCollection[channel].
end(), n, photon);
279 auto n = randpoisphot.fire(nphot_slow * visibleFraction);
284 GetScintTime(
fRiseTimeSlow, larp->ScintSlowTimeConst(), randflatscinttime);
286 photonCollection[channel].insert(photonCollection[channel].
end(), n, photon);
295 e.
put(move(photLiteCol));
299 e.
put(move(photCol));
All information of a photon entering the sensitive optical detector volume.
CLHEP::HepRandomEngine & fScintTimeEngine
ISCalcData CalcIonAndScint(detinfo::DetectorPropertiesData const &detProp, sim::SimEnergyDeposit const &edep) override
geo::Point_t InitialPosition
Scintillation position in world coordinates [cm].
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
larg4::ISCalcSeparate fISAlg
vector< art::InputTag > fEDepTags
CLHEP::HepRandomEngine & fPhotonEngine
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
bool SetInSD
Whether the photon reaches the sensitive detector.
float Energy
Scintillation photon energy [GeV].
cet::coded_exception< error, detail::translate > exception
bool UseLitePhotons() const