LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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
14 //#include "OpticalDetectorData/OpticalTypes.h"
17 
18 // ART includes
19 #include "fhiclcpp/ParameterSet.h"
23 
24 #include "CLHEP/Random/RandFlat.h"
25 
26 
27 namespace opdet
28 {
30  public:
31 
32  virtual ~OpDetResponseInterface() = default;
33 
34  virtual void reconfigure(fhicl::ParameterSet const& p);
35 
36  virtual int NOpChannels() const;
37 
38  // Can only uniquely go from readout to geometry since
39  // one geometrical channel goes to multiple readout channels
40  virtual int readoutToGeoChannel(int readoutChannel) const;
41 
42  virtual bool detected(int OpChannel, const sim::OnePhoton& Phot, int &newOpChannel) const;
43  virtual bool detected(int OpChannel, const sim::OnePhoton& Phot) const;
44  virtual bool detectedLite(int OpChannel, int &newOpChannel) const;
45  virtual bool detectedLite(int OpChannel) const;
46 
47  virtual float wavelength(double energy) const;
48 
49  private:
50  virtual void doReconfigure(fhicl::ParameterSet const& p) = 0;
51 
52  virtual int doNOpChannels() const;
53  virtual int doReadoutToGeoChannel(int readoutChannel) const;
54 
55  virtual bool doDetected(int OpChannel, const sim::OnePhoton& Phot, int &newOpChannel) const = 0;
56  virtual bool doDetectedLite(int OpChannel, int &newOpChannel) const = 0;
57 
58  }; // class OpDetResponse
59 
60 
61  //-------------------------------------------------------------------------------------------------------------
63  {
64  doReconfigure(p);
65  }
66 
67 
68 
69 
70  //-------------------------------------------------------------------------------------------------------------
72  {
73  return doNOpChannels();
74  }
75 
76  //-------------------------------------------------------------------------------------------------------------
78  {
79  // By default return the number of detector channels
81  return geom->NOpChannels();
82  }
83 
84  //-------------------------------------------------------------------------------------------------------------
85  inline int OpDetResponseInterface::readoutToGeoChannel(int readoutChannel) const
86  {
87  return doReadoutToGeoChannel(readoutChannel);
88  }
89 
90  //-------------------------------------------------------------------------------------------------------------
91  inline int OpDetResponseInterface::doReadoutToGeoChannel(int readoutChannel) const
92  {
93  // Pass this call off to the geometry service
95  return geom->OpDetFromOpChannel(readoutChannel);
96  }
97 
98 
99 
100 
101  //-------------------------------------------------------------------------------------------------------------
102  inline bool OpDetResponseInterface::detected(int OpChannel, const sim::OnePhoton& Phot, int &newOpChannel) const
103  {
104  return doDetected(OpChannel, Phot, newOpChannel);
105  }
106 
107  //-------------------------------------------------------------------------------------------------------------
108  inline bool OpDetResponseInterface::detected(int OpChannel, const sim::OnePhoton& Phot) const
109  {
110  int newOpChannel;
111  return doDetected(OpChannel, Phot, newOpChannel);
112  }
113 
114  //-------------------------------------------------------------------------------------------------------------
115  inline bool OpDetResponseInterface::detectedLite(int OpChannel, int &newOpChannel) const
116  {
117  return doDetectedLite(OpChannel, newOpChannel);
118  }
119 
120  //-------------------------------------------------------------------------------------------------------------
121  inline bool OpDetResponseInterface::detectedLite(int OpChannel) const
122  {
123  int newOpChannel;
124  return doDetectedLite(OpChannel, newOpChannel);
125  }
126 
127  //-------------------------------------------------------------------------------------------------------------
128  inline float OpDetResponseInterface::wavelength(double energy) const
129  {
130  return (2.0*3.142)*0.000197/energy;
131  }
132 
133 } //namespace opdet
134 
135 
137 
138 #endif //OPDET_RESPONSE_H
virtual void reconfigure(fhicl::ParameterSet const &p)
virtual bool detected(int OpChannel, const sim::OnePhoton &Phot, int &newOpChannel) const
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.
virtual void doReconfigure(fhicl::ParameterSet const &p)=0
contains objects relating to OpDet hits
double energy
Definition: plottest35.C:25
virtual ~OpDetResponseInterface()=default
virtual bool doDetected(int OpChannel, const sim::OnePhoton &Phot, int &newOpChannel) const =0
virtual bool detectedLite(int OpChannel, int &newOpChannel) const
virtual bool doDetectedLite(int OpChannel, int &newOpChannel) const =0
virtual int doReadoutToGeoChannel(int readoutChannel) const
#define DECLARE_ART_SERVICE_INTERFACE(svc, scope)
Definition: ServiceMacros.h:99
virtual int readoutToGeoChannel(int readoutChannel) const
virtual float wavelength(double energy) const
art framework interface to geometry description