MicrobooneOpDetResponse_service.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // \file MicrobooneOpDetResponse_service.cc
4 //
5 ////////////////////////////////////////////////////////////////////////
6 
9 
11 
12 namespace opdet{
13 
14 
15  //--------------------------------------------------------------------
17  {
18  this->doReconfigure(pset);
19  }
20 
21  //--------------------------------------------------------------------
23  {
24  fQE= pset.get<double>("QuantumEfficiency");
25  //double tempfQE= pset.get<double>("QuantumEfficiency");
26  fWavelengthCutLow= pset.get<double>("WavelengthCutLow");
27  fWavelengthCutHigh= pset.get<double>("WavelengthCutHigh");
28 
29  /**
30  * Don't apply QE here. It is applied in the uboone
31  * electronics simulation.
32  **
33  // Correct out the prescaling applied during simulation
34  auto const* LarProp = lar::providerFrom<detinfo::LArPropertiesService>();
35  fQE = tempfQE / LarProp->ScintPreScale();
36 
37  if (fQE > 1.0001 ) {
38  mf::LogWarning("MicrobooneOpDetResponse_service") << "Quantum efficiency set in OpDetResponse_service, " << tempfQE
39  << " is too large. It is larger than the prescaling applied during simulation, "
40  << LarProp->ScintPreScale()
41  << ". Final QE must be equalt to or smaller than the QE applied at simulation time.";
42  assert(false);
43  }
44  **/
45  }
46 
47 
48  //--------------------------------------------------------------------
49  bool MicrobooneOpDetResponse::doDetected(int OpChannel, const sim::OnePhoton& Phot, int &newOpChannel) const
50  {
51 
52  newOpChannel = OpChannel;
53 
54  /**
55  * Don't apply QE here. It is applied in the uboone
56  * electronics simulation.
57  **
58  // Check QE
59  if ( CLHEP::RandFlat::shoot(1.0) > fQE ) return false;
60  **/
61 
62  double wavel = wavelength(Phot.Energy);
63  // Check wavelength acceptance
64  if (wavel < fWavelengthCutLow) return false;
65  if (wavel > fWavelengthCutHigh) return false;
66 
67  return true;
68  }
69 
70  //--------------------------------------------------------------------
71  bool MicrobooneOpDetResponse::doDetectedLite(int OpChannel, int &newOpChannel) const
72  {
73  newOpChannel = OpChannel;
74 
75  /**
76  * Don't apply QE here. It is applied in the uboone
77  * electronics simulation.
78  **
79  // Check QE
80  if ( CLHEP::RandFlat::shoot(1.0) > fQE ) return false;
81  **/
82 
83  return true;
84  }
85 
86 
87 
88 } // namespace
89 
Index OpChannel(Index detNum, Index channel)
All information of a photon entering the sensitive optical detector volume.
Definition: SimPhotons.h:64
MicrobooneOpDetResponse(fhicl::ParameterSet const &pset)
Simulation objects for optical detectors.
T get(std::string const &key) const
Definition: ParameterSet.h:271
virtual bool doDetected(int OpChannel, const sim::OnePhoton &Phot, int &newOpChannel) const
virtual void doReconfigure(fhicl::ParameterSet const &p)
float Energy
Scintillation photon energy [GeV].
Definition: SimPhotons.h:82
virtual float wavelength(double energy) const
virtual bool doDetectedLite(int OpChannel, int &newOpChannel) const
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)