CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SpaceVoxel.h
Go to the documentation of this file.
1 #ifndef SPACEVOXEL_HH_
2 #define SPACEVOXEL_HH_
3 #include <iostream>
4 #include <boost/shared_ptr.hpp>
5 #include <string>
6 
7 namespace pftools {
8 
15 class SpaceVoxel {
16 public:
17  /*
18  * Constructs a SpaceVoxel over the specified region.
19  *
20  * Upper edges are exclusive; Lower edges are inclusive.
21  *
22  * If any of XXXBegin == XXXEnd, then this criterion is ignored and the corresponding
23  * containsXXX(y) will return true.
24  */
25  SpaceVoxel(double etaBegin = 0, double etaEnd = 0, double phiBegin = 0,
26  double phiEnd = 0, double energyBegin = 0, double energyEnd = 0, bool ecalValid = true, bool hcalValid = true);
27 
28 
29  virtual ~SpaceVoxel();
30 
31  virtual bool contains(const double& eta, const double& phi,
32  const double& energy) const;
33 
34  virtual bool contains(const double& eta, const double& phi,
35  const double& energy, const bool& ecalValid, const bool& hcalValid) const;
36 
37  virtual bool containsEta(const double& eta) const;
38 
39  virtual bool containsPhi(const double& phi) const;
40 
41  virtual bool containsEnergy(const double& energy) const;
42 
43  double minEnergy() const {
44  return myEnergyMin;
45  }
46 
47  double maxEnergy() const {
48  return myEnergyMax;
49  }
50 
51  virtual bool ecalValid() const {
52  return ecalValid_;
53  }
54 
55  virtual bool hcalValid() const {
56  return hcalValid_;
57  }
58 
59  void print(std::ostream& s) const;
60 
61  void printMsg() {
62  std::cout << "Hello!\n";
63  }
64 
65 
66  //Prints this SpaceVoxel's name into the supplied string
67  void getName(std::string& s) const;
68 
69  friend std::ostream& operator<<(std::ostream& s,
70  const pftools::SpaceVoxel& sv);
71 
72  bool operator()(const SpaceVoxel& sv1, const SpaceVoxel& sv2) ;
73 
74  bool operator()(const boost::shared_ptr<SpaceVoxel>& sv1, const boost::shared_ptr<SpaceVoxel>& sv2) ;
75 
76 
77 private:
78  double myEtaMin;
79  double myEtaMax;
80  double myPhiMin;
81  double myPhiMax;
82  double myEnergyMin;
83  double myEnergyMax;
84  bool ecalValid_;
85  bool hcalValid_;
86 
87 };
88 
89 typedef boost::shared_ptr<SpaceVoxel> SpaceVoxelPtr;
90 
91 std::ostream& operator<<(std::ostream& s, const pftools::SpaceVoxel& sv);
92 
93 }
94 #endif /*SPACEVOXEL_HH_*/
virtual bool ecalValid() const
Definition: SpaceVoxel.h:51
bool operator()(const SpaceVoxel &sv1, const SpaceVoxel &sv2)
Definition: SpaceVoxel.cc:97
friend std::ostream & operator<<(std::ostream &s, const pftools::SpaceVoxel &sv)
virtual bool containsPhi(const double &phi) const
Definition: SpaceVoxel.cc:46
A multi-dimensional volume element to subdivide the detector into different calibration regions...
Definition: SpaceVoxel.h:15
SpaceVoxel(double etaBegin=0, double etaEnd=0, double phiBegin=0, double phiEnd=0, double energyBegin=0, double energyEnd=0, bool ecalValid=true, bool hcalValid=true)
Definition: SpaceVoxel.cc:6
void print(std::ostream &s) const
Definition: SpaceVoxel.cc:65
void getName(std::string &s) const
Definition: SpaceVoxel.cc:76
virtual ~SpaceVoxel()
Definition: SpaceVoxel.cc:19
double maxEnergy() const
Definition: SpaceVoxel.h:47
Geom::Phi< T > phi() const
virtual bool containsEta(const double &eta) const
Definition: SpaceVoxel.cc:37
double minEnergy() const
Definition: SpaceVoxel.h:43
virtual bool hcalValid() const
Definition: SpaceVoxel.h:55
tuple cout
Definition: gather_cfg.py:121
std::ostream & operator<<(std::ostream &s, const Calibratable &calib_)
Definition: Calibratable.cc:6
virtual bool contains(const double &eta, const double &phi, const double &energy) const
Definition: SpaceVoxel.cc:22
virtual bool containsEnergy(const double &energy) const
Definition: SpaceVoxel.cc:56
boost::shared_ptr< SpaceVoxel > SpaceVoxelPtr
Definition: SpaceVoxel.h:89