CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
Crystal Class Reference

#include <Crystal.h>

Classes

class  crystalEqual
 

Public Types

typedef ROOT::Math::Plane3D Plane3D
 
typedef math::XYZVector XYZPoint
 
typedef math::XYZVector XYZVector
 

Public Member Functions

 Crystal ()=default
 Empty constructor. More...
 
 Crystal (const DetId &cell, const BaseCrystal *bc=nullptr)
 constructor from DetId More...
 
CrystalNeighbourcrystalNeighbour (unsigned iq)
 Direct acces to the iq-th neighbour. More...
 
const XYZVectorexitingNormal (const CaloDirection &side) const
 normal exiting vector for the surface More...
 
const XYZVectorgetAxis () const
 get crystal axis More...
 
const XYZPointgetBackCenter () const
 get front center More...
 
const Plane3DgetBackPlane () const
 back plane More...
 
void getBackSide (std::vector< XYZPoint > &corners) const
 
void getBackSide (XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
 Coordinates of the back side. More...
 
const XYZPointgetCenter () const
 get 1/8*(Sum of corners) More...
 
const XYZPointgetCorner (unsigned i) const
 get the i-th corner More...
 
const DetIdgetDetId () const
 get the DetId More...
 
void getDrawingCoordinates (std::vector< float > &x, std::vector< float > &y, std::vector< float > &z) const
 for debugging. More...
 
const XYZVectorgetFifthEdge () const
 Direction of the fifth edge. More...
 
const XYZVectorgetFirstEdge () const
 Direction of the first edge. More...
 
const XYZPointgetFrontCenter () const
 get front center More...
 
const Plane3DgetFrontPlane () const
 front plane More...
 
void getFrontSide (std::vector< XYZPoint > &corners) const
 
void getFrontSide (XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
 coordinates of the front side More...
 
const XYZVectorgetLateralEdge (unsigned i) const
 lateral directions More...
 
void getLateralEdges (unsigned i, XYZPoint &a, XYZPoint &b) const
 get the lateral edges More...
 
const Plane3DgetLateralPlane (unsigned i) const
 lateral planes More...
 
void getLateralSide (unsigned i, std::vector< XYZPoint > &corners) const
 
void getLateralSide (unsigned i, XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
 Coordinates of the i=th lateral side. More...
 
const Plane3DgetPlane (const CaloDirection &side) const
 generic access More...
 
void getSide (const CaloDirection &side, std::vector< XYZPoint > &corners) const
 
void getSide (const CaloDirection &side, XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
 generic access More...
 
const int getSubdetNumber () const
 get the subdector More...
 
double getX0Back () const
 get the X0back More...
 
unsigned number () const
 get the number of the crystal More...
 
void print () const
 
void setNumber (unsigned n)
 it might be useful to have a number assigned to the crystal More...
 
void setX0Back (double val)
 set X0back (it depends on the choosen origin, it isn't purely geometrical) More...
 
 ~Crystal ()
 

Static Public Member Functions

static unsigned oppositeDirection (unsigned iside)
 

Private Attributes

DetId cellid_
 
const BaseCrystalmyCrystal_ = nullptr
 
std::vector< CrystalNeighbourneighbours_
 
unsigned number_ = 0
 
double X0back_ = 0.
 

Detailed Description

Definition at line 20 of file Crystal.h.

Member Typedef Documentation

◆ Plane3D

typedef ROOT::Math::Plane3D Crystal::Plane3D

Definition at line 24 of file Crystal.h.

◆ XYZPoint

typedef math::XYZVector Crystal::XYZPoint

Definition at line 23 of file Crystal.h.

◆ XYZVector

typedef math::XYZVector Crystal::XYZVector

Definition at line 22 of file Crystal.h.

Constructor & Destructor Documentation

◆ Crystal() [1/2]

Crystal::Crystal ( )
default

Empty constructor.

◆ Crystal() [2/2]

Crystal::Crystal ( const DetId cell,
const BaseCrystal bc = nullptr 
)

constructor from DetId

Definition at line 4 of file Crystal.cc.

4  : cellid_(cell), myCrystal_(xtal) {
5  neighbours_.resize(8);
6 }

References neighbours_.

◆ ~Crystal()

Crystal::~Crystal ( )
inline

Definition at line 109 of file Crystal.h.

109 { ; };

Member Function Documentation

◆ crystalNeighbour()

CrystalNeighbour& Crystal::crystalNeighbour ( unsigned  iq)
inline

Direct acces to the iq-th neighbour.

Definition at line 98 of file Crystal.h.

98 { return neighbours_[iq]; }

References neighbours_.

◆ exitingNormal()

const XYZVector& Crystal::exitingNormal ( const CaloDirection side) const
inline

normal exiting vector for the surface

Definition at line 82 of file Crystal.h.

82 { return myCrystal_->exitingNormal(side); }

References BaseCrystal::exitingNormal(), and myCrystal_.

◆ getAxis()

const XYZVector& Crystal::getAxis ( ) const
inline

get crystal axis

Definition at line 101 of file Crystal.h.

101 { return myCrystal_->getAxis(); }

References BaseCrystal::getAxis(), and myCrystal_.

◆ getBackCenter()

const XYZPoint& Crystal::getBackCenter ( ) const
inline

get front center

Definition at line 40 of file Crystal.h.

40 { return myCrystal_->getBackCenter(); }

References BaseCrystal::getBackCenter(), and myCrystal_.

◆ getBackPlane()

const Plane3D& Crystal::getBackPlane ( ) const
inline

back plane

Definition at line 72 of file Crystal.h.

72 { return myCrystal_->getBackPlane(); }

References BaseCrystal::getBackPlane(), and myCrystal_.

◆ getBackSide() [1/2]

void Crystal::getBackSide ( std::vector< XYZPoint > &  corners) const
inline

Definition at line 57 of file Crystal.h.

57 { myCrystal_->getBackSide(corners); }

References BaseCrystal::getBackSide(), and myCrystal_.

◆ getBackSide() [2/2]

void Crystal::getBackSide ( XYZPoint a,
XYZPoint b,
XYZPoint c,
XYZPoint d 
) const
inline

Coordinates of the back side.

Definition at line 56 of file Crystal.h.

56 { myCrystal_->getBackSide(a, b, c, d); }

References a, b, c, ztail::d, BaseCrystal::getBackSide(), and myCrystal_.

◆ getCenter()

const XYZPoint& Crystal::getCenter ( ) const
inline

get 1/8*(Sum of corners)

Definition at line 36 of file Crystal.h.

36 { return myCrystal_->getCenter(); };

References BaseCrystal::getCenter(), and myCrystal_.

◆ getCorner()

const XYZPoint& Crystal::getCorner ( unsigned  i) const
inline

get the i-th corner

Definition at line 34 of file Crystal.h.

34 { return myCrystal_->getCorner(i); };

References BaseCrystal::getCorner(), mps_fire::i, and myCrystal_.

◆ getDetId()

const DetId& Crystal::getDetId ( void  ) const
inline

get the DetId

Definition at line 46 of file Crystal.h.

46 { return cellid_; };

References cellid_.

Referenced by EcalHitMaker::EcalHitMaker(), and Crystal::crystalEqual::operator()().

◆ getDrawingCoordinates()

void Crystal::getDrawingCoordinates ( std::vector< float > &  x,
std::vector< float > &  y,
std::vector< float > &  z 
) const
inline

for debugging.

Definition at line 87 of file Crystal.h.

87  {
89  }

References BaseCrystal::getDrawingCoordinates(), myCrystal_, x, y, and z.

◆ getFifthEdge()

const XYZVector& Crystal::getFifthEdge ( ) const
inline

Direction of the fifth edge.

Definition at line 44 of file Crystal.h.

44 { return myCrystal_->getFifthEdge(); }

References BaseCrystal::getFifthEdge(), and myCrystal_.

◆ getFirstEdge()

const XYZVector& Crystal::getFirstEdge ( ) const
inline

Direction of the first edge.

Definition at line 42 of file Crystal.h.

42 { return myCrystal_->getFirstEdge(); }

References BaseCrystal::getFirstEdge(), and myCrystal_.

Referenced by EcalHitMaker::getPads().

◆ getFrontCenter()

const XYZPoint& Crystal::getFrontCenter ( ) const
inline

get front center

Definition at line 38 of file Crystal.h.

38 { return myCrystal_->getFrontCenter(); };

References BaseCrystal::getFrontCenter(), and myCrystal_.

◆ getFrontPlane()

const Plane3D& Crystal::getFrontPlane ( ) const
inline

front plane

Definition at line 70 of file Crystal.h.

70 { return myCrystal_->getFrontPlane(); }

References BaseCrystal::getFrontPlane(), and myCrystal_.

◆ getFrontSide() [1/2]

void Crystal::getFrontSide ( std::vector< XYZPoint > &  corners) const
inline

Definition at line 54 of file Crystal.h.

54 { myCrystal_->getFrontSide(corners); }

References BaseCrystal::getFrontSide(), and myCrystal_.

◆ getFrontSide() [2/2]

void Crystal::getFrontSide ( XYZPoint a,
XYZPoint b,
XYZPoint c,
XYZPoint d 
) const
inline

coordinates of the front side

Definition at line 53 of file Crystal.h.

53 { myCrystal_->getFrontSide(a, b, c, d); }

References a, b, c, ztail::d, BaseCrystal::getFrontSide(), and myCrystal_.

◆ getLateralEdge()

const XYZVector& Crystal::getLateralEdge ( unsigned  i) const
inline

lateral directions

Definition at line 79 of file Crystal.h.

79 { return myCrystal_->getLateralEdge(i); }

References BaseCrystal::getLateralEdge(), mps_fire::i, and myCrystal_.

◆ getLateralEdges()

void Crystal::getLateralEdges ( unsigned  i,
XYZPoint a,
XYZPoint b 
) const
inline

get the lateral edges

Definition at line 51 of file Crystal.h.

51 { myCrystal_->getLateralEdges(i, a, b); };

References a, b, BaseCrystal::getLateralEdges(), mps_fire::i, and myCrystal_.

◆ getLateralPlane()

const Plane3D& Crystal::getLateralPlane ( unsigned  i) const
inline

lateral planes

Definition at line 74 of file Crystal.h.

74 { return myCrystal_->getLateralPlane(i); }

References BaseCrystal::getLateralPlane(), mps_fire::i, and myCrystal_.

◆ getLateralSide() [1/2]

void Crystal::getLateralSide ( unsigned  i,
std::vector< XYZPoint > &  corners 
) const
inline

Definition at line 62 of file Crystal.h.

62 { myCrystal_->getLateralSide(i, corners); }

References BaseCrystal::getLateralSide(), mps_fire::i, and myCrystal_.

◆ getLateralSide() [2/2]

void Crystal::getLateralSide ( unsigned  i,
XYZPoint a,
XYZPoint b,
XYZPoint c,
XYZPoint d 
) const
inline

Coordinates of the i=th lateral side.

Definition at line 59 of file Crystal.h.

59  {
61  }

References a, b, c, ztail::d, BaseCrystal::getLateralSide(), mps_fire::i, and myCrystal_.

◆ getPlane()

const Plane3D& Crystal::getPlane ( const CaloDirection side) const
inline

generic access

Definition at line 76 of file Crystal.h.

76 { return myCrystal_->getPlane(side); }

References BaseCrystal::getPlane(), and myCrystal_.

◆ getSide() [1/2]

void Crystal::getSide ( const CaloDirection side,
std::vector< XYZPoint > &  corners 
) const
inline

Definition at line 67 of file Crystal.h.

67 { myCrystal_->getSide(side, corners); }

References BaseCrystal::getSide(), and myCrystal_.

◆ getSide() [2/2]

void Crystal::getSide ( const CaloDirection side,
XYZPoint a,
XYZPoint b,
XYZPoint c,
XYZPoint d 
) const
inline

generic access

Definition at line 64 of file Crystal.h.

64  {
65  myCrystal_->getSide(side, a, b, c, d);
66  }

References a, b, c, ztail::d, BaseCrystal::getSide(), and myCrystal_.

◆ getSubdetNumber()

const int Crystal::getSubdetNumber ( ) const
inline

get the subdector

Definition at line 48 of file Crystal.h.

48 { return myCrystal_->getSubdetNumber(); }

References BaseCrystal::getSubdetNumber(), and myCrystal_.

◆ getX0Back()

double Crystal::getX0Back ( ) const
inline

get the X0back

Definition at line 107 of file Crystal.h.

107 { return X0back_; }

References X0back_.

◆ number()

unsigned Crystal::number ( ) const
inline

get the number of the crystal

Definition at line 95 of file Crystal.h.

95 { return number_; };

References number_.

◆ oppositeDirection()

static unsigned Crystal::oppositeDirection ( unsigned  iside)
static

◆ print()

void Crystal::print ( void  ) const
inline

Definition at line 49 of file Crystal.h.

49 { return myCrystal_->print(); }

References myCrystal_, and BaseCrystal::print().

◆ setNumber()

void Crystal::setNumber ( unsigned  n)
inline

it might be useful to have a number assigned to the crystal

Definition at line 92 of file Crystal.h.

92 { number_ = n; };

References dqmiodumpmetadata::n, and number_.

◆ setX0Back()

void Crystal::setX0Back ( double  val)
inline

set X0back (it depends on the choosen origin, it isn't purely geometrical)

Definition at line 104 of file Crystal.h.

104 { X0back_ = val; }

References heppy_batch::val, and X0back_.

Member Data Documentation

◆ cellid_

DetId Crystal::cellid_
private

Definition at line 113 of file Crystal.h.

Referenced by getDetId().

◆ myCrystal_

const BaseCrystal* Crystal::myCrystal_ = nullptr
private

◆ neighbours_

std::vector<CrystalNeighbour> Crystal::neighbours_
private

Definition at line 114 of file Crystal.h.

Referenced by Crystal(), and crystalNeighbour().

◆ number_

unsigned Crystal::number_ = 0
private

Definition at line 112 of file Crystal.h.

Referenced by number(), and setNumber().

◆ X0back_

double Crystal::X0back_ = 0.
private

Definition at line 115 of file Crystal.h.

Referenced by getX0Back(), and setX0Back().

BaseCrystal::getSubdetNumber
const int getSubdetNumber() const
get the subdector
Definition: BaseCrystal.h:60
BaseCrystal::getFrontCenter
const XYZPoint & getFrontCenter() const
get front center
Definition: BaseCrystal.h:50
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
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::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::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::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
Crystal::neighbours_
std::vector< CrystalNeighbour > neighbours_
Definition: Crystal.h:114
BaseCrystal::getAxis
const XYZVector & getAxis() const
get crystal axis
Definition: BaseCrystal.h:102
DDAxes::z
BaseCrystal::getFirstEdge
const XYZVector & getFirstEdge() const
Direction of the first edge.
Definition: BaseCrystal.h:54
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
BaseCrystal::getPlane
const Plane3D & getPlane(const CaloDirection &side) const
generic access
Definition: BaseCrystal.h:84
Crystal::myCrystal_
const BaseCrystal * myCrystal_
Definition: Crystal.h:116
Crystal::X0back_
double X0back_
Definition: Crystal.h:115
Crystal::cellid_
DetId cellid_
Definition: Crystal.h:113
BaseCrystal::getCorner
const XYZPoint & getCorner(unsigned i) const
get the i-th corner
Definition: BaseCrystal.h:46
heppy_batch.val
val
Definition: heppy_batch.py:351
BaseCrystal::getFrontPlane
const Plane3D & getFrontPlane() const
front plane
Definition: BaseCrystal.h:78
BaseCrystal::getFifthEdge
const XYZVector & getFifthEdge() const
Direction of the fifth edge.
Definition: BaseCrystal.h:56
Crystal::number_
unsigned number_
Definition: Crystal.h:112
ztail.d
d
Definition: ztail.py:151
BaseCrystal::print
void print() const
Definition: BaseCrystal.cc:237
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
BaseCrystal::getDrawingCoordinates
void getDrawingCoordinates(std::vector< float > &x, std::vector< float > &y, std::vector< float > &z) const
for debugging.
Definition: BaseCrystal.cc:167