CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
EcalPreshowerGeometry Class Reference

#include <EcalPreshowerGeometry.h>

Inheritance diagram for EcalPreshowerGeometry:
CaloSubdetectorGeometry

Public Types

enum  { k_NumberOfCellsForCorners = ESDetId::kSizeForDenseIndexing }
 
enum  { k_NumberOfShapes = 2 }
 
enum  { k_NumberOfParametersPerShape = 3 }
 
typedef EcalPreshowerGeometryRecord AlignedRecord
 
typedef ESAlignmentRcd AlignmentRecord
 
typedef ESDetId DetIdType
 
typedef IdealGeometryRecord IdealRecord
 
typedef
EcalPreshowerNumberingScheme 
NumberingScheme
 
typedef
CaloSubdetectorGeometry::ParVec 
ParVec
 
typedef
CaloSubdetectorGeometry::ParVecVec 
ParVecVec
 
typedef PEcalPreshowerRcd PGeometryRecord
 
- Public Types inherited from CaloSubdetectorGeometry
typedef std::vector< const
CaloCellGeometry * > 
CellCont
 
typedef std::set< DetIdDetIdSet
 
typedef std::vector< double > DimVec
 
typedef std::vector< unsigned int > IVec
 
typedef CaloCellGeometry::ParMgr ParMgr
 
typedef CaloCellGeometry::ParVec ParVec
 
typedef CaloCellGeometry::ParVecVec ParVecVec
 
typedef std::vector< double > TrVec
 

Public Member Functions

 EcalPreshowerGeometry ()
 
virtual DetId getClosestCell (const GlobalPoint &r) const
 
virtual DetId getClosestCellInPlane (const GlobalPoint &r, int plane) const
 
virtual void initializeParms ()
 
virtual unsigned int numberOfParametersPerShape () const
 
virtual unsigned int numberOfShapes () const
 
virtual unsigned int numberOfTransformParms () const
 
void setzPlanes (float z1minus, float z2minus, float z1plus, float z2plus)
 
virtual ~EcalPreshowerGeometry ()
 The EcalPreshowerGeometry will delete all its cell geometries at destruction time. More...
 
- Public Member Functions inherited from CaloSubdetectorGeometry
void addCell (const DetId &id, CaloCellGeometry *ccg)
 Add a cell to the geometry. More...
 
void allocateCorners (CaloCellGeometry::CornersVec::size_type n)
 
void allocatePar (ParVec::size_type n, unsigned int m)
 
 CaloSubdetectorGeometry ()
 
const CellContcellGeometries () const
 the cells More...
 
CaloCellGeometry::CornersMgrcornersMgr ()
 
double deltaEta (const DetId &detId) const
 
double deltaPhi (const DetId &detId) const
 
virtual void fillDefaultNamedParameters () const
 
virtual DetIdSet getCells (const GlobalPoint &r, double dR) const
 Get a list of all cells within a dR of the given cell. More...
 
virtual const CaloCellGeometrygetGeometry (const DetId &id) const
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
void getSummary (TrVec &trVector, IVec &iVector, DimVec &dimVector) const
 
virtual const std::vector
< DetId > & 
getValidDetIds (DetId::Detector det=DetId::Detector(0), int subdet=0) const
 Get a list of valid detector ids (for the given subdetector) More...
 
ParMgrparMgr ()
 
const ParMgrparMgrConst () const
 
ParVecVecparVecVec ()
 
const ParVecVecparVecVec () const
 
virtual bool present (const DetId &id) const
 is this detid present in the geometry? More...
 
virtual ~CaloSubdetectorGeometry ()
 The base class DOES assume that it owns the CaloCellGeometry objects. More...
 

Static Public Member Functions

static unsigned int alignmentTransformIndexGlobal (const DetId &id)
 
static unsigned int alignmentTransformIndexLocal (const DetId &id)
 
static std::string dbString ()
 
static DetId detIdFromLocalAlignmentIndex (unsigned int iLoc)
 
