CMS 3D CMS Logo

BaseCrystal.h
Go to the documentation of this file.
1 #ifndef FastSimulation_GeometryTool_BaseCrystal_h
2 #define FastSimulation_GeometryTool_BaseCrystal_h
3 
4 //Data Formats
6 #include "Math/GenVector/Plane3D.h"
7 
8 // Unfortunately, GlobalPoints are also needed
14 
15 #include <vector>
16 
17 class DetId;
18 
19 class BaseCrystal {
20 public:
24 
25  // side numbering
26  // enum CrystalSide{EAST=0,NORTH=1,WEST=2,SOUTH=3,FRONT=4,BACK=5};
28  BaseCrystal() { ; };
30  BaseCrystal(const DetId& cell);
31 
33  // BaseCrystal (const BaseCrystal& bc):corners_(bc.getCorners()),cellid_(bc.getDetId())
34  // {
35  // std::cout << " Copy constructor " ;
36  // computeBasicProperties();
37  // std::cout << " done " << std::endl;
38  // }
39  ~BaseCrystal() { ; }
41  void setCorners(const CaloCellGeometry::CornersVec& vec, const GlobalPoint& pos);
42 
43  // inline const std::vector<XYZPoint>& getCorners() const {return corners_;}
44 
46  inline const XYZPoint& getCorner(unsigned i) const { return corners_[i]; };
48  inline const XYZPoint& getCenter() const { return center_; };
50  inline const XYZPoint& getFrontCenter() const { return frontcenter_; };
52  inline const XYZPoint& getBackCenter() const { return backcenter_; }
54  inline const XYZVector& getFirstEdge() const { return firstedgedirection_; }
56  inline const XYZVector& getFifthEdge() const { return fifthedgedirection_; }
58  inline const DetId& getDetId() const { return cellid_; };
60  inline const int getSubdetNumber() const { return subdetn_; }
61 
63  void getLateralEdges(unsigned i, XYZPoint&, XYZPoint&) const;
65  void getFrontSide(XYZPoint& a, XYZPoint& b, XYZPoint& c, XYZPoint& d) const;
66  void getFrontSide(std::vector<XYZPoint>& corners) const;
68  void getBackSide(XYZPoint& a, XYZPoint& b, XYZPoint& c, XYZPoint& d) const;
69  void getBackSide(std::vector<XYZPoint>& corners) const;
71  void getLateralSide(unsigned i, XYZPoint& a, XYZPoint& b, XYZPoint& c, XYZPoint& d) const;
72  void getLateralSide(unsigned i, std::vector<XYZPoint>& corners) const;
74  void getSide(const CaloDirection& side, XYZPoint& a, XYZPoint& b, XYZPoint& c, XYZPoint& d) const;
75  void getSide(const CaloDirection& side, std::vector<XYZPoint>& corners) const;
76 
78  inline const Plane3D& getFrontPlane() const { return lateralPlane_[4]; }
80  inline const Plane3D& getBackPlane() const { return lateralPlane_[5]; }
82  inline const Plane3D& getLateralPlane(unsigned i) const { return lateralPlane_[i]; };
84  const Plane3D& getPlane(const CaloDirection& side) const {
86  }
87 
89  inline const XYZVector& getLateralEdge(unsigned i) const { return lateraldirection_[i]; };
90 
92  inline const XYZVector& exitingNormal(const CaloDirection& side) const {
94  };
95 
96  static unsigned oppositeDirection(unsigned iside);
97 
99  void getDrawingCoordinates(std::vector<float>& x, std::vector<float>& y, std::vector<float>& z) const;
100 
102  inline const XYZVector& getAxis() const { return crystalaxis_; }
103 
104  void print() const;
105 
106 private:
107  void computeBasicProperties();
108 
109 private:
112  int subdetn_;
122 };
123 #endif
BaseCrystal::getSubdetNumber
const int getSubdetNumber() const
get the subdector
Definition: BaseCrystal.h:60
BaseCrystal::setCorners
void setCorners(const CaloCellGeometry::CornersVec &vec, const GlobalPoint &pos)
Definition: BaseCrystal.cc:11
BaseCrystal::XYZVector
math::XYZVector XYZVector
Definition: BaseCrystal.h:21
BaseCrystal::getFrontCenter
const XYZPoint & getFrontCenter() const
get front center
Definition: BaseCrystal.h:50
BaseCrystal::computeBasicProperties
void computeBasicProperties()
Definition: BaseCrystal.cc:72
DDAxes::y
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
BaseCrystal
Definition: BaseCrystal.h:19
BaseCrystal::fifthedgedirection_
XYZVector fifthedgedirection_
Definition: BaseCrystal.h:117
BaseCrystal::getBackPlane
const Plane3D & getBackPlane() const
back plane
Definition: BaseCrystal.h:80
BaseCrystal::getLateralEdge
const XYZVector & getLateralEdge(unsigned i) const
lateral directions
Definition: BaseCrystal.h:89
BaseCrystal::lateraldirection_
XYZVector lateraldirection_[4]
Definition: BaseCrystal.h:119
BaseCrystal::exitingNormal
const XYZVector & exitingNormal(const CaloDirection &side) const
normal exiting vector for the surface
Definition: BaseCrystal.h:92
BaseCrystal::getBackSide
void getBackSide(XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
Coordinates of the back side.
Definition: BaseCrystal.cc:133
BaseCrystal::getDetId
const DetId & getDetId() const
get the DetId
Definition: BaseCrystal.h:58
pos
Definition: PixelAliasList.h:18
BaseCrystal::getCenter
const XYZPoint & getCenter() const
get 1/8*(Sum of corners)
Definition: BaseCrystal.h:48
BaseCrystal::getBackCenter
const XYZPoint & getBackCenter() const
get front center
Definition: BaseCrystal.h:52
BaseCrystal::firstedgedirection_
XYZVector firstedgedirection_
Definition: BaseCrystal.h:116
BaseCrystal::getLateralSide
void getLateralSide(unsigned i, XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
Coordinates of the i=th lateral side.
Definition: BaseCrystal.cc:149
BaseCrystal::getLateralPlane
const Plane3D & getLateralPlane(unsigned i) const
lateral planes
Definition: BaseCrystal.h:82
BaseCrystal::getSide
void getSide(const CaloDirection &side, XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
generic access
Definition: BaseCrystal.cc:224
BaseCrystal::getFrontSide
void getFrontSide(XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
coordinates of the front side
Definition: BaseCrystal.cc:117
DDAxes::x
EZArrayFL< GlobalPoint >
BaseCrystal::XYZPoint
math::XYZVector XYZPoint
Definition: BaseCrystal.h:22
BaseCrystal::getAxis
const XYZVector & getAxis() const
get crystal axis
Definition: BaseCrystal.h:102
Plane3D
ROOT::Math::Plane3D Plane3D
Definition: PreshowerHitMaker.cc:13
DetId
Definition: DetId.h:17
BaseCrystal::exitingNormal_
XYZVector exitingNormal_[6]
Definition: BaseCrystal.h:121
BaseCrystal::corners_
XYZPoint corners_[8]
Definition: BaseCrystal.h:110
BaseCrystal::oppositeDirection
static unsigned oppositeDirection(unsigned iside)
DDAxes::z
CaloDirectionOperations::Side
static CaloDirection Side(unsigned i)
unsigned int -> Side conversion
Definition: CaloDirectionOperations.cc:13
BaseCrystal::BaseCrystal
BaseCrystal()
Empty constructor.
Definition: BaseCrystal.h:28
BaseCrystal::getFirstEdge
const XYZVector & getFirstEdge() const
Direction of the first edge.
Definition: BaseCrystal.h:54
Point3DBase< float, GlobalTag >
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
BaseCrystal::getLateralEdges
void getLateralEdges(unsigned i, XYZPoint &, XYZPoint &) const
get the lateral edges
Definition: BaseCrystal.cc:109
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
BaseCrystal::Plane3D
ROOT::Math::Plane3D Plane3D
Definition: BaseCrystal.h:23
BaseCrystal::lateralPlane_
Plane3D lateralPlane_[6]
Definition: BaseCrystal.h:120
BaseCrystal::getPlane
const Plane3D & getPlane(const CaloDirection &side) const
generic access
Definition: BaseCrystal.h:84
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
BaseCrystal::frontcenter_
XYZPoint frontcenter_
Definition: BaseCrystal.h:114
BaseCrystal::~BaseCrystal
~BaseCrystal()
Copy constructor.
Definition: BaseCrystal.h:39
XYZPoint
math::XYZVector XYZPoint
Definition: CalorimetryManager.cc:69
BaseCrystal::cellid_
DetId cellid_
Definition: BaseCrystal.h:111
CaloDirectionOperations.h
BaseCrystal::getCorner
const XYZPoint & getCorner(unsigned i) const
get the i-th corner
Definition: BaseCrystal.h:46
CaloCellGeometry.h
BaseCrystal::getFrontPlane
const Plane3D & getFrontPlane() const
front plane
Definition: BaseCrystal.h:78
DetId.h
BaseCrystal::getFifthEdge
const XYZVector & getFifthEdge() const
Direction of the fifth edge.
Definition: BaseCrystal.h:56
BaseCrystal::center_
XYZPoint center_
Definition: BaseCrystal.h:113
ztail.d
d
Definition: ztail.py:151
BaseCrystal::subdetn_
int subdetn_
Definition: BaseCrystal.h:112
BaseCrystal::print
void print() const
Definition: BaseCrystal.cc:237
Vector3D.h
GlobalPoint.h
BaseCrystal::backcenter_
XYZPoint backcenter_
Definition: BaseCrystal.h:115
BaseCrystal::getDrawingCoordinates
void getDrawingCoordinates(std::vector< float > &x, std::vector< float > &y, std::vector< float > &z) const
for debugging.
Definition: BaseCrystal.cc:167
BaseCrystal::crystalaxis_
XYZVector crystalaxis_
Definition: BaseCrystal.h:118