CMS 3D CMS Logo

CaloPoint.h
Go to the documentation of this file.
1 #ifndef FastSimulation_CaloGeometryTools_CaloPoint_h
2 #define FastSimulation_CaloGeometryTools_CaloPoint_h
3 /*
4  *
5  * A point belonging to a given detector
6  *
7  */
8 
12 
13 #include <string>
14 
15 //ideally this class should inherit from XYZPoint & CellID
16 
17 class CaloPoint : public math::XYZVector {
18 public:
21 
24  // /// Constructor from DetId, side and position.
25  // CaloPoint(DetId cell, CaloDirection side, const XYZPoint& position);
26  //
27  // /// Constructor side and position
28  // CaloPoint( CaloDirection side, const XYZPoint& position):XYZPoint(position),side_(side){;};
29 
31  CaloPoint(const DetId& cell, CaloDirection side, const XYZPoint& position);
32 
35 
37  CaloPoint(DetId::Detector detector, int subdetn, int layer, const XYZPoint& position);
38 
39  ~CaloPoint() { ; }
41  inline DetId getDetId() const { return cellid_; };
43  inline CaloDirection getSide() const { return side_; };
44 
45  inline bool operator<(const CaloPoint& p) const { return this->mag2() < p.mag2(); };
46 
47  inline void setDetId(DetId::Detector det) { detector_ = det; }
48  inline DetId::Detector whichDetector() const { return detector_; };
49 
50  inline void setSubDetector(int i) { subdetector_ = i; }
51 
53  inline int whichSubDetector() const { return subdetector_; };
54 
55  inline void setLayer(int i) { layer_ = i; }
56 
57  inline int whichLayer() const { return layer_; }
58 
59  // const CaloGeometryHelper * getCalorimeter() const { return myCalorimeter_;}
60 
61 private:
62  // const CaloGeometryHelper * myCalorimeter_;
67  int layer_;
68 
69 public:
71  public:
72  DistanceToVertex(const XYZPoint& vert) : vertex(vert){};
74  bool operator()(const CaloPoint& point1, const CaloPoint& point2) {
75  return ((point1 - vertex).mag2() < (point2 - vertex).mag2());
76  }
77 
78  private:
80  };
81 };
82 #include <iosfwd>
83 std::ostream& operator<<(std::ostream& o, const CaloPoint& cid);
84 
85 #endif
CaloDirection
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
CaloDirection.h
mps_fire.i
i
Definition: mps_fire.py:428
CaloPoint::side_
CaloDirection side_
Definition: CaloPoint.h:64
CaloPoint::setSubDetector
void setSubDetector(int i)
Definition: CaloPoint.h:50
CaloPoint::layer_
int layer_
Definition: CaloPoint.h:67
CaloPoint::whichSubDetector
int whichSubDetector() const
watch out, only valid in ECAL and preshower
Definition: CaloPoint.h:53
CaloPoint::DistanceToVertex::~DistanceToVertex
~DistanceToVertex()
Definition: CaloPoint.h:73
CaloPoint::XYZPoint
math::XYZVector XYZPoint
Definition: CaloPoint.h:20
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
CaloPoint::operator<
bool operator<(const CaloPoint &p) const
Definition: CaloPoint.h:45
CaloPoint::getDetId
DetId getDetId() const
returns the cellID
Definition: CaloPoint.h:41
DetId
Definition: DetId.h:17
CaloPoint::detector_
DetId::Detector detector_
Definition: CaloPoint.h:65
CaloPoint::setDetId
void setDetId(DetId::Detector det)
Definition: CaloPoint.h:47
CaloPoint::setLayer
void setLayer(int i)
Definition: CaloPoint.h:55
CaloPoint::whichLayer
int whichLayer() const
Definition: CaloPoint.h:57
CaloPoint::DistanceToVertex
Definition: CaloPoint.h:70
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CaloPoint::whichDetector
DetId::Detector whichDetector() const
Definition: CaloPoint.h:48
CaloPoint::~CaloPoint
~CaloPoint()
Definition: CaloPoint.h:39
CaloPoint::getSide
CaloDirection getSide() const
returns the Side (see numbering)
Definition: CaloPoint.h:43
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CaloPoint::CaloPoint
CaloPoint()
Empty constructor.
Definition: CaloPoint.h:23
CaloPoint::DistanceToVertex::vertex
XYZPoint vertex
Definition: CaloPoint.h:79
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
CaloPoint::XYZVector
math::XYZVector XYZVector
Definition: CaloPoint.h:19
mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: Basic3DVectorLD.h:124
DetId::Detector
Detector
Definition: DetId.h:24
XYZPoint
math::XYZVector XYZPoint
Definition: CalorimetryManager.cc:69
operator<<
std::ostream & operator<<(std::ostream &o, const CaloPoint &cid)
Definition: CaloPoint.cc:4
CaloPoint::DistanceToVertex::operator()
bool operator()(const CaloPoint &point1, const CaloPoint &point2)
Definition: CaloPoint.h:74
DetId.h
CaloPoint::subdetector_
int subdetector_
Definition: CaloPoint.h:66
CaloPoint::DistanceToVertex::DistanceToVertex
DistanceToVertex(const XYZPoint &vert)
Definition: CaloPoint.h:72
NONE
Definition: TkAlStyle.cc:47
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
sistrip::layer_
static const char layer_[]
Definition: ConstantsForGranularity.h:30
Vector3D.h
CaloPoint::cellid_
DetId cellid_
Definition: CaloPoint.h:63