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) {
178 double normalize = 1.0;
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) {
199 double normalize = 0.4498;
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.";
const TGeoNode * Node() const
Returns the ROOT object describing the detector geometry.
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
bool fFullSimChannelConvert
unsigned int NOpHardwareChannels(int opDet) const
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int OpChannel(int detNum, int hardwareChannel) const
Convert detector number and hardware channel to unique channel.
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
float Energy
Scintillation photon energy [GeV].
virtual float wavelength(double energy) const