CMS 3D CMS Logo

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

#include <BaseCrystal.h>

Public Types

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

Public Member Functions

 BaseCrystal ()
 Empty constructor. More...
 
 BaseCrystal (const DetId &cell)
 constructor from DetId 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 (XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
 Coordinates of the back side. More...
 
void getBackSide (std::vector< XYZPoint > &corners) const
 
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 (XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
 coordinates of the front side More...
 
void getFrontSide (std::vector< XYZPoint > &corners) const
 
const XYZVectorgetLateralEdge (unsigned i) const
 lateral directions More...
 
void getLateralEdges (unsigned i, XYZPoint &, XYZPoint &) const
 get the lateral edges More...
 
const Plane3DgetLateralPlane (unsigned i) const
 lateral planes More...
 
void getLateralSide (unsigned i, XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
 Coordinates of the i=th lateral side. More...
 
void getLateralSide (unsigned i, std::vector< XYZPoint > &corners) const
 
const Plane3DgetPlane (const CaloDirection &side) const
 generic access More...
 
void getSide (const CaloDirection &side, XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
 generic access More...
 
void getSide (const CaloDirection &side, std::vector< XYZPoint > &corners) const
 
const int getSubdetNumber () const
 get the subdector More...
 
void print () const
 
void setCorners (const CaloCellGeometry::CornersVec &vec, const GlobalPoint &pos)
 
 ~BaseCrystal ()
 Copy constructor. More...
 

Static Public Member Functions

static unsigned oppositeDirection (unsigned iside)
 

Private Member Functions

void computeBasicProperties ()
 

Private Attributes

XYZPoint backcenter_
 
DetId cellid_
 
XYZPoint center_
 
XYZPoint corners_ [8]
 
XYZVector crystalaxis_
 
XYZVector exitingNormal_ [6]
 
XYZVector fifthedgedirection_
 
XYZVector firstedgedirection_
 
XYZPoint frontcenter_
 
XYZVector lateraldirection_ [4]
 
Plane3D lateralPlane_ [6]
 
int subdetn_
 

Detailed Description

Definition at line 19 of file BaseCrystal.h.

Member Typedef Documentation

typedef ROOT::Math::Plane3D BaseCrystal::Plane3D

Definition at line 26 of file BaseCrystal.h.

Definition at line 25 of file BaseCrystal.h.

Definition at line 24 of file BaseCrystal.h.

Constructor & Destructor Documentation

BaseCrystal::BaseCrystal ( )
inline

Empty constructor.

Definition at line 31 of file BaseCrystal.h.

31 {;};
BaseCrystal::BaseCrystal ( const DetId cell)

constructor from DetId

Definition at line 9 of file BaseCrystal.cc.

References cellid_, DetId::subdetId(), and subdetn_.

9  :cellid_(cell)
10 {
12 }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
DetId cellid_
Definition: BaseCrystal.h:112
BaseCrystal::~BaseCrystal ( )
inline

Copy constructor.

Definition at line 42 of file BaseCrystal.h.

References setCorners().

42 {;}

Member Function Documentation

void BaseCrystal::computeBasicProperties ( )
private

Definition at line 86 of file BaseCrystal.cc.

References backcenter_, center_, corners_, crystalaxis_, exitingNormal_, fifthedgedirection_, firstedgedirection_, frontcenter_, mps_fire::i, lateraldirection_, and lateralPlane_.

Referenced by getAxis(), and setCorners().

87 {
88  //if(corners_.size()==0) return;
89  center_=XYZPoint(0.,0.,0.);
90  for(unsigned ic=0;ic<8;++ic)
91  {
92  center_+=corners_[ic];
93  }
94 
95  center_*=0.125;
96 
97  // std::cout << " Ncorners ? " << corners_.size() << std::endl;
98  frontcenter_ = 0.25*(corners_[0]+corners_[1]+corners_[2]+corners_[3]);
99  backcenter_ = 0.25*(corners_[4]+corners_[5]+corners_[6]+corners_[7]);
101  firstedgedirection_=-(corners_[1]-corners_[0]).Unit();
102  fifthedgedirection_=-(corners_[5]-corners_[4]).Unit();
103  // std::cout << " Direction laterales " << std::endl;
104  for(unsigned il=0;il<4;++il)
105  {
106  lateraldirection_[il]=-(corners_[(il+1)%4]-corners_[il]).Unit();
107  }
108 
109  Plane3D frontPlane((Point)corners_[0],(Point)corners_[1],(Point)corners_[2]);
110  Plane3D backPlane ((Point)corners_[4],(Point)corners_[5],(Point)corners_[6]);
111  for(unsigned i=0;i<4;++i)
112  {
113  lateralPlane_[i]=
114  Plane3D((Point)corners_[i],(Point)corners_[(i+1)%4],(Point)corners_[i+4]);
115  }
116  // Front plane i=4 (UP)
117  lateralPlane_[4] = frontPlane;
118  // Back plane i =5 (DOWN)
119  lateralPlane_[5] = backPlane;
120 
121  for(unsigned i=0;i<6;++i)
122  {
123  exitingNormal_[i] =
124  (lateralPlane_[i].Distance(Point(center_.X(),center_.Y(),center_.Z())) < 0.) ?
125  lateralPlane_[i].Normal().Unit() : -lateralPlane_[i].Normal().Unit();
126  }
127 }
XYZPoint center_
Definition: BaseCrystal.h:114
XYZPoint backcenter_
Definition: BaseCrystal.h:116
XYZVector firstedgedirection_
Definition: BaseCrystal.h:117
XYZVector lateraldirection_[4]
Definition: BaseCrystal.h:120
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
math::XYZVector XYZPoint
Definition: BaseCrystal.h:25
ROOT::Math::Plane3D Plane3D
Definition: BaseCrystal.h:26
math::XYZPoint Point
XYZPoint frontcenter_
Definition: BaseCrystal.h:115
XYZVector exitingNormal_[6]
Definition: BaseCrystal.h:122
Plane3D lateralPlane_[6]
Definition: BaseCrystal.h:121
ROOT::Math::Plane3D::Point Point
Definition: BaseCrystal.cc:7
XYZVector fifthedgedirection_
Definition: BaseCrystal.h:118
XYZVector crystalaxis_
Definition: BaseCrystal.h:119
ROOT::Math::Plane3D Plane3D
const XYZVector& BaseCrystal::exitingNormal ( const CaloDirection side) const
inline

normal exiting vector for the surface

Definition at line 95 of file BaseCrystal.h.

References exitingNormal_, getDrawingCoordinates(), oppositeDirection(), CaloDirectionOperations::Side(), x, y, and z.

Referenced by Crystal::exitingNormal().

XYZVector exitingNormal_[6]
Definition: BaseCrystal.h:122
static CaloDirection Side(unsigned i)
unsigned int -> Side conversion
const XYZVector& BaseCrystal::getAxis ( ) const
inline

get crystal axis

Definition at line 103 of file BaseCrystal.h.

References computeBasicProperties(), crystalaxis_, and print().

Referenced by Crystal::getAxis().

103 { return crystalaxis_;}
XYZVector crystalaxis_
Definition: BaseCrystal.h:119
const XYZPoint& BaseCrystal::getBackCenter ( ) const
inline

get front center

Definition at line 55 of file BaseCrystal.h.

References backcenter_.

Referenced by Crystal::getBackCenter().

55 {return backcenter_;}
XYZPoint backcenter_
Definition: BaseCrystal.h:116
const Plane3D& BaseCrystal::getBackPlane ( ) const
inline

back plane

Definition at line 85 of file BaseCrystal.h.

References lateralPlane_.

Referenced by Crystal::getBackPlane().

85 {return lateralPlane_[5];}
Plane3D lateralPlane_[6]
Definition: BaseCrystal.h:121
void BaseCrystal::getBackSide ( XYZPoint a,
XYZPoint b,
XYZPoint c,
XYZPoint d 
) const

Coordinates of the back side.

Definition at line 157 of file BaseCrystal.cc.

References corners_.

Referenced by Crystal::getBackSide(), getSide(), and getSubdetNumber().

158 {
159  a=corners_[4];
160  b=corners_[5];
161  c=corners_[6];
162  d=corners_[7];
163 }
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void BaseCrystal::getBackSide ( std::vector< XYZPoint > &  corners) const

Definition at line 165 of file BaseCrystal.cc.

References corners_.

166 {
167  if(corners.size()==4)
168  {
169  corners[0]=corners_[4];
170  corners[1]=corners_[5];
171  corners[2]=corners_[6];
172  corners[3]=corners_[7];
173  }
174 }
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
const XYZPoint& BaseCrystal::getCenter ( ) const
inline

get 1/8*(Sum of corners)

Definition at line 51 of file BaseCrystal.h.

References center_.

Referenced by Crystal::getCenter().

51 {return center_;};
XYZPoint center_
Definition: BaseCrystal.h:114
const XYZPoint& BaseCrystal::getCorner ( unsigned  i) const
inline

get the i-th corner

Definition at line 49 of file BaseCrystal.h.

References corners_, and mps_fire::i.

Referenced by Crystal::getCorner().

49 { return corners_[i];};
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
const DetId& BaseCrystal::getDetId ( void  ) const
inline

get the DetId

Definition at line 61 of file BaseCrystal.h.

References cellid_.

61 {return cellid_;};
DetId cellid_
Definition: BaseCrystal.h:112
void BaseCrystal::getDrawingCoordinates ( std::vector< float > &  x,
std::vector< float > &  y,
std::vector< float > &  z 
) const

for debugging.

Definition at line 196 of file BaseCrystal.cc.

References corners_, X, DOFs::Y, and DOFs::Z.

Referenced by exitingNormal(), and Crystal::getDrawingCoordinates().

197 {
198  x.clear();
199  y.clear();
200  z.clear();
201 
202  x.push_back(corners_[0].X());
203  x.push_back(corners_[3].X());
204  x.push_back(corners_[2].X());
205  x.push_back(corners_[1].X());
206  x.push_back(corners_[5].X());
207  x.push_back(corners_[6].X());
208  x.push_back(corners_[7].X());
209  x.push_back(corners_[4].X());
210  x.push_back(corners_[0].X());
211  x.push_back(corners_[1].X());
212  x.push_back(corners_[2].X());
213  x.push_back(corners_[6].X());
214  x.push_back(corners_[5].X());
215  x.push_back(corners_[4].X());
216  x.push_back(corners_[7].X());
217  x.push_back(corners_[3].X());
218 
219  y.push_back(corners_[0].Y());
220  y.push_back(corners_[3].Y());
221  y.push_back(corners_[2].Y());
222  y.push_back(corners_[1].Y());
223  y.push_back(corners_[5].Y());
224  y.push_back(corners_[6].Y());
225  y.push_back(corners_[7].Y());
226  y.push_back(corners_[4].Y());
227  y.push_back(corners_[0].Y());
228  y.push_back(corners_[1].Y());
229  y.push_back(corners_[2].Y());
230  y.push_back(corners_[6].Y());
231  y.push_back(corners_[5].Y());
232  y.push_back(corners_[4].Y());
233  y.push_back(corners_[7].Y());
234  y.push_back(corners_[3].Y());
235 
236  z.push_back(corners_[0].Z());
237  z.push_back(corners_[3].Z());
238  z.push_back(corners_[2].Z());
239  z.push_back(corners_[1].Z());
240  z.push_back(corners_[5].Z());
241  z.push_back(corners_[6].Z());
242  z.push_back(corners_[7].Z());
243  z.push_back(corners_[4].Z());
244  z.push_back(corners_[0].Z());
245  z.push_back(corners_[1].Z());
246  z.push_back(corners_[2].Z());
247  z.push_back(corners_[6].Z());
248  z.push_back(corners_[5].Z());
249  z.push_back(corners_[4].Z());
250  z.push_back(corners_[7].Z());
251  z.push_back(corners_[3].Z());
252 }
#define X(str)
Definition: MuonsGrabber.cc:48
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
const XYZVector& BaseCrystal::getFifthEdge ( ) const
inline

Direction of the fifth edge.

Definition at line 59 of file BaseCrystal.h.

References fifthedgedirection_.

Referenced by Crystal::getFifthEdge().

59 {return fifthedgedirection_;}
XYZVector fifthedgedirection_
Definition: BaseCrystal.h:118
const XYZVector& BaseCrystal::getFirstEdge ( ) const
inline

Direction of the first edge.

Definition at line 57 of file BaseCrystal.h.

References firstedgedirection_.

Referenced by Crystal::getFirstEdge().

57 {return firstedgedirection_;}
XYZVector firstedgedirection_
Definition: BaseCrystal.h:117
const XYZPoint& BaseCrystal::getFrontCenter ( ) const
inline

get front center

Definition at line 53 of file BaseCrystal.h.

References frontcenter_.

Referenced by Crystal::getFrontCenter().

53 {return frontcenter_;};
XYZPoint frontcenter_
Definition: BaseCrystal.h:115
const Plane3D& BaseCrystal::getFrontPlane ( ) const
inline

front plane

Definition at line 83 of file BaseCrystal.h.

References lateralPlane_.

Referenced by Crystal::getFrontPlane().

83 {return lateralPlane_[4];}
Plane3D lateralPlane_[6]
Definition: BaseCrystal.h:121
void BaseCrystal::getFrontSide ( XYZPoint a,
XYZPoint b,
XYZPoint c,
XYZPoint d 
) const

coordinates of the front side

Definition at line 138 of file BaseCrystal.cc.

References corners_.

Referenced by Crystal::getFrontSide(), getSide(), and getSubdetNumber().

139 {
140  a=corners_[0];
141  b=corners_[1];
142  c=corners_[2];
143  d=corners_[3];
144 }
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void BaseCrystal::getFrontSide ( std::vector< XYZPoint > &  corners) const

Definition at line 146 of file BaseCrystal.cc.

References corners_.

147 {
148  if(corners.size()==4)
149  {
150  corners[0]=corners_[0];
151  corners[1]=corners_[1];
152  corners[2]=corners_[2];
153  corners[3]=corners_[3];
154  }
155 }
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
const XYZVector& BaseCrystal::getLateralEdge ( unsigned  i) const
inline

lateral directions

Definition at line 92 of file BaseCrystal.h.

References mps_fire::i, and lateraldirection_.

Referenced by Crystal::getLateralEdge().

92 {return lateraldirection_[i];};
XYZVector lateraldirection_[4]
Definition: BaseCrystal.h:120
void BaseCrystal::getLateralEdges ( unsigned  i,
XYZPoint a,
XYZPoint b 
) const

get the lateral edges

Definition at line 129 of file BaseCrystal.cc.

References corners_, mps_fire::i, and mitigatedMETSequence_cff::U.

Referenced by Crystal::getLateralEdges(), getLateralSide(), and getSubdetNumber().

130 {
131  if(i<4U) // i >= 0, since i is unsigned
132  {
133  a=corners_[i];
134  b=corners_[i+4];
135  }
136 }
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
const Plane3D& BaseCrystal::getLateralPlane ( unsigned  i) const
inline

lateral planes

Definition at line 87 of file BaseCrystal.h.

References mps_fire::i, and lateralPlane_.

Referenced by Crystal::getLateralPlane().

87 {return lateralPlane_[i];};
Plane3D lateralPlane_[6]
Definition: BaseCrystal.h:121
void BaseCrystal::getLateralSide ( unsigned  i,
XYZPoint a,
XYZPoint b,
XYZPoint c,
XYZPoint d 
) const

Coordinates of the i=th lateral side.

Definition at line 176 of file BaseCrystal.cc.

References getLateralEdges(), and mitigatedMETSequence_cff::U.

Referenced by Crystal::getLateralSide(), getSide(), and getSubdetNumber().

177 {
178  if(i<4U) // i >= 0, since i is unsigned
179  {
180  getLateralEdges(i,a,b);
181  getLateralEdges((i+1)%4,c,d);
182  }
183 }
void getLateralEdges(unsigned i, XYZPoint &, XYZPoint &) const
get the lateral edges
Definition: BaseCrystal.cc:129
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void BaseCrystal::getLateralSide ( unsigned  i,
std::vector< XYZPoint > &  corners 
) const

Definition at line 185 of file BaseCrystal.cc.

References corners_, mps_fire::i, and mitigatedMETSequence_cff::U.

186 {
187  if(corners.size()==4&&i<4U) // i >= 0, since i is unsigned
188  {
189  corners[0]=corners_[i];
190  corners[1]=corners_[i+4];
191  corners[2]=corners_[4+(i+1)%4];
192  corners[3]=corners_[(i+1)%4];
193  }
194 }
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
const Plane3D& BaseCrystal::getPlane ( const CaloDirection side) const
inline

generic access

Definition at line 89 of file BaseCrystal.h.

References lateralPlane_, and CaloDirectionOperations::Side().

Referenced by Crystal::getPlane().

Plane3D lateralPlane_[6]
Definition: BaseCrystal.h:121
static CaloDirection Side(unsigned i)
unsigned int -> Side conversion
void BaseCrystal::getSide ( const CaloDirection side,
XYZPoint a,
XYZPoint b,
XYZPoint c,
XYZPoint d 
) const

generic access

Definition at line 257 of file BaseCrystal.cc.

References DOWN, getBackSide(), getFrontSide(), getLateralSide(), CaloDirectionOperations::Side(), and UP.

Referenced by Crystal::getSide(), and getSubdetNumber().

258 {
259  switch (side)
260  {
261  case UP:
262  getFrontSide(a,b,c,d);
263  break;
264  case DOWN:
265  getBackSide(a,b,c,d);
266  break;
267  default:
269  }
270 }
void getBackSide(XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
Coordinates of the back side.
Definition: BaseCrystal.cc:157
void getLateralSide(unsigned i, XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
Coordinates of the i=th lateral side.
Definition: BaseCrystal.cc:176
static CaloDirection Side(unsigned i)
unsigned int -> Side conversion
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void getFrontSide(XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
coordinates of the front side
Definition: BaseCrystal.cc:138
void BaseCrystal::getSide ( const CaloDirection side,
std::vector< XYZPoint > &  corners 
) const

Definition at line 285 of file BaseCrystal.cc.

References DOWN, getBackSide(), getFrontSide(), getLateralSide(), CaloDirectionOperations::Side(), and UP.

286 {
287  switch (side)
288  {
289  case UP:
290  getFrontSide(corners);
291  break;
292  case DOWN:
293  getBackSide(corners);
294  break;
295  default:
297  }
298 }
void getBackSide(XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
Coordinates of the back side.
Definition: BaseCrystal.cc:157
void getLateralSide(unsigned i, XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
Coordinates of the i=th lateral side.
Definition: BaseCrystal.cc:176
static CaloDirection Side(unsigned i)
unsigned int -> Side conversion
void getFrontSide(XYZPoint &a, XYZPoint &b, XYZPoint &c, XYZPoint &d) const
coordinates of the front side
Definition: BaseCrystal.cc:138
const int BaseCrystal::getSubdetNumber ( ) const
inline
static unsigned BaseCrystal::oppositeDirection ( unsigned  iside)
static

Referenced by exitingNormal().

void BaseCrystal::print ( void  ) const

Definition at line 272 of file BaseCrystal.cc.

References backcenter_, cellid_, center_, corners_, gather_cfg::cout, exitingNormal_, frontcenter_, triggerObjects_cff::id, and DetId::rawId().

Referenced by getAxis(), and Crystal::print().

272  {
273  std::cout << "CellID " << cellid_.rawId() << std::endl;
274  std::cout << " Corners " << std::endl;
275  for(unsigned ic=0;ic<8;++ic)
276  std::cout << corners_[ic] << std::endl;
277  std::cout << " Center " << center_ << std::endl;
278  std::cout << " Front Center " << frontcenter_ << std::endl;
279  std::cout << " Back Center " << backcenter_ << std::endl;
280  std::cout << " Normales sortantes " << std::endl;
281  for(unsigned id=0;id<6;++id)
282  std::cout << exitingNormal_[id] << std::endl;
283 }
XYZPoint center_
Definition: BaseCrystal.h:114
XYZPoint backcenter_
Definition: BaseCrystal.h:116
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
XYZPoint frontcenter_
Definition: BaseCrystal.h:115
XYZVector exitingNormal_[6]
Definition: BaseCrystal.h:122
DetId cellid_
Definition: BaseCrystal.h:112
void BaseCrystal::setCorners ( const CaloCellGeometry::CornersVec vec,
const GlobalPoint pos 
)

Definition at line 14 of file BaseCrystal.cc.

References computeBasicProperties(), corners_, EcalBarrel, EcalEndcap, PFRecoTauDiscriminationByIsolation_cfi::offset, EZArrayFL< T >::size(), subdetn_, x, PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by CaloGeometryHelper::buildCrystalArray(), and ~BaseCrystal().

15 {
16  unsigned ncorners= vec.size();
17  if(ncorners!=8) return;
18 
19  // This is really a pity to have to make the conversion GlobalPoint to XYZPoint, but the latter have many
20  // useful properties (transformations, conversions....) that aren't implemented
21  // for the GlobalPoints and GlobalVectors.
22 
23  if(subdetn_==EcalBarrel)
24  {
25  if(pos.z()>0.)
26  {
27  for(unsigned ic=0;ic<8;++ic)
28  {
29  corners_[ic]=XYZPoint(vec[ic].x(),vec[ic].y(),vec[ic].z());
30  }
31  }
32  else
33  {
34  corners_[0]=XYZPoint(vec[2].x(),vec[2].y(),vec[2].z());
35  corners_[1]=XYZPoint(vec[3].x(),vec[3].y(),vec[3].z());
36  corners_[2]=XYZPoint(vec[0].x(),vec[0].y(),vec[0].z());
37  corners_[3]=XYZPoint(vec[1].x(),vec[1].y(),vec[1].z());
38  corners_[4]=XYZPoint(vec[6].x(),vec[6].y(),vec[6].z());
39  corners_[5]=XYZPoint(vec[7].x(),vec[7].y(),vec[7].z());
40  corners_[6]=XYZPoint(vec[4].x(),vec[4].y(),vec[4].z());
41  corners_[7]=XYZPoint(vec[5].x(),vec[5].y(),vec[5].z());
42  }
43  }
44  else if(subdetn_==EcalEndcap)
45  {
46  double x=pos.x();
47  double y=pos.y();
48  double z=pos.z();
49  unsigned offset=0;
50  int zsign=1;
51  if(z>0)
52  {
53  if(x>0&&y>0)
54  offset=1;
55  else if(x<0&&y>0)
56  offset=2;
57  else if(x>0&&y<0)
58  offset=0;
59  else if (x<0&&y<0)
60  offset=3;
61  zsign=1;
62  }
63  else
64  {
65  if(x>0&&y>0)
66  offset=3;
67  else if(x<0&&y>0)
68  offset=2;
69  else if(x>0&&y<0)
70  offset=0;
71  else if(x<0&&y<0)
72  offset=1;
73  zsign=-1;
74  }
75  for(unsigned ic=0;ic<4;++ic)
76  {
77  unsigned i1=(unsigned)((zsign*ic+offset)%4);
78  unsigned i2=i1+4;
79  corners_[ic]=XYZPoint(vec[i1].x(),vec[i1].y(),vec[i1].z());
80  corners_[4+ic]=XYZPoint(vec[i2].x(),vec[i2].y(),vec[i2].z());
81  }
82  }
84 }
T y() const
Definition: PV3DBase.h:63
XYZPoint corners_[8]
Definition: BaseCrystal.h:111
math::XYZVector XYZPoint
Definition: BaseCrystal.h:25
T z() const
Definition: PV3DBase.h:64
size_type size() const
Definition: EZArrayFL.h:81
T x() const
Definition: PV3DBase.h:62
void computeBasicProperties()
Definition: BaseCrystal.cc:86

Member Data Documentation

XYZPoint BaseCrystal::backcenter_
private

Definition at line 116 of file BaseCrystal.h.

Referenced by computeBasicProperties(), getBackCenter(), and print().

DetId BaseCrystal::cellid_
private

Definition at line 112 of file BaseCrystal.h.

Referenced by BaseCrystal(), getDetId(), and print().

XYZPoint BaseCrystal::center_
private

Definition at line 114 of file BaseCrystal.h.

Referenced by computeBasicProperties(), getCenter(), and print().

XYZPoint BaseCrystal::corners_[8]
private
XYZVector BaseCrystal::crystalaxis_
private

Definition at line 119 of file BaseCrystal.h.

Referenced by computeBasicProperties(), and getAxis().

XYZVector BaseCrystal::exitingNormal_[6]
private

Definition at line 122 of file BaseCrystal.h.

Referenced by computeBasicProperties(), exitingNormal(), and print().

XYZVector BaseCrystal::fifthedgedirection_
private

Definition at line 118 of file BaseCrystal.h.

Referenced by computeBasicProperties(), and getFifthEdge().

XYZVector BaseCrystal::firstedgedirection_
private

Definition at line 117 of file BaseCrystal.h.

Referenced by computeBasicProperties(), and getFirstEdge().

XYZPoint BaseCrystal::frontcenter_
private

Definition at line 115 of file BaseCrystal.h.

Referenced by computeBasicProperties(), getFrontCenter(), and print().

XYZVector BaseCrystal::lateraldirection_[4]
private

Definition at line 120 of file BaseCrystal.h.

Referenced by computeBasicProperties(), and getLateralEdge().

Plane3D BaseCrystal::lateralPlane_[6]
private
int BaseCrystal::subdetn_
private

Definition at line 113 of file BaseCrystal.h.

Referenced by BaseCrystal(), getSubdetNumber(), and setCorners().