19 if( m_applyAlignment )
26 alignPtr = alignments.
product();
74 const unsigned int nTrParm( hcalGeometry->numberOfTransformParms());
76 ptr->fillDefaultNamedParameters();
77 ptr->allocateCorners( hcalTopology->
ncells() + hcalTopology->
getHFSize());
78 ptr->allocatePar( hcalGeometry->numberOfShapes(),
81 for(
unsigned int i ( 0 ) ;
i < dins.size(); ++
i )
85 dims.reserve( nPerShape );
87 const unsigned int indx( ivec.size() == 1 ? 0 :
i );
89 DimVec::const_iterator dsrc( dvec.begin() + ivec[indx] * nPerShape );
91 for(
unsigned int j ( 0 ) ; j != nPerShape ; ++j )
93 dims.push_back( *dsrc );
103 const unsigned int iGlob(
nullptr == globalPtr ? 0 :
106 assert(
nullptr == globalPtr || iGlob < globalPtr->m_align.size());
112 const unsigned int iLoc(
nullptr == alignPtr ? 0 :
115 assert(
nullptr == alignPtr || iLoc < alignPtr->m_align.size());
124 hcalGeometry->localCorners( lc, &dims.front(), dins[
i], lRef );
126 const Pt3D lBck( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ));
127 const Pt3D lCor( lc[0] ) ;
130 const unsigned int jj( i * nTrParm );
133 const ROOT::Math::Translation3D tl( tvec[jj], tvec[jj+1], tvec[jj+2] );
137 const ROOT::Math::Transform3D rt( ea, tl );
140 double zx, zy,
zz,
dz;
141 rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
142 tr =
Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
145 CLHEP::Hep3Vector( dx, dy, dz ));
148 const Tr3D atr(
nullptr == at ? tr :
149 (
nullptr == gt ? at->transform() * tr :
150 at->transform() * gt->transform() * tr ));
153 const Pt3D gRef( atr*lRef );
154 const GlobalPoint fCtr( gRef.x(), gRef.y(), gRef.z());
155 const Pt3D gBck( atr*lBck );
156 const GlobalPoint fBck( gBck.x(), gBck.y(), gBck.z());
157 const Pt3D gCor( atr*lCor );
158 const GlobalPoint fCor( gCor.x(), gCor.y(), gCor.z());
161 ptr->newCell( fCtr, fBck, fCor, myParm,
id );
164 ptr->initializeParms();
175 if( m_applyAlignment ) {
179 assert( alignments.
isValid() &&
181 alignPtr = alignments.
product() ;
187 globalPtr = globals.
product() ;
228 ptr->fillDefaultNamedParameters() ;
232 ptr->allocatePar( dvec.size() ,
235 for(
unsigned int i ( 0 ) ;
i < dins.size() ; ++
i ) {
238 dims.reserve( nPerShape ) ;
240 const unsigned int indx ( ivec.size()==1 ? 0 :
i ) ;
242 DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
244 for(
unsigned int j ( 0 ) ; j != nPerShape ; ++j ) {
245 dims.push_back( *dsrc ) ;
256 const unsigned int iGlob (
nullptr == globalPtr ? 0 :
259 assert(
nullptr == globalPtr || iGlob < globalPtr->m_align.size() ) ;
265 const unsigned int iLoc (
nullptr == alignPtr ? 0 :
268 assert(
nullptr == alignPtr || iLoc < alignPtr->m_align.size() ) ;
281 const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ;
282 const Pt3D lCor ( lc[0] ) ;
285 const unsigned int jj ( i*nTrParm ) ;
287 const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
292 const ROOT::Math::Transform3D rt ( ea, tl ) ;
293 double xx,
xy,
xz,
dx,yx,
yy,
yz,
dy,zx,zy,
zz,
dz;
294 rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
295 tr =
Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
298 CLHEP::Hep3Vector(dx,dy,dz) );
301 const Tr3D atr (
nullptr == at ? tr :
302 (
nullptr == gt ? at->transform()*tr :
303 at->transform()*gt->transform()*tr ) ) ;
306 const Pt3D gRef ( atr*lRef ) ;
307 const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
308 const Pt3D gBck ( atr*lBck ) ;
309 const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
310 const Pt3D gCor ( atr*lCor ) ;
311 const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
315 ptr->newCell( fCtr, fBck, fCor, myParm,
id ) ;
318 ptr->initializeParms() ;
334 name =
"HGCalEESensitive";
365 ptr->allocateCorners( topology->
ncells());
369 const unsigned int nTrParm( ptr->numberOfTransformParms());
372 for(
auto it : dins )
376 int layer = ivec[ it ];
379 const unsigned int jj ( it * nTrParm );
381 const ROOT::Math::Translation3D tl( tvec[jj], tvec[jj+1], tvec[jj+2]);
385 const ROOT::Math::Transform3D rt( ea, tl );
386 double xx,
xy,
xz,
dx, yx,
yy,
yz,
dy, zx, zy,
zz,
dz;
387 rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
388 tr =
Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
391 CLHEP::Hep3Vector( dx, dy, dz));
395 dims.reserve( nPerShape );
397 DimVec::const_iterator dsrc( dvec.begin() + layer * nPerShape );
398 for(
unsigned int j ( 0 ) ; j != nPerShape ; ++j )
400 dims.push_back( *dsrc ) ;
451 std::swap_ranges (corners.begin(),
456 ptr->newCell( front, back, corners[0], myParm,
id );
459 ptr->initializeParms();
DetId denseId2detId(unsigned int) const override
return a linear packed id
CaloGeometryDBEP< EcalBarrelGeometry, CaloGeometryDBWriter > EcalBarrelGeometryToDBEP
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
unsigned int getHFSize() const
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
CaloGeometryDBEP< CastorGeometry, CaloGeometryDBWriter > CastorGeometryToDBEP
static void writeIndexed(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const IVec &dins, const std::string &tag)
CaloTopology const * topology(0)
unsigned int detId2denseId(const DetId &id) const override
return a linear packed id
virtual unsigned int numberOfCellsForCorners() const
static std::string producerTag()
CaloGeometryDBEP< ZdcGeometry, CaloGeometryDBWriter > ZdcGeometryToDBEP
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
static constexpr unsigned int ncorner_
std::vector< float > const & getDimension() const
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
static std::string producerTag()
CaloSubdetectorGeometry::IVec IVec
unsigned int numberOfParametersPerShape() const override
CaloGeometryDBEP< HGCalGeometry, CaloGeometryDBWriter > HGCalGeometryToDBEP
unsigned int totalGeomModules() const
CaloTowerDetId detIdFromDenseIndex(uint32_t din) const
CaloGeometryDBEP< HcalGeometry, CaloGeometryDBWriter > HcalGeometryToDBEP
static unsigned int k_NumberOfShapes
unsigned int getNumberOfShapes() const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
DetId encode(const DecodedDetId &id_) const
const DepRecordT getRecord() const
static std::string dbString()
void get(HolderT &iHolder) const
static std::string dbString()
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
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)
DecodedDetId geomDenseId2decId(const uint32_t &hi) const
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)
static constexpr unsigned int ncornerBy2_
AlgebraicVector EulerAngles
static std::string dbString()
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
static unsigned int k_NumberOfParametersPerShape
CaloCellGeometry::Tr3D Tr3D
CaloGeometryDBEP< EcalEndcapGeometry, CaloGeometryDBWriter > EcalEndcapGeometryToDBEP
CaloCellGeometry::Tr3D Tr3D
CaloGeometryDBEP< EcalPreshowerGeometry, CaloGeometryDBWriter > EcalPreshowerGeometryToDBEP
unsigned int ncells() const override
return a count of valid cells (for dense indexing use)
CaloSubdetectorGeometry::DimVec DimVec
CaloGeometryDBEP< CaloTowerGeometry, CaloGeometryDBWriter > CaloTowerGeometryToDBEP
T const * product() const
CaloCellGeometry::CCGFloat CCGFloat
std::vector< uint32_t > const & getIndexes() const
static unsigned int numberOfAlignments()
static constexpr double oneBySix_
std::vector< uint32_t > const & getDenseIndices() const
static unsigned int numberOfAlignments()