static std::string hitString ()
 
static std::vector
< HepGeom::Point3D< double > > 
localCorners (const double *pv, unsigned int i, HepGeom::Point3D< double > &ref)
 
static CaloCellGeometrynewCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, CaloCellGeometry::CornersMgr *mgr, const double *parm, const DetId &detId)
 
static unsigned int numberOfAlignments ()
 
static std::string producerTag ()
 

Private Attributes

const double m_xInterLadGap
 
const double m_xIntraLadGap
 
const double m_xWidWaf
 
const double m_yCtrOff
 
const double m_yWidAct
 
double m_zplane [4]
 

Additional Inherited Members

- Static Protected Member Functions inherited from CaloSubdetectorGeometry
static double deltaR (const GlobalPoint &p1, const GlobalPoint &p2)
 
- Protected Attributes inherited from CaloSubdetectorGeometry
ParVecVec m_parVecVec
 

Detailed Description

Definition at line 13 of file EcalPreshowerGeometry.h.

Member Typedef Documentation

Definition at line 18 of file EcalPreshowerGeometry.h.

Definition at line 19 of file EcalPreshowerGeometry.h.

Definition at line 25 of file EcalPreshowerGeometry.h.

Definition at line 17 of file EcalPreshowerGeometry.h.

Definition at line 22 of file EcalPreshowerGeometry.h.

Definition at line 23 of file EcalPreshowerGeometry.h.

Definition at line 24 of file EcalPreshowerGeometry.h.

Definition at line 20 of file EcalPreshowerGeometry.h.

Member Enumeration Documentation

anonymous enum
anonymous enum
Enumerator
k_NumberOfShapes 

Definition at line 29 of file EcalPreshowerGeometry.h.

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 31 of file EcalPreshowerGeometry.h.

Constructor & Destructor Documentation

EcalPreshowerGeometry::EcalPreshowerGeometry ( )

Definition at line 8 of file EcalPreshowerGeometry.cc.

8  :
9  m_xWidWaf ( 6.3 ) ,
10  m_xInterLadGap ( 0.05 ) , // additional gap between wafers in adj ladders
11  m_xIntraLadGap ( 0.04 ) , // gap between wafers in same ladder
12  m_yWidAct ( 6.1 ) ,
13  m_yCtrOff ( 0.05 ) // gap at center
14 {
15 }
EcalPreshowerGeometry::~EcalPreshowerGeometry ( )
virtual

The EcalPreshowerGeometry will delete all its cell geometries at destruction time.

Definition at line 18 of file EcalPreshowerGeometry.cc.

18 {}

Member Function Documentation

unsigned int EcalPreshowerGeometry::alignmentTransformIndexGlobal ( const DetId id)
static

Definition at line 67 of file EcalPreshowerGeometry.cc.

References DetId::Ecal.

68 {
69  return (unsigned int)DetId::Ecal - 1 ;
70 }
unsigned int EcalPreshowerGeometry::alignmentTransformIndexLocal ( const DetId id)
static

Definition at line 21 of file EcalPreshowerGeometry.cc.

References CaloGenericDetId::isES(), and edm::second().

