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 | Private Attributes
CaloGeometryDBEP< T, U > Class Template Reference

#include <CaloGeometryDBEP.h>

Inheritance diagram for CaloGeometryDBEP< T, U >:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef
CaloSubdetectorGeometry::DimVec 
DimVec
 
typedef
CaloSubdetectorGeometry::IVec 
IVec
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
typedef boost::shared_ptr
< CaloSubdetectorGeometry
PtrType
 
typedef CaloCellGeometry::Tr3D Tr3D
 
typedef
CaloSubdetectorGeometry::TrVec 
TrVec
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

 CaloGeometryDBEP (const edm::ParameterSet &ps)
 
template<>
CaloGeometryDBEP< HcalGeometry,
CaloGeometryDBReader >
::PtrType 
produceAligned (const typename HcalGeometry::AlignedRecord &iRecord)
 
template<>
CaloGeometryDBEP< HcalGeometry,
CaloGeometryDBWriter >
::PtrType 
produceAligned (const typename HcalGeometry::AlignedRecord &iRecord)
 
PtrType produceAligned (const typename T::AlignedRecord &iRecord)
 
template<>
CaloGeometryDBEP
< CaloTowerGeometry,
CaloGeometryDBReader >
::PtrType 
produceAligned (const typename CaloTowerGeometry::AlignedRecord &iRecord)
 
template<>
CaloGeometryDBEP
< CaloTowerGeometry,
CaloGeometryDBWriter >
::PtrType 
produceAligned (const typename CaloTowerGeometry::AlignedRecord &iRecord)
 
virtual ~CaloGeometryDBEP ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Private Attributes

bool m_applyAlignment
 
const edm::ParameterSet m_pSet
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

template<class T, class U>
class CaloGeometryDBEP< T, U >

Definition at line 37 of file CaloGeometryDBEP.h.

Member Typedef Documentation

template<class T, class U>
typedef CaloCellGeometry::CCGFloat CaloGeometryDBEP< T, U >::CCGFloat

Definition at line 41 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloSubdetectorGeometry::DimVec CaloGeometryDBEP< T, U >::DimVec

Definition at line 48 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloSubdetectorGeometry::IVec CaloGeometryDBEP< T, U >::IVec

Definition at line 49 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloCellGeometry::Pt3D CaloGeometryDBEP< T, U >::Pt3D

Definition at line 42 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloCellGeometry::Pt3DVec CaloGeometryDBEP< T, U >::Pt3DVec

Definition at line 43 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef boost::shared_ptr< CaloSubdetectorGeometry > CaloGeometryDBEP< T, U >::PtrType

Definition at line 46 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloCellGeometry::Tr3D CaloGeometryDBEP< T, U >::Tr3D

Definition at line 44 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloSubdetectorGeometry::TrVec CaloGeometryDBEP< T, U >::TrVec

Definition at line 47 of file CaloGeometryDBEP.h.

Constructor & Destructor Documentation

template<class T, class U>
CaloGeometryDBEP< T, U >::CaloGeometryDBEP ( const edm::ParameterSet ps)
inline

Definition at line 51 of file CaloGeometryDBEP.h.

References edm::ESProducer::setWhatProduced().

51  :
52  m_applyAlignment ( ps.getParameter<bool>("applyAlignment") ),
53  m_pSet( ps )
54 
55  {
56  setWhatProduced( this,
58  edm::es::Label( T::producerTag() ) ) ;//+std::string("TEST") ) ) ;
59  }
T getParameter(std::string const &) const
const edm::ParameterSet m_pSet
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
template<class T, class U>
virtual CaloGeometryDBEP< T, U >::~CaloGeometryDBEP ( )
inlinevirtual

Definition at line 61 of file CaloGeometryDBEP.h.

61 {}

Member Function Documentation

Definition at line 10 of file moduleDB.cc.

References HcalGeometry::alignmentTransformIndexGlobal(), HcalGeometry::alignmentTransformIndexLocal(), assert(), HcalGeometry::dbString(), edm::eventsetup::EventSetupRecord::get(), CaloCellGeometry::getParmPtr(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), CaloSubdetectorGeometry::getSummary(), relval_steps::gt, i, edm::ESHandleBase::isValid(), j, findQualityFiles::jj, HcalGeometry::k_NumberOfParametersPerShape, Alignments::m_align, HcalGeometry::numberOfAlignments(), HcalGeometry::producerTag(), edm::ESHandle< class >::product(), AlCaHLTBitMon_QueryRunRegistry::string, CaloGeometryDBReader::writeFlag(), CaloGeometryDBReader::writeIndexed(), and create_public_lumi_plots::xy.

