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 | Protected 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 = 4 }
 
enum  { k_NumberOfParametersPerShape = 4 }
 
typedef EcalPreshowerGeometryRecord AlignedRecord
 
typedef ESAlignmentRcd AlignmentRecord
 
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::vector
< PreshowerStrip
CellVec
 
typedef ESDetId DetIdType
 
typedef IdealGeometryRecord IdealRecord
 
typedef
EcalPreshowerNumberingScheme 
NumberingScheme
 
typedef
CaloSubdetectorGeometry::ParVec 
ParVec
 
typedef
CaloSubdetectorGeometry::ParVecVec 
ParVecVec
 
typedef PEcalPreshowerRcd PGeometryRecord
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
- Public Types inherited from CaloSubdetectorGeometry
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::set< DetIdDetIdSet
 
typedef std::vector< CCGFloatDimVec
 
typedef std::vector< unsigned int > IVec
 
typedef CaloCellGeometry::ParMgr ParMgr
 
typedef CaloCellGeometry::ParVec ParVec
 
typedef CaloCellGeometry::ParVecVec ParVecVec
 
typedef std::vector< CCGFloatTrVec
 

Public Member Functions

 EcalPreshowerGeometry ()
 
virtual DetId getClosestCell (const GlobalPoint &r) const
 
virtual DetId getClosestCellInPlane (const GlobalPoint &r, int plane) const
 
virtual void initializeParms ()
 
virtual void newCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
 
virtual unsigned int numberOfParametersPerShape () const
 
virtual unsigned int numberOfShapes () const
 
virtual unsigned int numberOfTransformParms () const
 
void setzPlanes (CCGFloat z1minus, CCGFloat z2minus, CCGFloat z1plus, CCGFloat z2plus)
 
virtual ~EcalPreshowerGeometry ()
 The EcalPreshowerGeometry will delete all its cell geometries at destruction time. More...
 
- Public Member Functions inherited from CaloSubdetectorGeometry
void allocateCorners (CaloCellGeometry::CornersVec::size_type n)
 
void allocatePar (ParVec::size_type n, unsigned int m)
 
 CaloSubdetectorGeometry ()
 
CaloCellGeometry::CornersMgrcornersMgr ()
 
CCGFloat deltaEta (const DetId &detId) const
 
