All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MicrobooneOpDetResponse_service.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // \file MicrobooneOpDetResponse_service.cc
4 //
5 ////////////////////////////////////////////////////////////////////////
6 
7 #include "art/Framework/Services/Registry/ServiceDefinitionMacros.h"
8 
10 
12 
13 namespace opdet
14 {
16  public:
17 
18  MicrobooneOpDetResponse(fhicl::ParameterSet const& pset);
19 
20  private:
21 
22  void doReconfigure(fhicl::ParameterSet const& p) override;
23  bool doDetected(int OpChannel, const sim::OnePhoton& Phot, int &newOpChannel) const override;
24  bool doDetectedLite(int OpChannel, int &newOpChannel) const override;
25 
26  float fQE; // Quantum efficiency of tube
27 
28  float fWavelengthCutLow; // Sensitive wavelength range
30  }; // class MicrobooneOpDetResponse
31 }
32 
33 DECLARE_ART_SERVICE_INTERFACE_IMPL(opdet::MicrobooneOpDetResponse, opdet::OpDetResponseInterface, LEGACY)
34 
35 namespace opdet
36 {
37  //--------------------------------------------------------------------
38  MicrobooneOpDetResponse::MicrobooneOpDetResponse(fhicl::ParameterSet const& pset)
39  {
40  this->doReconfigure(pset);
41  }
42 
43  //--------------------------------------------------------------------
44  void MicrobooneOpDetResponse::doReconfigure(fhicl::ParameterSet const& pset)
45  {
46  fQE= pset.get<double>("QuantumEfficiency");
47  //double tempfQE= pset.get<double>("QuantumEfficiency");
48  fWavelengthCutLow= pset.get<double>("WavelengthCutLow");
49  fWavelengthCutHigh= pset.get<double>("WavelengthCutHigh");
50 
51  /**
52  * Don't apply QE here. It is applied in the uboone
53  * electronics simulation.
54  **
55  // Correct out the prescaling applied during simulation
56  auto const* LarProp = lar::providerFrom<detinfo::LArPropertiesService>();
57  fQE = tempfQE / LarProp->ScintPreScale();
58 
59  if (fQE > 1.0001 ) {
60  mf::LogWarning("MicrobooneOpDetResponse_service") << "Quantum efficiency set in OpDetResponse_service, " << tempfQE
61  << " is too large. It is larger than the prescaling applied during simulation, "
62  << LarProp->ScintPreScale()
63  << ". Final QE must be equalt to or smaller than the QE applied at simulation time.";
64  assert(false);
65  }
66  **/
67  }
68 
69 
70  //--------------------------------------------------------------------
71  bool MicrobooneOpDetResponse::doDetected(int OpChannel, const sim::OnePhoton& Phot, int &newOpChannel) const
72  {
73 
74  newOpChannel = OpChannel;
75 
76  /**
77  * Don't apply QE here. It is applied in the uboone
78  * electronics simulation.
79  **
80  // Check QE
81  if ( CLHEP::RandFlat::shoot(1.0) > fQE ) return false;
82  **/
83 
84  double wavel = wavelength(Phot.Energy);
85  // Check wavelength acceptance
86  if (wavel < fWavelengthCutLow) return false;
87  if (wavel > fWavelengthCutHigh) return false;
88 
89  return true;
90  }
91 
92  //--------------------------------------------------------------------
93  bool MicrobooneOpDetResponse::doDetectedLite(int OpChannel, int &newOpChannel) const
94  {
95  newOpChannel = OpChannel;
96 
97  /**
98  * Don't apply QE here. It is applied in the uboone
99  * electronics simulation.
100  **
101  // Check QE
102  if ( CLHEP::RandFlat::shoot(1.0) > fQE ) return false;
103  **/
104 
105  return true;
106  }
107 
108 } // namespace
109 
110 DEFINE_ART_SERVICE_INTERFACE_IMPL(opdet::MicrobooneOpDetResponse, opdet::OpDetResponseInterface)
pdgs p
Definition: selectors.fcl:22
All information of a photon entering the sensitive optical detector volume.
Definition: SimPhotons.h:64
MicrobooneOpDetResponse(fhicl::ParameterSet const &pset)
void doReconfigure(fhicl::ParameterSet const &p) override
Simulation objects for optical detectors.
bool doDetectedLite(int OpChannel, int &newOpChannel) const override
float Energy
Scintillation photon energy [GeV].
Definition: SimPhotons.h:82
bool doDetected(int OpChannel, const sim::OnePhoton &Phot, int &newOpChannel) const override