19 if( m_applyAlignment )
26 alignPtr = alignments.
product() ;
56 tvec = pG->getTranslation() ;
57 dvec = pG->getDimension() ;
58 ivec = pG->getIndexes() ;
59 dins = pG->getDenseIndices();
74 const unsigned int nTrParm ( tvec.size()/hcalTopology->ncells() ) ;
76 ptr->fillDefaultNamedParameters() ;
78 ptr->allocateCorners( hcalTopology->ncells() ) ;
80 ptr->allocatePar( dvec.size() ,
83 for(
unsigned int i ( 0 ) ;
i < dins.size(); ++
i )
87 dims.reserve( nPerShape ) ;
89 const unsigned int indx ( ivec.size()==1 ? 0 :
i ) ;
91 DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
93 for(
unsigned int j ( 0 ) ;
j != nPerShape ; ++
j )
95 dims.push_back( *dsrc ) ;
101 ptr->parVecVec() ) ) ;
104 const DetId id ( hcalTopology->denseId2detId(dins[
i]) ) ;
106 const unsigned int iGlob ( 0 == globalPtr ? 0 :
109 assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
115 const unsigned int iLoc ( 0 == alignPtr ? 0 :
118 assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
127 hcg->localCorners( lc, &dims.front(), dins[
i], lRef ) ;
129 const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ;
130 const Pt3D lCor ( lc[0] ) ;
133 const unsigned int jj ( dins[i]*nTrParm ) ;
136 const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
141 const ROOT::Math::Transform3D rt ( ea, tl ) ;
142 double xx,
xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz;
143 rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
144 tr =
Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
147 CLHEP::Hep3Vector(dx,dy,dz) );
150 const Tr3D atr ( 0 == at ? tr :
151 ( 0 == gt ? at->transform()*tr :
152 at->transform()*gt->transform()*tr ) ) ;
155 const Pt3D gRef ( atr*lRef ) ;
156 const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
157 const Pt3D gBck ( atr*lBck ) ;
158 const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
159 const Pt3D gCor ( atr*lCor ) ;
160 const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
162 assert( hcalTopology->detId2denseId(
id) == dins[
i] );
163 ptr->newCell( fCtr, fBck, fCor, myParm,
id ) ;
166 ptr->initializeParms() ;
177 if( m_applyAlignment ) {
183 alignPtr = alignments.
product() ;
189 globalPtr = globals.
product() ;
210 tvec = pG->getTranslation() ;
211 dvec = pG->getDimension() ;
212 ivec = pG->getIndexes() ;
213 dins = pG->getDenseIndices();
230 ptr->fillDefaultNamedParameters() ;
234 ptr->allocatePar( dvec.size() ,
237 for(
unsigned int i ( 0 ) ;
i < dins.size() ; ++
i ) {
240 dims.reserve( nPerShape ) ;
242 const unsigned int indx ( ivec.size()==1 ? 0 :
i ) ;
244 DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
246 for(
unsigned int j ( 0 ) ;
j != nPerShape ; ++
j ) {
247 dims.push_back( *dsrc ) ;
256 const DetId id ( caloTopology->detIdFromDenseIndex(dins[
i]) ) ;
258 const unsigned int iGlob ( 0 == globalPtr ? 0 :
261 assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
267 const unsigned int iLoc ( 0 == alignPtr ? 0 :
270 assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
283 const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ;
284 const Pt3D lCor ( lc[0] ) ;
287 const unsigned int jj ( i*nTrParm ) ;
289 const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
294 const ROOT::Math::Transform3D rt ( ea, tl ) ;
295 double xx,
xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz;
296 rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
297 tr =
Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
300 CLHEP::Hep3Vector(dx,dy,dz) );
303 const Tr3D atr ( 0 == at ? tr :
304 ( 0 == gt ? at->transform()*tr :
305 at->transform()*gt->transform()*tr ) ) ;
308 const Pt3D gRef ( atr*lRef ) ;
309 const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
310 const Pt3D gBck ( atr*lBck ) ;
311 const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
312 const Pt3D gCor ( atr*lCor ) ;
313 const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
315 assert( caloTopology->denseIndex(
id) == dins[
i] );
317 ptr->newCell( fCtr, fBck, fCor, myParm,
id ) ;
320 ptr->initializeParms() ;
336 name =
"HGCalEESensitive";
343 geom->getSummary( tvec, ivec, dvec, dins ) ;
352 tvec = pG->getTranslation() ;
353 dvec = pG->getDimension() ;
354 ivec = pG->getIndexes() ;
355 dins = pG->getDenseIndices();
366 ptr->allocateCorners( topology->ncells());
370 const unsigned int nTrParm( ptr->numberOfTransformParms());
373 for(
auto it : dins )
375 DetId id = topology->encode( topology->geomDenseId2decId( it ));
377 int layer = ivec[ it ];
380 const unsigned int jj ( it * nTrParm );
382 const ROOT::Math::Translation3D tl( tvec[jj], tvec[jj+1], tvec[jj+2]);
386 const ROOT::Math::Transform3D rt( ea, tl );
387 double xx,
xy, xz, dx, yx, yy, yz, dy, zx, zy, zz, dz;
388 rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
389 tr =
Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
392 CLHEP::Hep3Vector( dx, dy, dz));
396 dims.reserve( nPerShape );
398 DimVec::const_iterator dsrc( dvec.begin() + layer * nPerShape );
399 for(
unsigned int j ( 0 ) ;
j != nPerShape ; ++
j )
401 dims.push_back( *dsrc ) ;
405 std::vector<GlobalPoint> corners( 8 );
416 0.25*( corners[0].
y() +
420 0.25*( corners[0].
z() +
429 0.25*( corners[4].
y() +
433 0.25*( corners[4].
z() +
440 std::swap_ranges (corners.begin(), corners.begin()+4, corners.begin()+4);
443 ptr->newCell( front, back, corners[0], myParm,
id );
446 ptr->initializeParms();
CaloGeometryDBEP< EcalBarrelGeometry, CaloGeometryDBWriter > EcalBarrelGeometryToDBEP
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
CaloGeometryDBEP< CastorGeometry, CaloGeometryDBWriter > CastorGeometryToDBEP
CaloTopology const * topology(0)
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
T x() const
Cartesian x coordinate.
CaloGeometryDBEP< HGCalGeometry, CaloGeometryDBWriter > HGCalGeometryToDBEP
CaloGeometryDBEP< HcalGeometry, CaloGeometryDBWriter > HcalGeometryToDBEP
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
virtual unsigned int numberOfParametersPerShape() const
static std::string dbString()
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
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
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()