22 {
23  const CaloGenericDetId gid ( id ) ;
24 
25  assert( gid.isES() ) ;
26 
27 // plane 2 is split into 2 dees along x=0 for both signs of z
28 
29 // plane 1 at zsign=-1 is split into 2 dees between six=19 and six=20 for siy<=20,
30 // and six=21 and 22 for siy>=21
31 
32 // plane 1 at zsign=+1 is split into 2 dees between six=20 and six=21 for siy<=20,
33 // and six=19 and 20 for siy>=21
34 
35 
36 // Desired numbering
37 // LEFT RIGHT (as one faces the Dee from the IP)
38 // ES- pl=2 0 1
39 // pl=1 2 3 the reversal of pl=2 and pl=1 is intentional here (CM Kuo)
40 // ES+ pl=1 4 5
41 // pl=2 6 7
42 
43  const ESDetId esid ( id ) ;
44  const int jx ( esid.six() - 1 ) ;
45  const int jy ( esid.siy() - 1 ) ;
46  const int jz ( esid.zside() + 1 ) ;
47  const int pl ( esid.plane() - 1 ) ;
48  const bool second ( 1 == pl ) ;
49  const bool top ( 19 < jy ) ;
50  const bool negz ( 0 == jz ) ;
51  const int lrl ( 20>jx ? 0 : 1 ) ;
52  const int lrr ( 22>jx ? 0 : 1 ) ;
53 
54  return ( second ? jx/20 + 3*jz : // 2nd plane split along middle
55  ( negz && !top ? lrl + 2 : // 1st plane at neg z and bottom half split at six=19&20
56  ( negz && top ? lrr + 2 : // 1st plane at neg z and top half split at six=21&22
57  ( !negz && !top ? lrr + 4 : lrl + 4 ) ) ) ) ; // opposite at positive z
58 }
U second(std::pair< T, U > const &p)
static std::string EcalPreshowerGeometry::dbString ( )
inlinestatic

Definition at line 33 of file EcalPreshowerGeometry.h.

33 { return "PEcalPreshowerRcd" ; }
DetId EcalPreshowerGeometry::detIdFromLocalAlignmentIndex ( unsigned int  iLoc)
static

Definition at line 61 of file EcalPreshowerGeometry.cc.

Referenced by FakeCaloAlignmentEP::produceESAli(), and TestCaloAlignmentEP::produceESAli().

62 {
63  return ESDetId( 1, 10 + 20*( iLoc%2 ), 10, 2>iLoc || 5<iLoc ? 2 : 1, 2*( iLoc/4 ) - 1 ) ;
64 }
DetId EcalPreshowerGeometry::getClosestCell ( const GlobalPoint r) const
virtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 155 of file EcalPreshowerGeometry.cc.

References getClosestCellInPlane().

156 {
157  return getClosestCellInPlane( point, 2 );
158 }
virtual DetId getClosestCellInPlane(const GlobalPoint &r, int plane) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
DetId EcalPreshowerGeometry::getClosestCellInPlane ( const GlobalPoint r,
int  plane 
) const
virtual

Definition at line 161 of file EcalPreshowerGeometry.cc.

References CaloSubdetectorGeometry::cellGeometries(), ESDetId::denseIndex(), getHLTprescales::index, ESDetId::ISTRIP_MAX, ESDetId::ISTRIP_MIN, m_xInterLadGap, m_xIntraLadGap, m_xWidWaf, m_yCtrOff, m_yWidAct, m_zplane, L1TEmulatorMonitor_cff::p, CaloSubdetectorGeometry::present(), ESDetId::validDetId(), x, PV3DBase< T, PVType, FrameType >::x(), detailsBasic3DVector::y, PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by PreshowerHitMaker::addHit(), getClosestCell(), and ReducedESRecHitCollectionProducer::produce().