CCGFloat 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 void localCorners (Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
 
static unsigned int numberOfAlignments ()
 
static std::string producerTag ()
 

Protected Member Functions

virtual const CaloCellGeometrycellGeomPtr (uint32_t index) const
 

Private Attributes

CellVec m_cellVec
 
const CCGFloat m_xInterLadGap
 
const CCGFloat m_xIntraLadGap
 
const CCGFloat m_xWidWaf
 
const CCGFloat m_yCtrOff
 
const CCGFloat m_yWidAct
 
CCGFloat m_zplane [4]
 

Additional Inherited Members

- Static Protected Member Functions inherited from CaloSubdetectorGeometry
static CCGFloat deltaR (const GlobalPoint &p1, const GlobalPoint &p2)
 
- Protected Attributes inherited from CaloSubdetectorGeometry
ParVecVec m_parVecVec
 
std::vector< DetIdm_validIds
 

Detailed Description

Definition at line 14 of file EcalPreshowerGeometry.h.

Member Typedef Documentation

Definition at line 25 of file EcalPreshowerGeometry.h.

Definition at line 26 of file EcalPreshowerGeometry.h.

Definition at line 20 of file EcalPreshowerGeometry.h.

Definition at line 18 of file EcalPreshowerGeometry.h.

Definition at line 32 of file EcalPreshowerGeometry.h.

Definition at line 24 of file EcalPreshowerGeometry.h.

Definition at line 29 of file EcalPreshowerGeometry.h.

Definition at line 30 of file EcalPreshowerGeometry.h.

Definition at line 31 of file EcalPreshowerGeometry.h.

Definition at line 27 of file EcalPreshowerGeometry.h.

Definition at line 21 of file EcalPreshowerGeometry.h.

Definition at line 22 of file EcalPreshowerGeometry.h.

Member Enumeration Documentation

anonymous enum
anonymous enum
Enumerator
k_NumberOfShapes 

Definition at line 36 of file EcalPreshowerGeometry.h.

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 38 of file EcalPreshowerGeometry.h.

Constructor & Destructor Documentation

EcalPreshowerGeometry::EcalPreshowerGeometry ( )

Definition at line 13 of file EcalPreshowerGeometry.cc.

References m_zplane.

13  :
14  m_xWidWaf ( 6.3 ) ,
15  m_xInterLadGap ( 0.05 ) , // additional gap between wafers in adj ladders
16  m_xIntraLadGap ( 0.04 ) , // gap between wafers in same ladder
17  m_yWidAct ( 6.1 ) ,
18  m_yCtrOff ( 0.05 ) , // gap at center
20 {
21  m_zplane[0] = 0. ;
22  m_zplane[1] = 0. ;
23  m_zplane[2] = 0. ;
24  m_zplane[3] = 0. ;
25 }
EcalPreshowerGeometry::~EcalPreshowerGeometry ( )
virtual

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

Definition at line 28 of file EcalPreshowerGeometry.cc.

29 {
30 }

Member Function Documentation

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

Definition at line 79 of file EcalPreshowerGeometry.cc.

References DetId::Ecal.

80 {
81  return (unsigned int)DetId::Ecal - 1 ;
82 }
unsigned int EcalPreshowerGeometry::alignmentTransformIndexLocal ( const DetId id)
static

Definition at line 33 of file EcalPreshowerGeometry.cc.

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

34 {
35  const CaloGenericDetId gid ( id ) ;
36 
37  assert( gid.isES() ) ;
38 
39 // plane 2 is split into 2 dees along x=0 for both signs of z
40 
41 // plane 1 at zsign=-1 is split into 2 dees between six=19 and six=20 for siy<=20,
42 // and six=21 and 22 for siy>=21
43 
44 // plane 1 at zsign=+1 is split into 2 dees between six=20 and six=21 for siy<=20,
45 // and six=19 and 20 for siy>=21
46 
47 
48 // Desired numbering
49 // LEFT RIGHT (as one faces the Dee from the IP)
50 // ES- pl=2 0 1
51 // pl=1 2 3 the reversal of pl=2 and pl=1 is intentional here (CM Kuo)
52 // ES+ pl=1 4 5
53 // pl=2 6 7
54 
55  const ESDetId esid ( id ) ;
56  const int jx ( esid.six() - 1 ) ;
57  const int jy ( esid.siy() - 1 ) ;
58  const int jz ( esid.zside() + 1 ) ;
59  const int pl ( esid.plane() - 1 ) ;
60  const bool second ( 1 == pl ) ;
61  const bool top ( 19 < jy ) ;
62  const bool negz ( 0 == jz ) ;
63  const int lrl ( 19>jx ? 0 : 1 ) ;
64  const int lrr ( 21>jx ? 0 : 1 ) ;
65 
66  return ( second ? jx/20 + 3*jz : // 2nd plane split along middle
67  ( negz && !top ? lrl + 2 : // 1st plane at neg z and bottom half split at six=19&20
68  ( negz && top ? lrr + 2 : // 1st plane at neg z and top half split at six=21&22
69  ( !negz && !top ? lrr + 4 : lrl + 4 ) ) ) ) ; // opposite at positive z
70 }
U second(std::pair< T, U > const &p)
const CaloCellGeometry * EcalPreshowerGeometry::cellGeomPtr ( uint32_t  index) const
protectedvirtual

Implements CaloSubdetectorGeometry.

Definition at line 260 of file EcalPreshowerGeometry.cc.

References m_cellVec, and CaloCellGeometry::param().

261 {
262  const CaloCellGeometry* cell ( &m_cellVec[ index ] ) ;
263  return ( m_cellVec.size() < index ||
264  0 == cell->param() ? 0 : cell ) ;
265 }
static std::string EcalPreshowerGeometry::dbString ( )
inlinestatic

Definition at line 40 of file EcalPreshowerGeometry.h.

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

Definition at line 73 of file EcalPreshowerGeometry.cc.

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

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 169 of file EcalPreshowerGeometry.cc.

References getClosestCellInPlane().

170 {
171  return getClosestCellInPlane( point, 2 );
172 }
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 175 of file EcalPreshowerGeometry.cc.

References CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), ESDetId::ISTRIP_MAX, ESDetId::ISTRIP_MIN, m_xInterLadGap, m_xIntraLadGap, m_xWidWaf, m_yCtrOff, m_yWidAct, m_zplane, AlCaHLTBitMon_ParallelJobs::p, CaloSubdetectorGeometry::present(), ESDetId::validDetId(), PV3DBase< T, PVType, FrameType >::x(), vdt::x, detailsBasic3DVector::y, PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

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

