18 if( m_applyAlignment )
25 alignPtr = alignments.
product() ;
55 tvec = pG->getTranslation() ;
56 dvec = pG->getDimension() ;
57 ivec = pG->getIndexes() ;
58 dins = pG->getDenseIndices();
73 const unsigned int nTrParm ( tvec.size()/hcalTopology->ncells() ) ;
75 ptr->fillDefaultNamedParameters() ;
77 ptr->allocateCorners( hcalTopology->ncells() ) ;
79 ptr->allocatePar( dvec.size() ,
82 for(
unsigned int i ( 0 ) ;
i < dins.size(); ++
i )
86 dims.reserve( nPerShape ) ;
88 const unsigned int indx ( ivec.size()==1 ? 0 :
i ) ;
90 DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
92 for(
unsigned int j ( 0 ) ;
j != nPerShape ; ++
j )
94 dims.push_back( *dsrc ) ;
100 ptr->parVecVec() ) ) ;
103 const DetId id ( hcalTopology->denseId2detId(dins[
i]) ) ;
105 const unsigned int iGlob ( 0 == globalPtr ? 0 :
108 assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
114 const unsigned int iLoc ( 0 == alignPtr ? 0 :
117 assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
126 hcg->localCorners( lc, &dims.front(), dins[
i], lRef ) ;
128 const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ;
129 const Pt3D lCor ( lc[0] ) ;
132 const unsigned int jj ( dins[i]*nTrParm ) ;
135 const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
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,
146 CLHEP::Hep3Vector(dx,dy,dz) );
149 const Tr3D atr ( 0 == at ? tr :
150 ( 0 == gt ? at->transform()*tr :
151 at->transform()*gt->transform()*tr ) ) ;
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() ) ;
161 assert( hcalTopology->detId2denseId(
id) == dins[
i] );
162 ptr->newCell( fCtr, fBck, fCor, myParm,
id ) ;
165 ptr->initializeParms() ;
176 if( m_applyAlignment ) {
182 alignPtr = alignments.
product() ;
188 globalPtr = globals.
product() ;
209 tvec = pG->getTranslation() ;
210 dvec = pG->getDimension() ;
211 ivec = pG->getIndexes() ;
212 dins = pG->getDenseIndices();
229 ptr->fillDefaultNamedParameters() ;
233 ptr->allocatePar( dvec.size() ,
236 for(
unsigned int i ( 0 ) ;
i < dins.size() ; ++
i ) {
239 dims.reserve( nPerShape ) ;
241 const unsigned int indx ( ivec.size()==1 ? 0 :
i ) ;
243 DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
245 for(
unsigned int j ( 0 ) ;
j != nPerShape ; ++
j ) {
246 dims.push_back( *dsrc ) ;
255 const DetId id ( caloTopology->detIdFromDenseIndex(dins[
i]) ) ;
257 const unsigned int iGlob ( 0 == globalPtr ? 0 :
260 assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
266 const unsigned int iLoc ( 0 == alignPtr ? 0 :
269 assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
282 const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ;
283 const Pt3D lCor ( lc[0] ) ;
286 const unsigned int jj ( i*nTrParm ) ;
288 const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
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,
299 CLHEP::Hep3Vector(dx,dy,dz) );
302 const Tr3D atr ( 0 == at ? tr :
303 ( 0 == gt ? at->transform()*tr :
304 at->transform()*gt->transform()*tr ) ) ;
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() ) ;
314 assert( caloTopology->denseIndex(
id) == dins[
i] );
316 ptr->newCell( fCtr, fBck, fCor, myParm,
id ) ;
319 ptr->initializeParms() ;
CaloGeometryDBEP< EcalBarrelGeometry, CaloGeometryDBWriter > EcalBarrelGeometryToDBEP
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
CaloGeometryDBEP< CastorGeometry, CaloGeometryDBWriter > CastorGeometryToDBEP
virtual unsigned int numberOfCellsForCorners() const
static std::string producerTag()
CaloGeometryDBEP< ZdcGeometry, CaloGeometryDBWriter > ZdcGeometryToDBEP
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
CaloGeometryDBEP< HcalGeometry, CaloGeometryDBWriter > HcalGeometryToDBEP
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
CaloGeometryDBEP< EcalEndcapGeometry, CaloGeometryDBWriter > EcalEndcapGeometryToDBEP
CaloCellGeometry::Tr3D Tr3D
virtual unsigned int numberOfShapes() const
CaloGeometryDBEP< EcalPreshowerGeometry, CaloGeometryDBWriter > EcalPreshowerGeometryToDBEP
CaloSubdetectorGeometry::DimVec DimVec
CaloGeometryDBEP< CaloTowerGeometry, CaloGeometryDBWriter > CaloTowerGeometryToDBEP
CaloCellGeometry::CCGFloat CCGFloat
static void writeIndexed(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const IVec &dins, std::string tag)
static unsigned int numberOfAlignments()
static unsigned int numberOfAlignments()