13 if( m_applyAlignment ) {
19 alignPtr = alignments.
product() ;
46 tvec = pG->getTranslation() ;
47 dvec = pG->getDimension() ;
48 ivec = pG->getIndexes() ;
49 dins = pG->getDenseIndices();
67 const unsigned int nTrParm ( tvec.size()/hcalTopology->ncells() ) ;
69 ptr->fillDefaultNamedParameters() ;
71 ptr->allocateCorners( hcalTopology->ncells() );
73 ptr->allocatePar( dvec.size() ,
76 for(
unsigned int i ( 0 ) ;
i < dins.size() ; ++
i ) {
79 dims.reserve( nPerShape ) ;
81 const unsigned int indx ( ivec.size()==1 ? 0 :
i ) ;
83 DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
85 for(
unsigned int j ( 0 ) ;
j != nPerShape ; ++
j ) {
86 dims.push_back( *dsrc ) ;
95 const DetId id ( hcalTopology->denseId2detId(dins[
i]) );
97 const unsigned int iGlob ( 0 == globalPtr ? 0 :
100 assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
106 const unsigned int iLoc ( 0 == alignPtr ? 0 :
109 assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
118 hcg->localCorners( lc, &dims.front(), dins[
i], lRef ) ;
120 const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ;
121 const Pt3D lCor ( lc[0] ) ;
124 const unsigned int jj ( dins[i]*nTrParm ) ;
126 const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
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,
137 CLHEP::Hep3Vector(dx,dy,dz) );
140 const Tr3D atr ( 0 == at ? tr :
141 ( 0 == gt ? at->transform()*tr :
142 at->transform()*gt->transform()*tr ) ) ;
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() ) ;
152 assert( hcalTopology->detId2denseId(
id) == dins[
i] );
154 ptr->newCell( fCtr, fBck, fCor, myParm,
id ) ;
157 ptr->initializeParms() ;
168 if( m_applyAlignment ) {
174 alignPtr = alignments.
product() ;
180 globalPtr = globals.
product() ;
201 tvec = pG->getTranslation() ;
202 dvec = pG->getDimension() ;
203 ivec = pG->getIndexes() ;
204 dins = pG->getDenseIndices();
221 ptr->fillDefaultNamedParameters() ;
225 ptr->allocatePar( dvec.size() ,
228 for(
unsigned int i ( 0 ) ;
i < dins.size() ; ++
i ) {
231 dims.reserve( nPerShape ) ;
233 const unsigned int indx ( ivec.size()==1 ? 0 :
i ) ;
235 DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
237 for(
unsigned int j ( 0 ) ;
j != nPerShape ; ++
j ) {
238 dims.push_back( *dsrc ) ;
247 const DetId id ( caloTopology->detIdFromDenseIndex(dins[
i]) ) ;
249 const unsigned int iGlob ( 0 == globalPtr ? 0 :
252 assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
258 const unsigned int iLoc ( 0 == alignPtr ? 0 :
261 assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
274 const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ;
275 const Pt3D lCor ( lc[0] ) ;
278 const unsigned int jj ( i*nTrParm ) ;
280 const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
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,
291 CLHEP::Hep3Vector(dx,dy,dz) );
294 const Tr3D atr ( 0 == at ? tr :
295 ( 0 == gt ? at->transform()*tr :
296 at->transform()*gt->transform()*tr ) ) ;
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() ) ;
306 assert( caloTopology->denseIndex(
id) == dins[
i] );
308 ptr->newCell( fCtr, fBck, fCor, myParm,
id ) ;
311 ptr->initializeParms() ;
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
virtual unsigned int numberOfCellsForCorners() const
static std::string producerTag()
CaloCellGeometry::Pt3DVec Pt3DVec
unsigned int alignmentTransformIndexLocal(const DetId &id)
std::vector< AlignTransform > m_align
boost::shared_ptr< CaloSubdetectorGeometry > PtrType
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
static std::string producerTag()
const DepRecordT & getRecord() const
CaloSubdetectorGeometry::IVec IVec
static void writeIndexed(const TrVec &, const DimVec &, const IVec &, const std::vector< uint32_t > &, std::string)
CaloGeometryDBEP< CaloTowerGeometry, CaloGeometryDBReader > CaloTowerGeometryFromDBEP
virtual unsigned int numberOfParametersPerShape() const
void get(HolderT &iHolder) const
static std::string dbString()
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
PtrType produceAligned(const typename T::AlignedRecord &iRecord)
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)
AlgebraicVector EulerAngles
static std::string dbString()
T const * product() const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
virtual unsigned int numberOfShapes() const
CaloSubdetectorGeometry::DimVec DimVec
CaloGeometryDBEP< HcalGeometry, CaloGeometryDBReader > HcalGeometryFromDBEP
CaloCellGeometry::CCGFloat CCGFloat
static unsigned int numberOfAlignments()
static unsigned int numberOfAlignments()