All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DefaultOpDetResponse_service.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // \file DefaultOpDetResponse_service.cc
4 //
5 ////////////////////////////////////////////////////////////////////////
6 
10 
11 #include "art/Framework/Services/Registry/ServiceDefinitionMacros.h"
12 #include "messagefacility/MessageLogger/MessageLogger.h"
13 
14 #include <cassert>
15 
16 namespace opdet
17 {
19  public:
20 
21  DefaultOpDetResponse(fhicl::ParameterSet const& pset);
22 
23  private:
24 
25  void doReconfigure(fhicl::ParameterSet const& p) override;
26  bool doDetected(int OpChannel, const sim::OnePhoton& Phot, int &newOpChannel) const override;
27  bool doDetectedLite(int OpChannel, int &newOpChannel) const override;
28 
29  }; // class DefaultOpDetResponse
30 
31 }
32 
33 DECLARE_ART_SERVICE_INTERFACE_IMPL(opdet::DefaultOpDetResponse, opdet::OpDetResponseInterface, LEGACY)
34 
35 namespace opdet
36 {
37  //--------------------------------------------------------------------
38  DefaultOpDetResponse::DefaultOpDetResponse(fhicl::ParameterSet const& pset)
39  {
40  this->doReconfigure(pset);
41  }
42 
43  //--------------------------------------------------------------------
44  void DefaultOpDetResponse::doReconfigure(fhicl::ParameterSet const& pset)
45  {
46  auto const* LarProp = lar::providerFrom<detinfo::LArPropertiesService>();
47 
48  if ( LarProp->ScintPreScale() < 1 ) {
49  mf::LogWarning("DefaultOpDetResponse_service") << "A prescale of " << LarProp->ScintPreScale() << " has been applied during optical MC production, "
50  << "but DefaultOpDetResponse does not include any QE so this effect is not being corrected out.";
51  assert(false);
52  }
53 
54  }
55 
56 
57  //--------------------------------------------------------------------
58  bool DefaultOpDetResponse::doDetected(int OpChannel, const sim::OnePhoton& /*Phot*/, int &newOpChannel) const
59  {
60  newOpChannel = OpChannel;
61  return true;
62  }
63 
64  //--------------------------------------------------------------------
65  bool DefaultOpDetResponse::doDetectedLite(int OpChannel, int &newOpChannel) const
66  {
67  newOpChannel = OpChannel;
68  return true;
69  }
70 
71 } // namespace
72 
73 DEFINE_ART_SERVICE_INTERFACE_IMPL(opdet::DefaultOpDetResponse, opdet::OpDetResponseInterface)
74 
bool doDetectedLite(int OpChannel, int &newOpChannel) const override
Utilities related to art service access.
void doReconfigure(fhicl::ParameterSet const &p) override
pdgs p
Definition: selectors.fcl:22
All information of a photon entering the sensitive optical detector volume.
Definition: SimPhotons.h:64
bool doDetected(int OpChannel, const sim::OnePhoton &Phot, int &newOpChannel) const override
DefaultOpDetResponse(fhicl::ParameterSet const &pset)