29 #include "CLHEP/Random/RandFlat.h" 30 #include "CLHEP/Random/RandPoissonQ.h" 43 class PhotonLibraryPropagation;
78 double GetScintTime(
double scint_time,
double rise_time,
double,
double);
84 produces< std::vector<sim::SimPhotons> >();
86 art::ServiceHandle<rndm::NuRandomService>()->
createEngine(*
this,
"HepJamesRandom",
"scinttime", p,
"SeedScintTime");
133 CLHEP::HepRandomEngine &engine_photon = rng->getEngine(
"photon");
134 CLHEP::RandPoissonQ randpoisphot(engine_photon);
135 CLHEP::HepRandomEngine &engine_scinttime = rng->getEngine(
"scinttime");
136 CLHEP::RandFlat randflatscinttime(engine_scinttime);
138 const size_t NOpChannels = pvs->NOpChannels();
140 double nphot,nphot_fast,nphot_slow;
149 lar::providerFrom<detinfo::DetectorPropertiesService>(),
151 lar::providerFrom<spacecharge::SpaceChargeService>());
153 std::unique_ptr< std::vector<sim::SimPhotons> > photCol (
new std::vector<sim::SimPhotons>);
154 auto & photonCollection(*photCol);
157 std::vector< std::vector<sim::SimEnergyDeposit>
const*> edep_vecs;
160 edep_vecs.push_back(edep_handle);
164 for(
size_t i_op=0; i_op<NOpChannels; ++i_op){
165 photonCollection.emplace_back(i_op);
168 for(
auto const& edeps : edep_vecs){
170 for(
auto const&
edep : *edeps){
186 float const* Visibilities = pvs->GetAllVisibilities(xyz);
194 nphot_fast = yieldRatio*nphot;
197 randflatscinttime(),randflatscinttime());
199 for(
size_t i_op=0; i_op<NOpChannels; ++i_op){
200 auto nph = randpoisphot.fire(nphot_fast*Visibilities[i_op]);
207 photonCollection[i_op].insert(photonCollection[i_op].
end(),nph,photon);
210 nphot_slow = nphot - nphot_fast;
214 randflatscinttime(),randflatscinttime());
216 for(
size_t i_op=0; i_op<NOpChannels; ++i_op){
217 auto nph = randpoisphot.fire(nphot_slow*Visibilities[i_op]);
221 photonCollection[i_op].insert(photonCollection[i_op].
end(),nph,photon);
230 e.
put(std::move(photCol));
235 double r1,
double r2)
239 return -1 * scint_time * std::log(r1);
242 double t = -1.0*scint_time*std::log(1-r1);
244 if ( r2 <= (std::exp(-1.0*t/rise_time)*(1-std::exp(-1.0*t/rise_time))/scint_time/scint_time*(scint_time+rise_time)) )
258 fEDepTags = p.
get< std::vector<art::InputTag> >(
"EDepModuleLabels");
virtual double ElectronScintYieldRatio() const =0
Store parameters for running LArG4.
std::vector< art::InputTag > fEDepTags
virtual double ScintYieldRatio() const =0
double GetScintTime(double scint_time, double rise_time, double, double)
virtual double AlphaScintYieldRatio() const =0
virtual double ScintSlowTimeConst() const =0
virtual double ScintFastTimeConst() const =0
virtual double ProtonScintYieldRatio() const =0
void produce(art::Event &e) override
PhotonLibraryPropagation(fhicl::ParameterSet const &p)
ProductID put(std::unique_ptr< PROD > &&product)
virtual double PionScintYieldRatio() const =0
contains objects relating to OpDet hits
void reconfigure(fhicl::ParameterSet const &p)
base_engine_t & createEngine(seed_t seed)
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
void CalculateIonizationAndScintillation(sim::SimEnergyDeposit const &edep)
An art service to assist in the distribution of guaranteed unique seeds to all engines within an art ...
double NumberScintillationPhotons() const
General LArSoft Utilities.
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
contains information for a single step in the detector simulation
PhotonLibraryPropagation & operator=(PhotonLibraryPropagation const &)=delete
virtual double MuonScintYieldRatio() const =0
larg4::ISCalculationSeparate fISAlg
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
virtual double KaonScintYieldRatio() const =0
virtual bool ScintByParticleType() const =0
double GetScintYield(sim::SimEnergyDeposit const &, detinfo::LArProperties const &)
art framework interface to geometry description
void Initialize(const detinfo::LArProperties *larp, const detinfo::DetectorProperties *detp, const sim::LArG4Parameters *lgp, const spacecharge::SpaceCharge *sce)