163 {
164  const double x ( point.x() ) ;
165  const double y ( point.y() ) ;
166  const double z ( point.z() ) ;
167 
168  if( 0 == z ||
169  1 > plane ||
170  2 < plane ) return DetId( 0 ) ;
171 
172  const unsigned int iz ( ( 0>z ? 0 : 2 ) + plane - 1 ) ;
173 
174  const double ze ( m_zplane[iz] ) ;
175  const double xe ( x * ze/z ) ;
176  const double ye ( y * ze/z ) ;
177 
178  const double x0 ( 1 == plane ? xe : ye ) ;
179  const double y0 ( 1 == plane ? ye : xe ) ;
180 
181  static const double xWid ( m_xWidWaf + m_xIntraLadGap + m_xInterLadGap ) ;
182 
183  const int row ( 1 + int( y0 + 20.*m_yWidAct - m_yCtrOff )/m_yWidAct ) ;
184  const int col ( 1 + int( ( x0 + 20.*xWid )/xWid ) ) ;
185 
186  double closest ( 1e9 ) ;
187 
188  DetId detId ( 0 ) ;
189 
190  const int jz ( 0 > ze ? -1 : 1 ) ;
191 
192 
193 // std::cout<<"** p="<<point<<", ("<<xe<<", "<<ye<<", "<<ze<<"), row="<<row<<", col="<<col<<std::endl;
194 
195  for( int ix ( -1 ); ix != 2 ; ++ix ) // search within +-1 in row and col
196  {
197  for( int iy ( -1 ); iy != 2 ; ++iy )
198  {
199  for( int jstrip ( ESDetId::ISTRIP_MIN ) ; jstrip <= ESDetId::ISTRIP_MAX ; ++jstrip )
200  {
201  const int jx ( 1 == plane ? col + ix : row + iy ) ;
202  const int jy ( 1 == plane ? row + iy : col + ix ) ;
203  if( ESDetId::validDetId( jstrip, jx, jy, plane, jz ) )
204  {
205  const ESDetId esId ( jstrip, jx, jy, plane, jz ) ;
206  const unsigned int index ( esId.denseIndex() ) ;
207  const GlobalPoint& p ( cellGeometries()[ index ]->getPosition() ) ;
208  const double dist2 ( (p.x()-xe)*(p.x()-xe) + (p.y()-ye)*(p.y()-ye) ) ;
209  if( dist2 < closest && present( esId ) )
210  {
211  closest = dist2 ;
212  detId = esId ;
213  }
214  }
215  }
216  }
217  }
218  return detId ;
219 }
static const int ISTRIP_MAX
Definition: ESDetId.h:62
double double double z
virtual bool present(const DetId &id) const
is this detid present in the geometry?
const CellCont & cellGeometries() const
the cells
Definition: DetId.h:20
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:50
Definition: DDAxes.h:10
static const int ISTRIP_MIN
Definition: ESDetId.h:61
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
static std::string EcalPreshowerGeometry::hitString ( )
inlinestatic

Definition at line 60 of file EcalPreshowerGeometry.h.

60 { return "EcalHitsES" ; }
void EcalPreshowerGeometry::initializeParms ( )
virtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 74 of file EcalPreshowerGeometry.cc.

References CaloSubdetectorGeometry::cellGeometries(), CaloSubdetectorGeometry::getValidDetIds(), i, ESDetId::plane(), setzPlanes(), and ESDetId::zside().

75 {
77  unsigned int n1minus ( 0 ) ;
78  unsigned int n2minus ( 0 ) ;
79  unsigned int n1plus ( 0 ) ;
80  unsigned int n2plus ( 0 ) ;
81  double z1minus ( 0 ) ;
82  double z2minus ( 0 ) ;
83  double z1plus ( 0 ) ;
84  double z2plus ( 0 ) ;
85  const Cont& con ( cellGeometries() ) ;
86  for( unsigned int i ( 0 ) ; i != con.size() ; ++i )
87  {
88  const ESDetId esid ( getValidDetIds()[i] ) ;
89  if( 1 == esid.plane() )
90  {
91  if( 0 > esid.zside() )
92  {
93  z1minus += con[i]->getPosition().z() ;
94  ++n1minus ;
95  }
96  else
97  {
98  z1plus += con[i]->getPosition().z() ;
99  ++n1plus ;
100  }
101  }
102  if( 2 == esid.plane() )
103  {
104  if( 0 > esid.zside() )
105  {
106  z2minus += con[i]->getPosition().z() ;
107  ++n2minus ;
108  }
109  else
110  {
111  z2plus += con[i]->getPosition().z() ;
112  ++n2plus ;
113  }
114  }
115 // if( 0 == z1 && 1 == esid.plane() ) z1 = fabs( i->second->getPosition().z() ) ;
116 // if( 0 == z2 && 2 == esid.plane() ) z2 = fabs( i->second->getPosition().z() ) ;
117 // if( 0 != z1 && 0 != z2 ) break ;
118  }
119  assert( 0 != n1minus &&
120  0 != n2minus &&
121  0 != n1plus &&
122  0 != n2plus ) ;
123  z1minus /= (1.*n1minus) ;
124  z2minus /= (1.*n2minus) ;
125  z1plus /= (1.*n1plus) ;
126  z2plus /= (1.*n2plus) ;
127  assert( 0 != z1minus &&
128  0 != z2minus &&
129  0 != z1plus &&
130  0 != z2plus ) ;
131  setzPlanes( z1minus, z2minus, z1plus, z2plus ) ;
132 }
int i
Definition: DBlmapReader.cc:9
std::vector< const CaloCellGeometry * > CellCont
void setzPlanes(float z1minus, float z2minus, float z1plus, float z2plus)
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
const CellCont & cellGeometries() const
the cells
std::vector< HepGeom::Point3D< double > > EcalPreshowerGeometry::localCorners ( const double *  pv,
unsigned int  i,
HepGeom::Point3D< double > &  ref 
)
static

