13 if( m_applyAlignment ) {
19 alignPtr = alignments.
product() ;
66 const unsigned int nTrParm( hcg->numberOfTransformParms());
68 ptr->fillDefaultNamedParameters();
69 ptr->allocateCorners( hcalTopology->
ncells()+hcalTopology->
getHFSize());
70 ptr->allocatePar( dvec.size() ,
73 for(
unsigned int i ( 0 ) ;
i < dins.size() ; ++
i ) {
76 dims.reserve( nPerShape );
78 const unsigned int indx( ivec.size() == 1 ? 0 :
i );
80 DimVec::const_iterator dsrc( dvec.begin() + ivec[indx]*nPerShape );
82 for(
unsigned int j ( 0 ) ; j != nPerShape ; ++j ) {
83 dims.emplace_back( *dsrc ) ;
93 const unsigned int iGlob(
nullptr == globalPtr ? 0 :
96 assert(
nullptr == globalPtr || iGlob < globalPtr->m_align.size());
102 const unsigned int iLoc(
nullptr == alignPtr ? 0 :
105 assert(
nullptr == alignPtr || iLoc < alignPtr->m_align.size());
114 hcg->localCorners( lc, &dims.front(), dins[
i], lRef );
116 const Pt3D lBck( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ));
117 const Pt3D lCor( lc[0] );
120 const unsigned int jj( i * nTrParm );
123 const ROOT::Math::Translation3D tl( tvec[jj], tvec[jj+1], tvec[jj+2] );
127 const ROOT::Math::Transform3D rt( ea, tl );
130 double zx, zy,
zz,
dz;
131 rt.GetComponents( xx, xy, xz, dx,
134 tr =
Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
137 CLHEP::Hep3Vector( dx, dy, dz));
140 const Tr3D atr(
nullptr == at ? tr :
141 (
nullptr == 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() ) ;
154 ptr->newCell( fCtr, fBck, fCor, myParm,
id ) ;
157 ptr->initializeParms();
168 if( m_applyAlignment ) {
172 assert( alignments.
isValid() &&
174 alignPtr = alignments.
product() ;
180 globalPtr = globals.
product() ;
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.emplace_back( *dsrc ) ;
249 const unsigned int iGlob (
nullptr == globalPtr ? 0 :
252 assert(
nullptr == globalPtr || iGlob < globalPtr->m_align.size() ) ;
258 const unsigned int iLoc (
nullptr == alignPtr ? 0 :
261 assert(
nullptr == 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 (
nullptr == at ? tr :
295 (
nullptr == 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() ) ;
308 ptr->newCell( fCtr, fBck, fCor, myParm,
id ) ;
311 ptr->initializeParms() ;
DetId denseId2detId(unsigned int) const override
return a linear packed id
unsigned int getHFSize() const
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
unsigned int detId2denseId(const DetId &id) const override
return a linear packed id
virtual unsigned int numberOfCellsForCorners() const
static std::string producerTag()
unsigned int numberOfShapes() const override
CaloCellGeometry::Pt3DVec Pt3DVec
unsigned int alignmentTransformIndexLocal(const DetId &id)
std::vector< float > const & getTranslation() const
std::shared_ptr< CaloSubdetectorGeometry > PtrType
std::vector< AlignTransform > m_align
std::vector< float > const & getDimension() const
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
static std::string producerTag()
const DepRecordT & getRecord() const
CaloSubdetectorGeometry::IVec IVec
unsigned int numberOfParametersPerShape() const override
CaloTowerDetId detIdFromDenseIndex(uint32_t din) const
CaloGeometryDBEP< CaloTowerGeometry, CaloGeometryDBReader > CaloTowerGeometryFromDBEP
unsigned int getNumberOfShapes() 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
uint32_t denseIndex(const DetId &id) const
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
AlgebraicVector EulerAngles
static std::string dbString()
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
unsigned int ncells() const override
return a count of valid cells (for dense indexing use)
CaloSubdetectorGeometry::DimVec DimVec
CaloGeometryDBEP< HcalGeometry, CaloGeometryDBReader > HcalGeometryFromDBEP
T const * product() const
CaloCellGeometry::CCGFloat CCGFloat
std::vector< uint32_t > const & getIndexes() const
static unsigned int numberOfAlignments()
std::vector< uint32_t > const & getDenseIndices() const
static unsigned int numberOfAlignments()
static void writeIndexed(const TrVec &, const DimVec &, const IVec &, const std::vector< uint32_t > &, const std::string &)