LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
OpDetResponseInterface.h
Go to the documentation of this file.
1 // \file OpDetResponse.h
3 //
4 // \brief service containing information about the response of optical detectors
5 //
6 // \author ahimmel@phy.duke.edu
7 //
9 
10 #ifndef OPDET_RESPONSE_INTERFACE_H
11 #define OPDET_RESPONSE_INTERFACE_H
12 
13 // LArSoft includes
15 namespace sim {
16  struct OnePhoton;
17 }
18 
19 // ART includes
22 namespace fhicl {
23  class ParameterSet;
24 }
25 
26 namespace opdet {
28  public:
29  virtual ~OpDetResponseInterface() = default;
30 
31  virtual void reconfigure(fhicl::ParameterSet const& p);
32 
33  virtual int NOpChannels() const;
34 
35  // Can only uniquely go from readout to geometry since
36  // one geometrical channel goes to multiple readout channels
37  virtual int readoutToGeoChannel(int readoutChannel) const;
38 
39  virtual bool detected(int OpChannel, const sim::OnePhoton& Phot, int& newOpChannel) const;
40  virtual bool detected(int OpChannel, const sim::OnePhoton& Phot) const;
41  virtual bool detectedLite(int OpChannel, int& newOpChannel) const;
42  virtual bool detectedLite(int OpChannel) const;
43 
44  virtual float wavelength(double energy) const;
45 
46  private:
47  virtual void doReconfigure(fhicl::ParameterSet const& p) = 0;
48 
49  virtual int doNOpChannels() const;
50  virtual int doReadoutToGeoChannel(int readoutChannel) const;
51 
52  virtual bool doDetected(int OpChannel, const sim::OnePhoton& Phot, int& newOpChannel) const = 0;
53  virtual bool doDetectedLite(int OpChannel, int& newOpChannel) const = 0;
54 
55  }; // class OpDetResponse
56 
57  //-------------------------------------------------------------------------------------------------------------
58  inline void OpDetResponseInterface::reconfigure(fhicl::ParameterSet const& p)
59  {
60  doReconfigure(p);
61  }
62 
63  //-------------------------------------------------------------------------------------------------------------
64  inline int OpDetResponseInterface::NOpChannels() const
65  {
66  return doNOpChannels();
67  }
68 
69  //-------------------------------------------------------------------------------------------------------------
70  inline int OpDetResponseInterface::doNOpChannels() const
71  {
72  // By default return the number of detector channels
74  return geom->NOpChannels();
75  }
76 
77  //-------------------------------------------------------------------------------------------------------------
78  inline int OpDetResponseInterface::readoutToGeoChannel(int readoutChannel) const
79  {
80  return doReadoutToGeoChannel(readoutChannel);
81  }
82 
83  //-------------------------------------------------------------------------------------------------------------
84  inline int OpDetResponseInterface::doReadoutToGeoChannel(int readoutChannel) const
85  {
86  // Pass this call off to the geometry service
88  return geom->OpDetFromOpChannel(readoutChannel);
89  }
90 
91  //-------------------------------------------------------------------------------------------------------------
92  inline bool OpDetResponseInterface::detected(int OpChannel,
93  const sim::OnePhoton& Phot,
94  int& newOpChannel) const
95  {
96  return doDetected(OpChannel, Phot, newOpChannel);
97  }
98 
99  //-------------------------------------------------------------------------------------------------------------
100  inline bool OpDetResponseInterface::detected(int OpChannel, const sim::OnePhoton& Phot) const
101  {
102  int newOpChannel;
103  return doDetected(OpChannel, Phot, newOpChannel);
104  }
105 
106  //-------------------------------------------------------------------------------------------------------------
107  inline bool OpDetResponseInterface::detectedLite(int OpChannel, int& newOpChannel) const
108  {
109  return doDetectedLite(OpChannel, newOpChannel);
110  }
111 
112  //-------------------------------------------------------------------------------------------------------------
113  inline bool OpDetResponseInterface::detectedLite(int OpChannel) const
114  {
115  int newOpChannel;
116  return doDetectedLite(OpChannel, newOpChannel);
117  }
118 
119  //-------------------------------------------------------------------------------------------------------------
120  inline float OpDetResponseInterface::wavelength(double energy) const
121  {
122  return (2.0 * 3.142) * 0.000197 / energy;
123  }
124 
125 } //namespace opdet
126 
128 
129 #endif //OPDET_RESPONSE_H
All information of a photon entering the sensitive optical detector volume.
Definition: SimPhotons.h:60
unsigned int NOpChannels() const
Number of electronics channels for all the optical detectors.
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
parameter set interface
double energy
Definition: plottest35.C:25
Monte Carlo Simulation.
#define DECLARE_ART_SERVICE_INTERFACE(svc, scope)
art framework interface to geometry description