Definition at line 222 of file EcalPreshowerGeometry.cc.

References PreshowerStrip::localCorners().

225 {
226  return ( PreshowerStrip::localCorners( pv, ref ) ) ;
227 }
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
CaloCellGeometry * EcalPreshowerGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
CaloCellGeometry::CornersMgr mgr,
const double *  parm,
const DetId detId 
)
static

Definition at line 230 of file EcalPreshowerGeometry.cc.

236 {
237  return ( new PreshowerStrip( f1, mgr , parm ) ) ;
238 }
A base class to handle the shape of preshower strips.
static unsigned int EcalPreshowerGeometry::numberOfAlignments ( )
inlinestatic

Definition at line 64 of file EcalPreshowerGeometry.h.

Referenced by FakeCaloAlignmentEP::produceESAli(), and TestCaloAlignmentEP::produceESAli().

64 { return 8 ; }
virtual unsigned int EcalPreshowerGeometry::numberOfParametersPerShape ( ) const
inlinevirtual
virtual unsigned int EcalPreshowerGeometry::numberOfShapes ( ) const
inlinevirtual
virtual unsigned int EcalPreshowerGeometry::numberOfTransformParms ( ) const
inlinevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 58 of file EcalPreshowerGeometry.h.

58 { return 3 ; }
static std::string EcalPreshowerGeometry::producerTag ( )
inlinestatic

Definition at line 62 of file EcalPreshowerGeometry.h.

Referenced by PCaloGeometryBuilder::beginRun(), and CaloGeometryBuilder::produceAligned().

62 { return "EcalPreshower" ; }
void EcalPreshowerGeometry::setzPlanes ( float  z1minus,
float  z2minus,
float  z1plus,
float  z2plus 
)

Definition at line 136 of file EcalPreshowerGeometry.cc.

References m_zplane.

Referenced by initializeParms().

140 {
141  assert( 0 > z1minus &&
142  0 > z2minus &&
143  0 < z1plus &&
144  0 < z2plus ) ;
145 
146  m_zplane[0] = z1minus ;
147  m_zplane[1] = z2minus ;
148  m_zplane[2] = z1plus ;
149  m_zplane[3] = z2plus ;
150 }

Member Data Documentation

const double EcalPreshowerGeometry::m_xInterLadGap
private

Definition at line 86 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

const double EcalPreshowerGeometry::m_xIntraLadGap
private

Definition at line 87 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

const double EcalPreshowerGeometry::m_xWidWaf
private

Definition at line 85 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

const double EcalPreshowerGeometry::m_yCtrOff
private

Definition at line 90 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

const double EcalPreshowerGeometry::m_yWidAct
private

Definition at line 89 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

double EcalPreshowerGeometry::m_zplane[4]
private

Definition at line 92 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane(), and setzPlanes().