177 {
178  const CCGFloat x ( point.x() ) ;
179  const CCGFloat y ( point.y() ) ;
180  const CCGFloat z ( point.z() ) ;
181 
182  if( 0 == z ||
183  1 > plane ||
184  2 < plane ) return DetId( 0 ) ;
185 
186  const unsigned int iz ( ( 0>z ? 0 : 2 ) + plane - 1 ) ;
187 
188  const CCGFloat ze ( m_zplane[iz] ) ;
189  const CCGFloat xe ( x * ze/z ) ;
190  const CCGFloat ye ( y * ze/z ) ;
191 
192  const CCGFloat x0 ( 1 == plane ? xe : ye ) ;
193  const CCGFloat y0 ( 1 == plane ? ye : xe ) ;
194 
195  static const CCGFloat xWid ( m_xWidWaf + m_xIntraLadGap + m_xInterLadGap ) ;
196 
197  const int row ( 1 + int( y0 + 20.*m_yWidAct - m_yCtrOff )/m_yWidAct ) ;
198  const int col ( 1 + int( ( x0 + 20.*xWid )/xWid ) ) ;
199 
200  CCGFloat closest ( 1e9 ) ;
201 
202  DetId detId ( 0 ) ;
203 
204  const int jz ( 0 > ze ? -1 : 1 ) ;
205 
206 
207 // std::cout<<"** p="<<point<<", ("<<xe<<", "<<ye<<", "<<ze<<"), row="<<row<<", col="<<col<<std::endl;
208 
209  for( int ix ( -1 ); ix != 2 ; ++ix ) // search within +-1 in row and col
210  {
211  for( int iy ( -1 ); iy != 2 ; ++iy )
212  {
213  for( int jstrip ( ESDetId::ISTRIP_MIN ) ; jstrip <= ESDetId::ISTRIP_MAX ; ++jstrip )
214  {
215  const int jx ( 1 == plane ? col + ix : row + iy ) ;
216  const int jy ( 1 == plane ? row + iy : col + ix ) ;
217  if( ESDetId::validDetId( jstrip, jx, jy, plane, jz ) )
218  {
219  const ESDetId esId ( jstrip, jx, jy, plane, jz ) ;
220  const CaloCellGeometry* cell ( getGeometry( esId ) ) ;
221  if( 0 != cell )
222  {
223  const GlobalPoint& p ( cell->getPosition() ) ;
224  const CCGFloat dist2 ( (p.x()-xe)*(p.x()-xe) + (p.y()-ye)*(p.y()-ye) ) ;
225  if( dist2 < closest && present( esId ) )
226  {
227  closest = dist2 ;
228  detId = esId ;
229  }
230  }
231  }
232  }
233  }
234  }
235  return detId ;
236 }
static const int ISTRIP_MAX
Definition: ESDetId.h:62
double double double z
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
virtual bool present(const DetId &id) const
is this detid present in the geometry?
CaloCellGeometry::CCGFloat CCGFloat
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
x
Definition: VDTMath.h:216
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 67 of file EcalPreshowerGeometry.h.

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 86 of file EcalPreshowerGeometry.cc.

References CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), CaloSubdetectorGeometry::getValidDetIds(), i, ESDetId::plane(), setzPlanes(), PV3DBase< T, PVType, FrameType >::z(), and ESDetId::zside().