10  {
11  const Alignments* alignPtr ( 0 ) ;
12  const Alignments* globalPtr ( 0 ) ;
13  if( m_applyAlignment ) {// get ptr if necessary
14  edm::ESHandle< Alignments > alignments ;
15  iRecord.getRecord< typename HcalGeometry::AlignmentRecord >().get( alignments ) ;
16 
17  assert( alignments.isValid() && // require valid alignments and expected size
18  ( alignments->m_align.size() == HcalGeometry::numberOfAlignments() ) ) ;
19  alignPtr = alignments.product() ;
20 
22  iRecord.getRecord<GlobalPositionRcd>().get( globals ) ;
23 
24  assert( globals.isValid() ) ;
25  globalPtr = globals.product() ;
26  }
27 
28  TrVec tvec ;
29  DimVec dvec ;
30  IVec ivec ;
31  IVec dins ;
32 
35  iRecord.get( HcalGeometry::producerTag() + std::string("_master"), pG ) ;
36 
37  const CaloSubdetectorGeometry* pGptr ( pG.product() ) ;
38 
39  pGptr->getSummary( tvec, ivec, dvec, dins ) ;
40 
41  CaloGeometryDBReader::writeIndexed( tvec, dvec, ivec, dins, HcalGeometry::dbString() ) ;
42  } else {
44  iRecord.getRecord<typename HcalGeometry::PGeometryRecord >().get( pG ) ;
45 
46  tvec = pG->getTranslation() ;
47  dvec = pG->getDimension() ;
48  ivec = pG->getIndexes() ;
49  dins = pG->getDenseIndices();
50  }
51  //*********************************************************************************************
52 
53 
54  edm::ESHandle<HcalTopology> hcalTopology;
55  iRecord.getRecord<HcalRecNumberingRecord>().get( hcalTopology );
56 
57  // We know that the numer of shapes chanes with changing depth
58  // so, this check is temporary disabled. We need to implement
59  // a way either to store or calculate the number of shapes or be able
60  // to deal with only max numer of shapes.
61  // assert( dvec.size() == hcalTopology->getNumberOfShapes() * HcalGeometry::k_NumberOfParametersPerShape ) ;
62  assert( dvec.size() <= hcalTopology->getNumberOfShapes() * HcalGeometry::k_NumberOfParametersPerShape ) ;
63  HcalGeometry* hcg=new HcalGeometry( *hcalTopology );
64 
65  PtrType ptr ( hcg );
66 
67  const unsigned int nTrParm ( tvec.size()/hcalTopology->ncells() ) ;
68 
69  ptr->fillDefaultNamedParameters() ;
70 
71  ptr->allocateCorners( hcalTopology->ncells() );
72 
73  ptr->allocatePar( dvec.size() ,
75 
76  for( unsigned int i ( 0 ) ; i < dins.size() ; ++i ) {
77  const unsigned int nPerShape ( HcalGeometry::k_NumberOfParametersPerShape);
78  DimVec dims ;
79  dims.reserve( nPerShape ) ;
80 
81  const unsigned int indx ( ivec.size()==1 ? 0 : i ) ;
82 
83  DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
84 
85  for( unsigned int j ( 0 ) ; j != nPerShape ; ++j ) {
86  dims.push_back( *dsrc ) ;
87  ++dsrc ;
88  }
89 
90  const CCGFloat* myParm ( CaloCellGeometry::getParmPtr( dims,
91  ptr->parMgr(),
92  ptr->parVecVec() ));
93 
94 
95  const DetId id ( hcalTopology->denseId2detId(dins[i]) );
96 
97  const unsigned int iGlob ( 0 == globalPtr ? 0 :
99 
100  assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
101 
102  const AlignTransform* gt ( 0 == globalPtr ? 0 : &globalPtr->m_align[ iGlob ] ) ;
103 
104  assert( 0 == gt || iGlob == HcalGeometry::alignmentTransformIndexGlobal( DetId( gt->rawId() ) ) ) ;
105 
106  const unsigned int iLoc ( 0 == alignPtr ? 0 :
108 
109  assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
110 
111  const AlignTransform* at ( 0 == alignPtr ? 0 :
112  &alignPtr->m_align[ iLoc ] ) ;
113 
114  assert( 0 == at || ( HcalGeometry::alignmentTransformIndexLocal( DetId( at->rawId() ) ) == iLoc ) ) ;
115 
116  Pt3D lRef ;
117  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
118  hcg->localCorners( lc, &dims.front(), dins[i], lRef ) ;
119 
120  const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ; // ctr rear face in local
121  const Pt3D lCor ( lc[0] ) ;
122 
123  //----------------------------------- create transform from 6 numbers ---
124  const unsigned int jj ( dins[i]*nTrParm ) ;
125  Tr3D tr ;
126  const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
127  const ROOT::Math::EulerAngles ea (
128  6==nTrParm ?
129  ROOT::Math::EulerAngles( tvec[jj+3], tvec[jj+4], tvec[jj+5] ) :
131  const ROOT::Math::Transform3D rt ( ea, tl ) ;
132  double xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz;
133  rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
134  tr = Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
135  yx, yy, yz,
136  zx, zy, zz ),
137  CLHEP::Hep3Vector(dx,dy,dz) );
138 
139  // now prepend alignment(s) for final transform
140  const Tr3D atr ( 0 == at ? tr :
141  ( 0 == gt ? at->transform()*tr :
142  at->transform()*gt->transform()*tr ) ) ;
143  //--------------------------------- done making transform ---------------
144 
145  const Pt3D gRef ( atr*lRef ) ;
146  const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
147  const Pt3D gBck ( atr*lBck ) ;
148  const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
149  const Pt3D gCor ( atr*lCor ) ;
150  const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
151 
152  assert( hcalTopology->detId2denseId(id) == dins[i] );
153 
154  ptr->newCell( fCtr, fBck, fCor, myParm, id ) ;
155  }
156 
157  ptr->initializeParms() ; // initializations; must happen after cells filled
158 
159  return ptr ;
160 }
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
assert(m_qm.get())
static std::string producerTag()
Definition: HcalGeometry.h:54
boost::shared_ptr< CaloSubdetectorGeometry > PtrType
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
CaloSubdetectorGeometry::IVec IVec
static void writeIndexed(const TrVec &, const DimVec &, const IVec &, const std::vector< uint32_t > &, std::string)
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
int j
Definition: DBlmapReader.cc:9
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::TrVec TrVec
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
static std::string dbString()
Definition: HcalGeometry.h:35
T const * product() const
Definition: ESHandle.h:86
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
CaloSubdetectorGeometry::DimVec DimVec
bool isValid() const
Definition: ESHandle.h:47
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:66

Definition at line 14 of file calowriters.cc.

References HcalGeometry::alignmentTransformIndexGlobal(), HcalGeometry::alignmentTransformIndexLocal(), assert(), HcalGeometry::dbString(), edm::eventsetup::EventSetupRecord::get(), CaloCellGeometry::getParmPtr(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), CaloSubdetectorGeometry::getSummary(), relval_steps::gt, i, edm::ESHandleBase::isValid(), j, findQualityFiles::jj, HcalGeometry::k_NumberOfParametersPerShape, Alignments::m_align, HcalGeometry::numberOfAlignments(), HcalGeometry::producerTag(), edm::ESHandle< class >::product(), AlCaHLTBitMon_QueryRunRegistry::string, CaloGeometryDBWriter::writeFlag(), CaloGeometryDBWriter::writeIndexed(), and create_public_lumi_plots::xy.

15 {
16  const Alignments* alignPtr ( 0 ) ;
17  const Alignments* globalPtr ( 0 ) ;
18  if( m_applyAlignment ) // get ptr if necessary
19  {
20  edm::ESHandle< Alignments > alignments ;
21  iRecord.getRecord< typename HcalGeometry::AlignmentRecord >().get( alignments ) ;
22 
23  assert( alignments.isValid() && // require valid alignments and expected size
24  ( alignments->m_align.size() == HcalGeometry::numberOfAlignments() ) ) ;
25  alignPtr = alignments.product() ;
26 
28  iRecord.getRecord<GlobalPositionRcd>().get( globals ) ;
29 
30  assert( globals.isValid() ) ;
31  globalPtr = globals.product() ;
32  }
33 
34  TrVec tvec ;
35  DimVec dvec ;
36  IVec ivec ;
37  IVec dins ;
38 
40  {
42  iRecord.get( HcalGeometry::producerTag() + std::string("_master"), pG ) ;
43 
44  const CaloSubdetectorGeometry* pGptr ( pG.product() ) ;
45 
46  pGptr->getSummary( tvec, ivec, dvec, dins ) ;
47 
48  CaloGeometryDBWriter::writeIndexed( tvec, dvec, ivec, dins, HcalGeometry::dbString() ) ;
49  }
50  else
51  {
53  iRecord.getRecord<typename HcalGeometry::PGeometryRecord >().get( pG ) ;
54 
55  tvec = pG->getTranslation() ;
56  dvec = pG->getDimension() ;
57  ivec = pG->getIndexes() ;
58  dins = pG->getDenseIndices();
59  }
60  //*********************************************************************************************
61 
62  edm::ESHandle<HcalTopology> hcalTopology;
63  iRecord.getRecord<HcalRecNumberingRecord>().get( hcalTopology );
64 
65  // We know that the numer of shapes chanes with changing depth
66  // so, this check is temporary disabled. We need to implement
67  // a way either to store or calculate the number of shapes or be able
68  // to deal with only max numer of shapes.
69  assert( dvec.size() <= hcalTopology->getNumberOfShapes() * HcalGeometry::k_NumberOfParametersPerShape ) ;
70  HcalGeometry* hcg=new HcalGeometry( *hcalTopology );
71  PtrType ptr ( hcg );
72 
73  const unsigned int nTrParm ( tvec.size()/hcalTopology->ncells() ) ;
74 
75  ptr->fillDefaultNamedParameters() ;
76 
77  ptr->allocateCorners( hcalTopology->ncells() ) ;
78 
79  ptr->allocatePar( dvec.size() ,
81 
82  for( unsigned int i ( 0 ) ; i < dins.size(); ++i )
83  {
84  const unsigned int nPerShape ( HcalGeometry::k_NumberOfParametersPerShape ) ;
85  DimVec dims ;
86  dims.reserve( nPerShape ) ;
87 
88  const unsigned int indx ( ivec.size()==1 ? 0 : i ) ;
89 
90  DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
91 
92  for( unsigned int j ( 0 ) ; j != nPerShape ; ++j )
93  {
94  dims.push_back( *dsrc ) ;
95  ++dsrc ;
96  }
97 
98  const CCGFloat* myParm ( CaloCellGeometry::getParmPtr( dims,
99  ptr->parMgr(),
100  ptr->parVecVec() ) ) ;
101 
102 
103  const DetId id ( hcalTopology->denseId2detId(dins[i]) ) ;
104 
105  const unsigned int iGlob ( 0 == globalPtr ? 0 :
107 
108  assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
109 
110  const AlignTransform* gt ( 0 == globalPtr ? 0 : &globalPtr->m_align[ iGlob ] ) ;
111 
112  assert( 0 == gt || iGlob == HcalGeometry::alignmentTransformIndexGlobal( DetId( gt->rawId() ) ) ) ;
113 
114  const unsigned int iLoc ( 0 == alignPtr ? 0 :
116 
117  assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
118 
119  const AlignTransform* at ( 0 == alignPtr ? 0 :
120  &alignPtr->m_align[ iLoc ] ) ;
121 
122  assert( 0 == at || ( HcalGeometry::alignmentTransformIndexLocal( DetId( at->rawId() ) ) == iLoc ) ) ;
123 
124  Pt3D lRef ;
125  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
126  hcg->localCorners( lc, &dims.front(), dins[i], lRef ) ;
127 
128  const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ; // ctr rear face in local
129  const Pt3D lCor ( lc[0] ) ;
130 
131  //----------------------------------- create transform from 6 numbers ---
132  const unsigned int jj ( dins[i]*nTrParm ) ;
133 
134  Tr3D tr ;
135  const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
136  const ROOT::Math::EulerAngles ea (
137  6==nTrParm ?
138  ROOT::Math::EulerAngles( tvec[jj+3], tvec[jj+4], tvec[jj+5] ) :
140  const ROOT::Math::Transform3D rt ( ea, tl ) ;
141  double xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz;
142  rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
143  tr = Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
144  yx, yy, yz,
145  zx, zy, zz ),
146  CLHEP::Hep3Vector(dx,dy,dz) );
147 
148  // now prepend alignment(s) for final transform
149  const Tr3D atr ( 0 == at ? tr :
150  ( 0 == gt ? at->transform()*tr :
151  at->transform()*gt->transform()*tr ) ) ;
152  //--------------------------------- done making transform ---------------
153 
154  const Pt3D gRef ( atr*lRef ) ;
155  const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
156  const Pt3D gBck ( atr*lBck ) ;
157  const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
158  const Pt3D gCor ( atr*lCor ) ;
159  const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
160 
161  assert( hcalTopology->detId2denseId(id) == dins[i] );
162  ptr->newCell( fCtr, fBck, fCor, myParm, id ) ;
163  }
164 
165  ptr->initializeParms() ; // initializations; must happen after cells filled
166 
167  return ptr ;
168 }
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
assert(m_qm.get())
static std::string producerTag()
Definition: HcalGeometry.h:54
boost::shared_ptr< CaloSubdetectorGeometry > PtrType
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
CaloSubdetectorGeometry::IVec IVec
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
int j
Definition: DBlmapReader.cc:9
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::TrVec TrVec
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
static std::string dbString()
Definition: HcalGeometry.h:35
T const * product() const
Definition: ESHandle.h:86
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
CaloSubdetectorGeometry::DimVec DimVec
bool isValid() const
Definition: ESHandle.h:47
static void writeIndexed(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const IVec &dins, std::string tag)
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:66
template<class T, class U>
PtrType CaloGeometryDBEP< T, U >::produceAligned ( const typename T::AlignedRecord &  iRecord)
inline

Definition at line 63 of file CaloGeometryDBEP.h.

References assert(), CaloCellGeometry::getParmPtr(), CaloSubdetectorGeometry::getSummary(), relval_steps::gt, i, edm::ESHandleBase::isValid(), j, findQualityFiles::jj, Alignments::m_align, CaloGeometryDBEP< T, U >::m_applyAlignment, edm::ESHandle< class >::product(), AlCaHLTBitMon_QueryRunRegistry::string, TablePrint::write, and create_public_lumi_plots::xy.

64  {
65  const Alignments* alignPtr ( 0 ) ;
66  const Alignments* globalPtr ( 0 ) ;
67  if( m_applyAlignment ) // get ptr if necessary
68  {
69  edm::ESHandle< Alignments > alignments ;
70  iRecord.template getRecord< typename T::AlignmentRecord >().get( alignments ) ;
71 
72  assert( alignments.isValid() && // require valid alignments and expected size
73  ( alignments->m_align.size() == T::numberOfAlignments() ) ) ;
74  alignPtr = alignments.product() ;
75 
77  iRecord.template getRecord<GlobalPositionRcd>().get( globals ) ;
78 
79  assert( globals.isValid() ) ;
80  globalPtr = globals.product() ;
81  }
82 
83  TrVec tvec ;
84  DimVec dvec ;
85  IVec ivec ;
86  std::vector<uint32_t> dins;
87 
88  if( U::writeFlag() )
89  {
91  iRecord.get( T::producerTag() + std::string("_master"), pG ) ;
92 
93  const CaloSubdetectorGeometry* pGptr ( pG.product() ) ;
94 
95  pGptr->getSummary( tvec, ivec, dvec, dins ) ;
96 
97  U::write( tvec, dvec, ivec, T::dbString() ) ;
98  }
99  else
100  {
102  iRecord.template getRecord<typename T::PGeometryRecord >().get( pG ) ;
103 
104  tvec = pG->getTranslation() ;
105  dvec = pG->getDimension() ;
106  ivec = pG->getIndexes() ;
107  }
108 //*********************************************************************************************
109 
110  const unsigned int nTrParm ( tvec.size()/T::k_NumberOfCellsForCorners ) ;
111 
112  assert( dvec.size() == T::k_NumberOfShapes * T::k_NumberOfParametersPerShape ) ;
113 
114  PtrType ptr ( new T ) ;
115 
116  ptr->fillDefaultNamedParameters() ;
117 
118  ptr->allocateCorners( T::k_NumberOfCellsForCorners ) ;
119 
120  ptr->allocatePar( dvec.size() ,
121  T::k_NumberOfParametersPerShape ) ;
122 
123  for( unsigned int i ( 0 ) ; i != T::k_NumberOfCellsForCorners ; ++i )
124  {
125  const unsigned int nPerShape ( T::k_NumberOfParametersPerShape ) ;
126  DimVec dims ;
127  dims.reserve( nPerShape ) ;
128 
129  const unsigned int indx ( ivec.size()==1 ? 0 : i ) ;
130 
131  DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
132 
133  for( unsigned int j ( 0 ) ; j != nPerShape ; ++j )
134  {
135  dims.push_back( *dsrc ) ;
136  ++dsrc ;
137  }
138 
139  const CCGFloat* myParm ( CaloCellGeometry::getParmPtr( dims,
140  ptr->parMgr(),
141  ptr->parVecVec() ) ) ;
142 
143 
144  const DetId id ( T::DetIdType::detIdFromDenseIndex( i ) ) ;
145 
146  const unsigned int iGlob ( 0 == globalPtr ? 0 :
147  T::alignmentTransformIndexGlobal( id ) ) ;
148 
149  assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
150 
151  const AlignTransform* gt ( 0 == globalPtr ? 0 : &globalPtr->m_align[ iGlob ] ) ;
152 
153  assert( 0 == gt || iGlob == T::alignmentTransformIndexGlobal( DetId( gt->rawId() ) ) ) ;
154 
155  const unsigned int iLoc ( 0 == alignPtr ? 0 :
156  T::alignmentTransformIndexLocal( id ) ) ;
157 
158  assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
159 
160  const AlignTransform* at ( 0 == alignPtr ? 0 :
161  &alignPtr->m_align[ iLoc ] ) ;
162 
163  assert( 0 == at || ( T::alignmentTransformIndexLocal( DetId( at->rawId() ) ) == iLoc ) ) ;
164 
165  const CaloGenericDetId gId ( id ) ;
166 
167  Pt3D lRef ;
168  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
169  T::localCorners( lc, &dims.front(), i, lRef ) ;
170 
171  const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ; // ctr rear face in local
172  const Pt3D lCor ( lc[0] ) ;
173 
174  //----------------------------------- create transform from 6 numbers ---
175  const unsigned int jj ( i*nTrParm ) ;
176  Tr3D tr ;
177  const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
178  const ROOT::Math::EulerAngles ea (
179  6==nTrParm ?
180  ROOT::Math::EulerAngles( tvec[jj+3], tvec[jj+4], tvec[jj+5] ) :
182  const ROOT::Math::Transform3D rt ( ea, tl ) ;
183  double xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz;
184  rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
185  tr = Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
186  yx, yy, yz,
187  zx, zy, zz ),
188  CLHEP::Hep3Vector(dx,dy,dz) );
189 
190  // now prepend alignment(s) for final transform
191  const Tr3D atr ( 0 == at ? tr :
192  ( 0 == gt ? at->transform()*tr :
193  at->transform()*gt->transform()*tr ) ) ;
194  //--------------------------------- done making transform ---------------
195 
196  const Pt3D gRef ( atr*lRef ) ;
197  const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
198  const Pt3D gBck ( atr*lBck ) ;
199  const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
200  const Pt3D gCor ( atr*lCor ) ;
201  const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
202 
203  ptr->newCell( fCtr, fBck, fCor, myParm, id ) ;
204  }
205 
206  ptr->initializeParms() ; // initializations; must happen after cells filled
207 
208  return ptr ;
209  }
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::Pt3D Pt3D
assert(m_qm.get())
boost::shared_ptr< CaloSubdetectorGeometry > PtrType
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
CaloSubdetectorGeometry::IVec IVec
int j
Definition: DBlmapReader.cc:9
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::TrVec TrVec
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
T const * product() const
Definition: ESHandle.h:86
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
CaloSubdetectorGeometry::DimVec DimVec
bool isValid() const
Definition: ESHandle.h:47
long double T

Definition at line 164 of file moduleDB.cc.

References CaloTowerGeometry::alignmentTransformIndexGlobal(), CaloTowerGeometry::alignmentTransformIndexLocal(), assert(), CaloTowerGeometry::dbString(), edm::eventsetup::EventSetupRecord::get(), CaloCellGeometry::getParmPtr(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), CaloSubdetectorGeometry::getSummary(), relval_steps::gt, i, edm::ESHandleBase::isValid(), j, findQualityFiles::jj, CaloTowerGeometry::k_NumberOfParametersPerShape, CaloTowerGeometry::localCorners(), Alignments::m_align, CaloTowerGeometry::numberOfAlignments(), CaloTowerGeometry::numberOfCellsForCorners(), CaloTowerGeometry::numberOfParametersPerShape(), CaloTowerGeometry::numberOfShapes(), CaloTowerGeometry::producerTag(), edm::ESHandle< class >::product(), AlCaHLTBitMon_QueryRunRegistry::string, CaloGeometryDBReader::writeFlag(), CaloGeometryDBReader::writeIndexed(), and create_public_lumi_plots::xy.

164  {
165 
166  const Alignments* alignPtr ( 0 ) ;
167  const Alignments* globalPtr ( 0 ) ;
168  if( m_applyAlignment ) { // get ptr if necessary
169  edm::ESHandle< Alignments > alignments ;
170  iRecord.getRecord< typename CaloTowerGeometry::AlignmentRecord >().get( alignments ) ;
171 
172  assert( alignments.isValid() && // require valid alignments and expected sizet
173  ( alignments->m_align.size() == CaloTowerGeometry::numberOfAlignments() ) ) ;
174  alignPtr = alignments.product() ;
175 
177  iRecord.getRecord<GlobalPositionRcd>().get( globals ) ;
178 
179  assert( globals.isValid() ) ;
180  globalPtr = globals.product() ;
181  }
182 
183  TrVec tvec ;
184  DimVec dvec ;
185  IVec ivec ;
186  IVec dins ;
187 
190  iRecord.get( CaloTowerGeometry::producerTag() + std::string("_master"), pG ) ;
191 
192  const CaloSubdetectorGeometry* pGptr ( pG.product() ) ;
193 
194  pGptr->getSummary( tvec, ivec, dvec, dins ) ;
195 
197  } else {
199  iRecord.getRecord<typename CaloTowerGeometry::PGeometryRecord >().get( pG ) ;
200 
201  tvec = pG->getTranslation() ;
202  dvec = pG->getDimension() ;
203  ivec = pG->getIndexes() ;
204  dins = pG->getDenseIndices();
205  }
206 //*********************************************************************************************
207 
209  iRecord.getRecord<HcalRecNumberingRecord>().get( caloTopology );
210 
211 
212  CaloTowerGeometry* ctg=new CaloTowerGeometry( &*caloTopology );
213 
214  const unsigned int nTrParm ( tvec.size()/ctg->numberOfCellsForCorners() ) ;
215 
217 
218 
219  PtrType ptr ( ctg ) ;
220 
221  ptr->fillDefaultNamedParameters() ;
222 
223  ptr->allocateCorners( ctg->numberOfCellsForCorners() ) ;
224 
225  ptr->allocatePar( dvec.size() ,
227 
228  for( unsigned int i ( 0 ) ; i < dins.size() ; ++i ) {
229  const unsigned int nPerShape ( ctg->numberOfParametersPerShape() ) ;
230  DimVec dims ;
231  dims.reserve( nPerShape ) ;
232 
233  const unsigned int indx ( ivec.size()==1 ? 0 : i ) ;
234 
235  DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
236 
237  for( unsigned int j ( 0 ) ; j != nPerShape ; ++j ) {
238  dims.push_back( *dsrc ) ;
239  ++dsrc ;
240  }
241 
242  const CCGFloat* myParm ( CaloCellGeometry::getParmPtr( dims,
243  ptr->parMgr(),
244  ptr->parVecVec() ));
245 
246 
247  const DetId id ( caloTopology->detIdFromDenseIndex(dins[i]) ) ;
248 
249  const unsigned int iGlob ( 0 == globalPtr ? 0 :
250  ctg->alignmentTransformIndexGlobal( id ) ) ;
251 
252  assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
253 
254  const AlignTransform* gt ( 0 == globalPtr ? 0 : &globalPtr->m_align[ iGlob ] ) ;
255 
256  assert( 0 == gt || iGlob == ctg->alignmentTransformIndexGlobal( DetId( gt->rawId() ) ) ) ;
257 
258  const unsigned int iLoc ( 0 == alignPtr ? 0 :
259  ctg->alignmentTransformIndexLocal( id ) ) ;
260 
261  assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
262 
263  const AlignTransform* at ( 0 == alignPtr ? 0 :
264  &alignPtr->m_align[ iLoc ] ) ;
265 
266  assert( 0 == at || ( ctg->alignmentTransformIndexLocal( DetId( at->rawId() ) ) == iLoc ) ) ;
267 
268  const CaloGenericDetId gId ( id ) ;
269 
270  Pt3D lRef ;
271  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
272  ctg->localCorners( lc, &dims.front(), dins[i], lRef ) ;
273 
274  const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ; // ctr rear face in local
275  const Pt3D lCor ( lc[0] ) ;
276 
277  //----------------------------------- create transform from 6 numbers ---
278  const unsigned int jj ( i*nTrParm ) ;
279  Tr3D tr ;
280  const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
281  const ROOT::Math::EulerAngles ea (
282  6==nTrParm ?
283  ROOT::Math::EulerAngles( tvec[jj+3], tvec[jj+4], tvec[jj+5] ) :
285  const ROOT::Math::Transform3D rt ( ea, tl ) ;
286  double xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz;
287  rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
288  tr = Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
289  yx, yy, yz,
290  zx, zy, zz ),
291  CLHEP::Hep3Vector(dx,dy,dz) );
292 
293  // now prepend alignment(s) for final transform
294  const Tr3D atr ( 0 == at ? tr :
295  ( 0 == gt ? at->transform()*tr :
296  at->transform()*gt->transform()*tr ) ) ;
297  //--------------------------------- done making transform ---------------
298 
299  const Pt3D gRef ( atr*lRef ) ;
300  const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
301  const Pt3D gBck ( atr*lBck ) ;
302  const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
303  const Pt3D gCor ( atr*lCor ) ;
304  const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
305 
306  assert( caloTopology->denseIndex(id) == dins[i] );
307 
308  ptr->newCell( fCtr, fBck, fCor, myParm, id ) ;
309  }
310 
311  ptr->initializeParms() ; // initializations; must happen after cells filled
312 
313  return ptr ;
314 }
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::Pt3D Pt3D
virtual unsigned int numberOfCellsForCorners() const
assert(m_qm.get())
unsigned int alignmentTransformIndexLocal(const DetId &id)
boost::shared_ptr< CaloSubdetectorGeometry > PtrType
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
static std::string producerTag()
CaloSubdetectorGeometry::IVec IVec
static void writeIndexed(const TrVec &, const DimVec &, const IVec &, const std::vector< uint32_t > &, std::string)
virtual unsigned int numberOfParametersPerShape() const
static std::string dbString()
int j
Definition: DBlmapReader.cc:9
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::TrVec TrVec
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
unsigned int alignmentTransformIndexGlobal(const DetId &id)
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
T const * product() const
Definition: ESHandle.h:86
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
virtual unsigned int numberOfShapes() const
CaloSubdetectorGeometry::DimVec DimVec
bool isValid() const
Definition: ESHandle.h:47
static unsigned int numberOfAlignments()

Definition at line 172 of file calowriters.cc.

References CaloTowerGeometry::alignmentTransformIndexGlobal(), CaloTowerGeometry::alignmentTransformIndexLocal(), assert(), CaloTowerGeometry::dbString(), edm::eventsetup::EventSetupRecord::get(), CaloCellGeometry::getParmPtr(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), CaloSubdetectorGeometry::getSummary(), relval_steps::gt, i, edm::ESHandleBase::isValid(), j, findQualityFiles::jj, CaloTowerGeometry::k_NumberOfParametersPerShape, CaloTowerGeometry::localCorners(), Alignments::m_align, CaloTowerGeometry::numberOfAlignments(), CaloTowerGeometry::numberOfCellsForCorners(), CaloTowerGeometry::numberOfParametersPerShape(), CaloTowerGeometry::numberOfShapes(), CaloTowerGeometry::producerTag(), edm::ESHandle< class >::product(), AlCaHLTBitMon_QueryRunRegistry::string, CaloGeometryDBWriter::writeFlag(), CaloGeometryDBWriter::writeIndexed(), and create_public_lumi_plots::xy.

172  {
173 
174  const Alignments* alignPtr ( 0 ) ;
175  const Alignments* globalPtr ( 0 ) ;
176  if( m_applyAlignment ) { // get ptr if necessary
177  edm::ESHandle< Alignments > alignments ;
178  iRecord.getRecord< typename CaloTowerGeometry::AlignmentRecord >().get( alignments ) ;
179 
180  assert( alignments.isValid() && // require valid alignments and expected sizet
181  ( alignments->m_align.size() == CaloTowerGeometry::numberOfAlignments() ) ) ;
182  alignPtr = alignments.product() ;
183 
185  iRecord.getRecord<GlobalPositionRcd>().get( globals ) ;
186 
187  assert( globals.isValid() ) ;
188  globalPtr = globals.product() ;
189  }
190 
191  TrVec tvec ;
192  DimVec dvec ;
193  IVec ivec ;
194  IVec dins ;
195 
198  iRecord.get( CaloTowerGeometry::producerTag() + std::string("_master"), pG ) ;
199 
200  const CaloSubdetectorGeometry* pGptr ( pG.product() ) ;
201 
202  pGptr->getSummary( tvec, ivec, dvec, dins ) ;
203 
205  } else {
207  iRecord.getRecord<typename CaloTowerGeometry::PGeometryRecord >().get( pG ) ;
208 
209  tvec = pG->getTranslation() ;
210  dvec = pG->getDimension() ;
211  ivec = pG->getIndexes() ;
212  dins = pG->getDenseIndices();
213  }
214 //*********************************************************************************************
215 
217  iRecord.getRecord<HcalRecNumberingRecord>().get( caloTopology );
218 
219 
220  CaloTowerGeometry* ctg=new CaloTowerGeometry( &*caloTopology );
221 
222  const unsigned int nTrParm ( tvec.size()/ctg->numberOfCellsForCorners() ) ;
223 
225 
226 
227  PtrType ptr ( ctg ) ;
228 
229  ptr->fillDefaultNamedParameters() ;
230 
231  ptr->allocateCorners( ctg->numberOfCellsForCorners() ) ;
232 
233  ptr->allocatePar( dvec.size() ,
235 
236  for( unsigned int i ( 0 ) ; i < dins.size() ; ++i ) {
237  const unsigned int nPerShape ( ctg->numberOfParametersPerShape() ) ;
238  DimVec dims ;
239  dims.reserve( nPerShape ) ;
240 
241  const unsigned int indx ( ivec.size()==1 ? 0 : i ) ;
242 
243  DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
244 
245  for( unsigned int j ( 0 ) ; j != nPerShape ; ++j ) {
246  dims.push_back( *dsrc ) ;
247  ++dsrc ;
248  }
249 
250  const CCGFloat* myParm ( CaloCellGeometry::getParmPtr( dims,
251  ptr->parMgr(),
252  ptr->parVecVec() ));
253 
254 
255  const DetId id ( caloTopology->detIdFromDenseIndex(dins[i]) ) ;
256 
257  const unsigned int iGlob ( 0 == globalPtr ? 0 :
258  ctg->alignmentTransformIndexGlobal( id ) ) ;
259 
260  assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
261 
262  const AlignTransform* gt ( 0 == globalPtr ? 0 : &globalPtr->m_align[ iGlob ] ) ;
263 
264  assert( 0 == gt || iGlob == ctg->alignmentTransformIndexGlobal( DetId( gt->rawId() ) ) ) ;
265 
266  const unsigned int iLoc ( 0 == alignPtr ? 0 :
267  ctg->alignmentTransformIndexLocal( id ) ) ;
268 
269  assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
270 
271  const AlignTransform* at ( 0 == alignPtr ? 0 :
272  &alignPtr->m_align[ iLoc ] ) ;
273 
274  assert( 0 == at || ( ctg->alignmentTransformIndexLocal( DetId( at->rawId() ) ) == iLoc ) ) ;
275 
276  const CaloGenericDetId gId ( id ) ;
277 
278  Pt3D lRef ;
279  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
280  ctg->localCorners( lc, &dims.front(), dins[i], lRef ) ;
281 
282  const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ; // ctr rear face in local
283  const Pt3D lCor ( lc[0] ) ;
284 
285  //----------------------------------- create transform from 6 numbers ---
286  const unsigned int jj ( i*nTrParm ) ;
287  Tr3D tr ;
288  const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
289  const ROOT::Math::EulerAngles ea (
290  6==nTrParm ?
291  ROOT::Math::EulerAngles( tvec[jj+3], tvec[jj+4], tvec[jj+5] ) :
293  const ROOT::Math::Transform3D rt ( ea, tl ) ;
294  double xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz;
295  rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
296  tr = Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
297  yx, yy, yz,
298  zx, zy, zz ),
299  CLHEP::Hep3Vector(dx,dy,dz) );
300 
301  // now prepend alignment(s) for final transform
302  const Tr3D atr ( 0 == at ? tr :
303  ( 0 == gt ? at->transform()*tr :
304  at->transform()*gt->transform()*tr ) ) ;
305  //--------------------------------- done making transform ---------------
306 
307  const Pt3D gRef ( atr*lRef ) ;
308  const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
309  const Pt3D gBck ( atr*lBck ) ;
310  const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
311  const Pt3D gCor ( atr*lCor ) ;
312  const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
313 
314  assert( caloTopology->denseIndex(id) == dins[i] );
315 
316  ptr->newCell( fCtr, fBck, fCor, myParm, id ) ;
317  }
318 
319  ptr->initializeParms() ; // initializations; must happen after cells filled
320 
321  return ptr ;
322 }
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::Pt3D Pt3D
virtual unsigned int numberOfCellsForCorners() const
assert(m_qm.get())
unsigned int alignmentTransformIndexLocal(const DetId &id)
boost::shared_ptr< CaloSubdetectorGeometry > PtrType
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
static std::string producerTag()
CaloSubdetectorGeometry::IVec IVec
virtual unsigned int numberOfParametersPerShape() const
static std::string dbString()
int j
Definition: DBlmapReader.cc:9
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::TrVec TrVec
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
unsigned int alignmentTransformIndexGlobal(const DetId &id)
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
T const * product() const
Definition: ESHandle.h:86
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
virtual unsigned int numberOfShapes() const
CaloSubdetectorGeometry::DimVec DimVec
bool isValid() const
Definition: ESHandle.h:47
static void writeIndexed(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const IVec &dins, std::string tag)
static unsigned int numberOfAlignments()

Member Data Documentation

template<class T, class U>
bool CaloGeometryDBEP< T, U >::m_applyAlignment
private

Definition at line 213 of file CaloGeometryDBEP.h.

Referenced by CaloGeometryDBEP< T, U >::produceAligned().

template<class T, class U>
const edm::ParameterSet CaloGeometryDBEP< T, U >::m_pSet
private

Definition at line 214 of file CaloGeometryDBEP.h.