CMS 3D CMS Logo

DetectorElement.h
Go to the documentation of this file.
1 #ifndef DETECTORELEMENT_HH_
2 #define DETECTORELEMENT_HH_
3 
4 #include <vector>
5 #include <boost/shared_ptr.hpp>
6 /*
7  * This is a dirty macro that allows you to make vectors of DetectorElements within CINT
8  */
9 //#ifdef __MAKECINT__
10 //#pragma link C++ class std::vector<minimiser::DetectorElement>
11 //#endif
12 //
13 //#ifdef __MAKECINT__
14 //#pragma link C++ class std::vector<minimiser::DetectorElement*>
15 //#endif
16 
19 
20 #include "TH2F.h"
21 #include "TH1F.h"
22 #include <iosfwd>
23 
24 namespace pftools {
25 
36 public:
37 
39 
40  inline DetectorElementType getType() const {
41  return myType;
42  }
43  ;
44 
45  virtual ~DetectorElement();
46 
47  /*
48  * Returns a global detector element calibration.
49  */
50  double getCalib() const {
51  return getCalibCore();
52  }
53 
54  /*
55  * Returns the calibration for this detector element as a function
56  * of eta and phi.
57  */
58  double getCalib(double eta, double phi) const {
59  return getCalibCore(eta, phi);
60  }
61 
62  /*
63  * Set the calibration of this detector element. Must be > 0.
64  */
65  void setCalib(double calib) noexcept(false) {
67  }
68 
69  friend std::ostream& operator<<(std::ostream& s, const DetectorElement& de);
70 
71 
72 private:
73  virtual double getCalibCore() const;
74  virtual double getCalibCore(double eta, double phi) const;
75  virtual void setCalibCore(double calib) noexcept(false);
76 
77  DetectorElement(const DetectorElement& de) = delete;
79  double myCalib;
80 
81 };
82 
83 typedef boost::shared_ptr<DetectorElement> DetectorElementPtr;
84 
85 std::ostream& operator<<(std::ostream& s, const DetectorElement& de);
86 
87 }
88 
89 #endif /*DETECTORELEMENT_HH_*/
void setCalib(double calib) noexcept(false)
type
Definition: HCALResponse.h:21
friend std::ostream & operator<<(std::ostream &s, const DetectorElement &de)
DetectorElementType myType
virtual double getCalibCore() const
#define noexcept
Represents an energy-measuring region of our detector.
DetectorElementType getType() const
virtual void setCalibCore(double calib) noexcept(false)
boost::shared_ptr< DetectorElement > DetectorElementPtr
General option file parser.
Definition: Calibratable.h:15
double getCalib(double eta, double phi) const
DetectorElement(DetectorElementType type, double calib=1.0)
double getCalib() const
Enumerates possible DetectorElement objects.