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( 0 == globalPtr ? 0 :
106 assert( 0 == globalPtr || iGlob < globalPtr->m_align.size());
112 const unsigned int iLoc( 0 == alignPtr ? 0 :
115 assert( 0 == 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( 0 == at ? tr :
149 ( 0 == 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 ( 0 == globalPtr ? 0 :
259 assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
265 const unsigned int iLoc ( 0 == alignPtr ? 0 :
268 assert( 0 == 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 ( 0 == at ? tr :
302 ( 0 == 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";
364 ptr->allocateCorners( topology->
ncells());
368 const unsigned int nTrParm( ptr->numberOfTransformParms());
371 for(
auto it : dins )
375 int layer = ivec[ it ];
378 const unsigned int jj ( it * nTrParm );
380 const ROOT::Math::Translation3D tl( tvec[jj], tvec[jj+1], tvec[jj+2]);
384 const ROOT::Math::Transform3D rt( ea, tl );
385 double xx,
xy,
xz,
dx, yx,
yy,
yz,
dy, zx, zy,
zz,
dz;
386 rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
387 tr =
Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
390 CLHEP::Hep3Vector( dx, dy, dz));
394 dims.reserve( nPerShape );
396 DimVec::const_iterator dsrc( dvec.begin() + layer * nPerShape );
397 for(
unsigned int j ( 0 ) ; j != nPerShape ; ++j )
399 dims.push_back( *dsrc ) ;
403 std::vector<GlobalPoint> corners( 8 );
414 0.25*( corners[0].
y() +
418 0.25*( corners[0].
z() +
427 0.25*( corners[4].
y() +
431 0.25*( corners[4].
z() +
438 std::swap_ranges (corners.begin(), corners.begin()+4, corners.begin()+4);
441 ptr->newCell( front, back, corners[0], myParm,
id );
444 ptr->initializeParms();
CaloGeometryDBEP< EcalBarrelGeometry, CaloGeometryDBWriter > EcalBarrelGeometryToDBEP
unsigned int getHFSize() const
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
CaloGeometryDBEP< CastorGeometry, CaloGeometryDBWriter > CastorGeometryToDBEP
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
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< 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
T x() const
Cartesian x coordinate.
CaloGeometryDBEP< HGCalGeometry, CaloGeometryDBWriter > HGCalGeometryToDBEP
unsigned int totalGeomModules() const
CaloTowerDetId detIdFromDenseIndex(uint32_t din) const
CaloGeometryDBEP< HcalGeometry, CaloGeometryDBWriter > HcalGeometryToDBEP
unsigned int getNumberOfShapes() const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
DetId encode(const DecodedDetId &id_) const
virtual unsigned int numberOfParametersPerShape() 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
virtual DetId denseId2detId(unsigned int) const
return a linear packed id
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)
AlgebraicVector EulerAngles
static std::string dbString()
virtual void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
#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
T const * product() const
CaloCellGeometry::CCGFloat CCGFloat
static void writeIndexed(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const IVec &dins, std::string tag)
std::vector< uint32_t > const & getIndexes() const
static unsigned int numberOfAlignments()
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
std::vector< uint32_t > const & getDenseIndices() const
static unsigned int numberOfAlignments()