16 #include "CLHEP/Random/RandFlat.h" 17 #include <boost/algorithm/string.hpp> 38 double tempfQE = pset.
get<
double>(
"QuantumEfficiency");
45 boost::algorithm::to_lower(tmpAxis);
55 boost::algorithm::to_lower(fChannelConversion);
64 auto const *LarProp = lar::providerFrom<detinfo::LArPropertiesService>();
65 fQE = tempfQE / LarProp->ScintPreScale();
68 mf::LogError(
"DUNE35tonOpDetResponse_service") <<
"Quantum efficiency set in OpDetResponse_service, " << tempfQE
69 <<
" is too large. It is larger than the prescaling applied during simulation, " 70 << LarProp->ScintPreScale()
71 <<
". Final QE must be equalt to or smaller than the QE applied at simulation time.";
101 boost::to_lower(detname);
102 if (detname.find(
"bar") != std::string::npos ) pdtype = 0;
103 else if (detname.find(
"fiber") != std::string::npos ) pdtype = 1;
104 else if (detname.find(
"plank") != std::string::npos ) pdtype = 2;
111 if (pdtype == 1) NOpHardwareChannels = 3;
112 if (pdtype == 2) NOpHardwareChannels = 2;
115 newOpChannel = geom->
OpChannel(OpDet, hardwareChannel);
118 newOpChannel = OpDet;
122 if ( CLHEP::RandFlat::shoot(1.0) >
fQE )
return false;
131 TGeoBBox *box = (TGeoBBox*)node->GetVolume()->GetShape();
132 double opdetHalfLength = 0;
133 double sipmDistance = 0;
136 opdetHalfLength = box->GetDX();
140 opdetHalfLength = box->GetDY();
144 opdetHalfLength = box->GetDZ();
156 double lambdaShort = 5.56;
157 double lambdaLong = 44.13;
161 double AttenuationProb = fracShort*exp(-sipmDistance/lambdaShort) + fracLong*exp(-sipmDistance/lambdaLong);
175 if ( CLHEP::RandFlat::shoot(1.0) > AttenuationProb )
return false;
177 else if (pdtype == 1) {
179 double lambda = 14.6;
182 double AttenuationProb = normalize*exp(-sipmDistance/lambda);
196 if ( CLHEP::RandFlat::shoot(1.0) > AttenuationProb )
return false;
198 else if (pdtype == 2) {
200 double lambda = 48.4;
201 double altDistance = 2*opdetHalfLength - sipmDistance;
204 double AttenuationProb = frac*exp(-sipmDistance/lambda) + frac*exp(-altDistance/lambda);
218 if ( CLHEP::RandFlat::shoot(1.0) > AttenuationProb )
return false;
221 mf::LogWarning(
"DUNE35tonOpDetResponse") <<
"OpDet: " << OpDet <<
" is an unknown PD type named: " << detname
222 <<
". Assuming no attenuation.";
245 boost::to_lower(detname);
246 if (detname.find(
"bar") != std::string::npos ) pdtype = 0;
247 else if (detname.find(
"fiber") != std::string::npos ) pdtype = 1;
248 else if (detname.find(
"plank") != std::string::npos ) pdtype = 2;
253 if (pdtype == 1) NOpHardwareChannels = 8;
254 if (pdtype == 2) NOpHardwareChannels = 2;
257 newOpChannel = geom->
OpChannel(OpDet, hardwareChannel);
260 newOpChannel = OpDet;
264 if ( CLHEP::RandFlat::shoot(1.0) >
fQE )
return false;
const TGeoNode * Node() const
Returns the ROOT object describing the detector geometry.
bool fFastSimChannelConvert
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
virtual void doReconfigure(fhicl::ParameterSet const &p)
bool fFullSimChannelConvert
virtual bool doDetected(int OpDet, const sim::OnePhoton &Phot, int &newOpChannel) const
All information of a photon entering the sensitive optical detector volume.
unsigned int NOpHardwareChannels(int opDet) const
std::string fChannelConversion
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int NOpChannels() const
Number of electronics channels for all the optical detectors.
T get(std::string const &key) const
unsigned int NOpDets() const
Number of OpDets in the whole detector.
unsigned int OpChannel(int detNum, int hardwareChannel) const
Convert detector number and hardware channel to unique channel.
Encapsulate the geometry of an optical detector.
virtual bool doDetectedLite(int OpDet, int &newOpChannel) const
Index NOpHardwareChannels(Index opDet)
bool fLightGuideAttenuation
geo::OpticalPoint_t FinalLocalPosition
Where photon enters the optical detector in local coordinates [cm].
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
DUNE35tonOpDetResponse(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
~DUNE35tonOpDetResponse()
float Energy
Scintillation photon energy [GeV].
virtual int doNOpChannels() const
virtual float wavelength(double energy) const
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)