87 {
88  unsigned int n1minus ( 0 ) ;
89  unsigned int n2minus ( 0 ) ;
90  unsigned int n1plus ( 0 ) ;
91  unsigned int n2plus ( 0 ) ;
92  CCGFloat z1minus ( 0 ) ;
93  CCGFloat z2minus ( 0 ) ;
94  CCGFloat z1plus ( 0 ) ;
95  CCGFloat z2plus ( 0 ) ;
96  const std::vector<DetId>& esDetIds ( getValidDetIds() ) ;
97 
98  for( unsigned int i ( 0 ) ; i != esDetIds.size() ; ++i )
99  {
100  const ESDetId esid ( esDetIds[i] ) ;
101  const CaloCellGeometry* cell ( getGeometry( esid ) ) ;
102  if( 0 != cell )
103  {
104  const CCGFloat zz ( cell->getPosition().z() ) ;
105  if( 1 == esid.plane() )
106  {
107  if( 0 > esid.zside() )
108  {
109  z1minus += zz ;
110  ++n1minus ;
111  }
112  else
113  {
114  z1plus += zz ;
115  ++n1plus ;
116  }
117  }
118  if( 2 == esid.plane() )
119  {
120  if( 0 > esid.zside() )
121  {
122  z2minus += zz ;
123  ++n2minus ;
124  }
125  else
126  {
127  z2plus += zz ;
128  ++n2plus ;
129  }
130  }
131  }
132  }
133  assert( 0 != n1minus &&
134  0 != n2minus &&
135  0 != n1plus &&
136  0 != n2plus ) ;
137  z1minus /= (1.*n1minus) ;
138  z2minus /= (1.*n2minus) ;
139  z1plus /= (1.*n1plus) ;
140  z2plus /= (1.*n2plus) ;
141  assert( 0 != z1minus &&
142  0 != z2minus &&
143  0 != z1plus &&
144  0 != z2plus ) ;
145  setzPlanes( z1minus, z2minus, z1plus, z2plus ) ;
146 }
int i
Definition: DBlmapReader.cc:9
void setzPlanes(CCGFloat z1minus, CCGFloat z2minus, CCGFloat z1plus, CCGFloat 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)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
CaloCellGeometry::CCGFloat CCGFloat
void EcalPreshowerGeometry::localCorners ( Pt3DVec lc,
const CCGFloat pv,
unsigned int  i,
Pt3D ref 
)
static

Definition at line 239 of file EcalPreshowerGeometry.cc.

References PreshowerStrip::localCorners().

243 {
244  PreshowerStrip::localCorners( lc, pv, ref ) ;
245 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
void EcalPreshowerGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
virtual

Implements CaloSubdetectorGeometry.

Definition at line 248 of file EcalPreshowerGeometry.cc.

References CaloSubdetectorGeometry::cornersMgr(), m_cellVec, and CaloSubdetectorGeometry::m_validIds.

253 {
254  const unsigned int cellIndex ( ESDetId( detId ).denseIndex() ) ;
255  m_cellVec[ cellIndex ] = PreshowerStrip( f1, cornersMgr(), parm ) ;
256  m_validIds.push_back( detId ) ;
257 }
A base class to handle the shape of preshower strips.
std::vector< DetId > m_validIds
CaloCellGeometry::CornersMgr * cornersMgr()
static unsigned int EcalPreshowerGeometry::numberOfAlignments ( )
inlinestatic

Definition at line 71 of file EcalPreshowerGeometry.h.

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

71 { 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 65 of file EcalPreshowerGeometry.h.

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

Definition at line 69 of file EcalPreshowerGeometry.h.

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

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

Definition at line 150 of file EcalPreshowerGeometry.cc.

References m_zplane.

Referenced by initializeParms().

154 {
155  assert( 0 > z1minus &&
156  0 > z2minus &&
157  0 < z1plus &&
158  0 < z2plus ) ;
159 
160  m_zplane[0] = z1minus ;
161  m_zplane[1] = z2minus ;
162  m_zplane[2] = z1plus ;
163  m_zplane[3] = z2plus ;
164 }

Member Data Documentation

CellVec EcalPreshowerGeometry::m_cellVec
private

Definition at line 104 of file EcalPreshowerGeometry.h.

Referenced by cellGeomPtr(), and newCell().

const CCGFloat EcalPreshowerGeometry::m_xInterLadGap
private

Definition at line 96 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

const CCGFloat EcalPreshowerGeometry::m_xIntraLadGap
private

Definition at line 97 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

const CCGFloat EcalPreshowerGeometry::m_xWidWaf
private

Definition at line 95 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

const CCGFloat EcalPreshowerGeometry::m_yCtrOff
private

Definition at line 100 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

const CCGFloat EcalPreshowerGeometry::m_yWidAct
private

Definition at line 99 of file EcalPreshowerGeometry.h.

Referenced by getClosestCellInPlane().

CCGFloat EcalPreshowerGeometry::m_zplane[4]
private