test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
CaloGeometryDBEP< T, U > Class Template Reference

#include <CaloGeometryDBEP.h>

Inheritance diagram for CaloGeometryDBEP< T, U >:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef
CaloSubdetectorGeometry::DimVec 
DimVec
 
typedef
CaloSubdetectorGeometry::IVec 
IVec
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
typedef boost::shared_ptr
< CaloSubdetectorGeometry
PtrType
 
typedef CaloCellGeometry::Tr3D Tr3D
 
typedef
CaloSubdetectorGeometry::TrVec 
TrVec
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

 CaloGeometryDBEP (const edm::ParameterSet &ps)
 
template<>
CaloGeometryDBEP< HcalGeometry,
CaloGeometryDBReader >
::PtrType 
produceAligned (const typename HcalGeometry::AlignedRecord &iRecord)
 
template<>
CaloGeometryDBEP< HcalGeometry,
CaloGeometryDBWriter >
::PtrType 
produceAligned (const typename HcalGeometry::AlignedRecord &iRecord)
 
PtrType produceAligned (const typename T::AlignedRecord &iRecord)
 
virtual ~CaloGeometryDBEP ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Private Attributes

bool m_applyAlignment
 
const edm::ParameterSet m_pSet
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

template<class T, class U>
class CaloGeometryDBEP< T, U >

Definition at line 37 of file CaloGeometryDBEP.h.

Member Typedef Documentation

template<class T, class U>
typedef CaloCellGeometry::CCGFloat CaloGeometryDBEP< T, U >::CCGFloat

Definition at line 41 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloSubdetectorGeometry::DimVec CaloGeometryDBEP< T, U >::DimVec

Definition at line 48 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloSubdetectorGeometry::IVec CaloGeometryDBEP< T, U >::IVec

Definition at line 49 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloCellGeometry::Pt3D CaloGeometryDBEP< T, U >::Pt3D

Definition at line 42 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloCellGeometry::Pt3DVec CaloGeometryDBEP< T, U >::Pt3DVec

Definition at line 43 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef boost::shared_ptr< CaloSubdetectorGeometry > CaloGeometryDBEP< T, U >::PtrType

Definition at line 46 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloCellGeometry::Tr3D CaloGeometryDBEP< T, U >::Tr3D

Definition at line 44 of file CaloGeometryDBEP.h.

template<class T, class U>
typedef CaloSubdetectorGeometry::TrVec CaloGeometryDBEP< T, U >::TrVec

Definition at line 47 of file CaloGeometryDBEP.h.

Constructor & Destructor Documentation

template<class T, class U>
CaloGeometryDBEP< T, U >::CaloGeometryDBEP ( const edm::ParameterSet ps)
inline

Definition at line 51 of file CaloGeometryDBEP.h.

References edm::ESProducer::setWhatProduced().

51  :
52  m_applyAlignment ( ps.getParameter<bool>("applyAlignment") ),
53  m_pSet( ps )
54 
55  {
56  setWhatProduced( this,
58  edm::es::Label( T::producerTag() ) ) ;//+std::string("TEST") ) ) ;
59  }
T getParameter(std::string const &) const
const edm::ParameterSet m_pSet
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
template<class T, class U>
virtual CaloGeometryDBEP< T, U >::~CaloGeometryDBEP ( )
inlinevirtual

Definition at line 61 of file CaloGeometryDBEP.h.

61 {}

Member Function Documentation

Definition at line 9 of file moduleDB.cc.

References HcalGeometry::alignmentTransformIndexGlobal(), HcalGeometry::alignmentTransformIndexLocal(), asciidump::at, HcalGeometry::dbString(), edm::eventsetup::EventSetupRecord::get(), CaloCellGeometry::getParmPtr(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), CaloSubdetectorGeometry::getSummary(), gt, i, edm::ESHandleBase::isValid(), j, findQualityFiles::jj, HcalGeometry::k_NumberOfParametersPerShape, Alignments::m_align, HcalGeometry::numberOfAlignments(), HcalGeometry::producerTag(), edm::ESHandle< class >::product(), AlCaHLTBitMon_QueryRunRegistry::string, CaloGeometryDBReader::writeFlag(), CaloGeometryDBReader::writeIndexed(), and create_public_lumi_plots::xy.

10 {
11  const Alignments* alignPtr ( 0 ) ;
12  const Alignments* globalPtr ( 0 ) ;
13  if( m_applyAlignment ) // get ptr if necessary
14  {
15  edm::ESHandle< Alignments > alignments ;
16  iRecord.getRecord< typename HcalGeometry::AlignmentRecord >().get( alignments ) ;
17 
18  assert( alignments.isValid() && // require valid alignments and expected size
19  ( alignments->m_align.size() == HcalGeometry::numberOfAlignments() ) ) ;
20  alignPtr = alignments.product() ;
21 
23  iRecord.getRecord<GlobalPositionRcd>().get( globals ) ;
24 
25  assert( globals.isValid() ) ;
26  globalPtr = globals.product() ;
27  }
28 
29  TrVec tvec ;
30  DimVec dvec ;
31  IVec ivec ;
32  IVec dins ;
33 
35  {
37  iRecord.get( HcalGeometry::producerTag() + std::string("_master"), pG ) ;
38 
39  const CaloSubdetectorGeometry* pGptr ( pG.product() ) ;
40 
41  pGptr->getSummary( tvec, ivec, dvec, dins ) ;
42 
43  CaloGeometryDBReader::writeIndexed( tvec, dvec, ivec, dins, HcalGeometry::dbString() ) ;
44  }
45  else
46  {
48  iRecord.getRecord<typename HcalGeometry::PGeometryRecord >().get( pG ) ;
49 
50  tvec = pG->getTranslation() ;
51  dvec = pG->getDimension() ;
52  ivec = pG->getIndexes() ;
53  dins = pG->getDenseIndices();
54  }
55  //*********************************************************************************************
56 
57 
58  edm::ESHandle<HcalTopology> hcalTopology;
59  iRecord.getRecord<IdealGeometryRecord>().get( hcalTopology );
60 
61  // We know that the numer of shapes chanes with changing depth
62  // so, this check is temporary disabled. We need to implement
63  // a way either to store or calculate the number of shapes or be able
64  // to deal with only max numer of shapes.
65  // assert( dvec.size() == hcalTopology->getNumberOfShapes() * HcalGeometry::k_NumberOfParametersPerShape ) ;
66  assert( dvec.size() <= hcalTopology->getNumberOfShapes() * HcalGeometry::k_NumberOfParametersPerShape ) ;
67  HcalGeometry* hcg=new HcalGeometry( *hcalTopology );
68 
69  PtrType ptr ( hcg );
70 
71  const unsigned int nTrParm ( tvec.size()/hcalTopology->ncells() ) ;
72 
73  ptr->fillDefaultNamedParameters() ;
74 
75  ptr->allocateCorners( hcalTopology->ncells() );
76 
77  ptr->allocatePar( dvec.size() ,
79 
80  for( unsigned int i ( 0 ) ; i < dins.size() ; ++i )
81  {
82  const unsigned int nPerShape ( HcalGeometry::k_NumberOfParametersPerShape ) ;
83  DimVec dims ;
84  dims.reserve( nPerShape ) ;
85 
86  const unsigned int indx ( ivec.size()==1 ? 0 : i ) ;
87 
88  DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
89 
90  for( unsigned int j ( 0 ) ; j != nPerShape ; ++j )
91  {
92  dims.push_back( *dsrc ) ;
93  ++dsrc ;
94  }
95 
96  const CCGFloat* myParm ( CaloCellGeometry::getParmPtr( dims,
97  ptr->parMgr(),
98  ptr->parVecVec() ) ) ;
99 
100 
101  const DetId id ( hcalTopology->denseId2detId(dins[i]) );
102 
103  const unsigned int iGlob ( 0 == globalPtr ? 0 :
105 
106  assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
107 
108  const AlignTransform* gt ( 0 == globalPtr ? 0 : &globalPtr->m_align[ iGlob ] ) ;
109 
110  assert( 0 == gt || iGlob == HcalGeometry::alignmentTransformIndexGlobal( DetId( gt->rawId() ) ) ) ;
111 
112  const unsigned int iLoc ( 0 == alignPtr ? 0 :
114 
115  assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
116 
117  const AlignTransform* at ( 0 == alignPtr ? 0 :
118  &alignPtr->m_align[ iLoc ] ) ;
119 
120  assert( 0 == at || ( HcalGeometry::alignmentTransformIndexLocal( DetId( at->rawId() ) ) == iLoc ) ) ;
121 
122  Pt3D lRef ;
123  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
124  hcg->localCorners( lc, &dims.front(), dins[i], lRef ) ;
125 
126  const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ; // ctr rear face in local
127  const Pt3D lCor ( lc[0] ) ;
128 
129  //----------------------------------- create transform from 6 numbers ---
130  const unsigned int jj ( dins[i]*nTrParm ) ;
131  Tr3D tr ;
132  const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
133  const ROOT::Math::EulerAngles ea (
134  6==nTrParm ?
135  ROOT::Math::EulerAngles( tvec[jj+3], tvec[jj+4], tvec[jj+5] ) :
137  const ROOT::Math::Transform3D rt ( ea, tl ) ;
138  double xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz;
139  rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
140  tr = Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
141  yx, yy, yz,
142  zx, zy, zz ),
143  CLHEP::Hep3Vector(dx,dy,dz) );
144 
145  // now prepend alignment(s) for final transform
146  const Tr3D atr ( 0 == at ? tr :
147  ( 0 == gt ? at->transform()*tr :
148  at->transform()*gt->transform()*tr ) ) ;
149  //--------------------------------- done making transform ---------------
150 
151  const Pt3D gRef ( atr*lRef ) ;
152  const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
153  const Pt3D gBck ( atr*lBck ) ;
154  const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
155  const Pt3D gCor ( atr*lCor ) ;
156  const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
157 
158  assert( hcalTopology->detId2denseId(id) == dins[i] );
159 
160  ptr->newCell( fCtr, fBck, fCor, myParm, id ) ;
161  }
162 
163  ptr->initializeParms() ; // initializations; must happen after cells filled
164 
165  return ptr ;
166 }
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
static std::string producerTag()
Definition: HcalGeometry.h:54
boost::shared_ptr< CaloSubdetectorGeometry > PtrType
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
CaloSubdetectorGeometry::IVec IVec
static void writeIndexed(const TrVec &, const DimVec &, const IVec &, const std::vector< uint32_t > &, std::string)
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
int j
Definition: DBlmapReader.cc:9
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::TrVec TrVec
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
static std::string dbString()
Definition: HcalGeometry.h:35
T const * product() const
Definition: ESHandle.h:62
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
DTRecHit1DPair & gt
CaloSubdetectorGeometry::DimVec DimVec
bool isValid() const
Definition: ESHandle.h:37
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:66
id_type rawId() const
list at
Definition: asciidump.py:428

Definition at line 13 of file calowriters.cc.

References HcalGeometry::alignmentTransformIndexGlobal(), HcalGeometry::alignmentTransformIndexLocal(), asciidump::at, HcalGeometry::dbString(), edm::eventsetup::EventSetupRecord::get(), CaloCellGeometry::getParmPtr(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), CaloSubdetectorGeometry::getSummary(), gt, i, edm::ESHandleBase::isValid(), j, findQualityFiles::jj, HcalGeometry::k_NumberOfParametersPerShape, Alignments::m_align, HcalGeometry::numberOfAlignments(), HcalGeometry::producerTag(), edm::ESHandle< class >::product(), AlCaHLTBitMon_QueryRunRegistry::string, CaloGeometryDBWriter::writeFlag(), CaloGeometryDBWriter::writeIndexed(), and create_public_lumi_plots::xy.

14 {
15  const Alignments* alignPtr ( 0 ) ;
16  const Alignments* globalPtr ( 0 ) ;
17  if( m_applyAlignment ) // get ptr if necessary
18  {
19  edm::ESHandle< Alignments > alignments ;
20  iRecord.getRecord< typename HcalGeometry::AlignmentRecord >().get( alignments ) ;
21 
22  assert( alignments.isValid() && // require valid alignments and expected size
23  ( alignments->m_align.size() == HcalGeometry::numberOfAlignments() ) ) ;
24  alignPtr = alignments.product() ;
25 
27  iRecord.getRecord<GlobalPositionRcd>().get( globals ) ;
28 
29  assert( globals.isValid() ) ;
30  globalPtr = globals.product() ;
31  }
32 
33  TrVec tvec ;
34  DimVec dvec ;
35  IVec ivec ;
36  IVec dins ;
37 
39  {
41  iRecord.get( HcalGeometry::producerTag() + std::string("_master"), pG ) ;
42 
43  const CaloSubdetectorGeometry* pGptr ( pG.product() ) ;
44 
45  pGptr->getSummary( tvec, ivec, dvec, dins ) ;
46 
47  CaloGeometryDBWriter::writeIndexed( tvec, dvec, ivec, dins, HcalGeometry::dbString() ) ;
48  }
49  else
50  {
52  iRecord.getRecord<typename HcalGeometry::PGeometryRecord >().get( pG ) ;
53 
54  tvec = pG->getTranslation() ;
55  dvec = pG->getDimension() ;
56  ivec = pG->getIndexes() ;
57  dins = pG->getDenseIndices();
58  }
59  //*********************************************************************************************
60 
61  edm::ESHandle<HcalTopology> hcalTopology;
62  iRecord.getRecord<IdealGeometryRecord>().get( hcalTopology );
63 
64  // We know that the numer of shapes chanes with changing depth
65  // so, this check is temporary disabled. We need to implement
66  // a way either to store or calculate the number of shapes or be able
67  // to deal with only max numer of shapes.
68  assert( dvec.size() <= hcalTopology->getNumberOfShapes() * HcalGeometry::k_NumberOfParametersPerShape ) ;
69  HcalGeometry* hcg=new HcalGeometry( *hcalTopology );
70  PtrType ptr ( hcg );
71 
72  const unsigned int nTrParm ( tvec.size()/hcalTopology->ncells() ) ;
73 
74  ptr->fillDefaultNamedParameters() ;
75 
76  ptr->allocateCorners( hcalTopology->ncells() ) ;
77 
78  ptr->allocatePar( dvec.size() ,
80 
81  for( unsigned int i ( 0 ) ; i < dins.size(); ++i )
82  {
83  const unsigned int nPerShape ( HcalGeometry::k_NumberOfParametersPerShape ) ;
84  DimVec dims ;
85  dims.reserve( nPerShape ) ;
86 
87  const unsigned int indx ( ivec.size()==1 ? 0 : i ) ;
88 
89  DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
90 
91  for( unsigned int j ( 0 ) ; j != nPerShape ; ++j )
92  {
93  dims.push_back( *dsrc ) ;
94  ++dsrc ;
95  }
96 
97  const CCGFloat* myParm ( CaloCellGeometry::getParmPtr( dims,
98  ptr->parMgr(),
99  ptr->parVecVec() ) ) ;
100 
101 
102  const DetId id ( hcalTopology->denseId2detId(dins[i]) ) ;
103 
104  const unsigned int iGlob ( 0 == globalPtr ? 0 :
106 
107  assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
108 
109  const AlignTransform* gt ( 0 == globalPtr ? 0 : &globalPtr->m_align[ iGlob ] ) ;
110 
111  assert( 0 == gt || iGlob == HcalGeometry::alignmentTransformIndexGlobal( DetId( gt->rawId() ) ) ) ;
112 
113  const unsigned int iLoc ( 0 == alignPtr ? 0 :
115 
116  assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
117 
118  const AlignTransform* at ( 0 == alignPtr ? 0 :
119  &alignPtr->m_align[ iLoc ] ) ;
120 
121  assert( 0 == at || ( HcalGeometry::alignmentTransformIndexLocal( DetId( at->rawId() ) ) == iLoc ) ) ;
122 
123  Pt3D lRef ;
124  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
125  hcg->localCorners( lc, &dims.front(), dins[i], lRef ) ;
126 
127  const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ; // ctr rear face in local
128  const Pt3D lCor ( lc[0] ) ;
129 
130  //----------------------------------- create transform from 6 numbers ---
131  const unsigned int jj ( dins[i]*nTrParm ) ;
132 
133  Tr3D tr ;
134  const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
135  const ROOT::Math::EulerAngles ea (
136  6==nTrParm ?
137  ROOT::Math::EulerAngles( tvec[jj+3], tvec[jj+4], tvec[jj+5] ) :
139  const ROOT::Math::Transform3D rt ( ea, tl ) ;
140  double xx,xy,xz,dx,yx,yy,yz,dy,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,
143  yx, yy, yz,
144  zx, zy, zz ),
145  CLHEP::Hep3Vector(dx,dy,dz) );
146 
147  // now prepend alignment(s) for final transform
148  const Tr3D atr ( 0 == at ? tr :
149  ( 0 == gt ? at->transform()*tr :
150  at->transform()*gt->transform()*tr ) ) ;
151  //--------------------------------- done making transform ---------------
152 
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() ) ;
159 
160  assert( hcalTopology->detId2denseId(id) == dins[i] );
161  ptr->newCell( fCtr, fBck, fCor, myParm, id ) ;
162  }
163 
164  ptr->initializeParms() ; // initializations; must happen after cells filled
165 
166  return ptr ;
167 }
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::Pt3D Pt3D
static unsigned int alignmentTransformIndexLocal(const DetId &id)
static std::string producerTag()
Definition: HcalGeometry.h:54
boost::shared_ptr< CaloSubdetectorGeometry > PtrType
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
CaloSubdetectorGeometry::IVec IVec
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
int j
Definition: DBlmapReader.cc:9
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::TrVec TrVec
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
static std::string dbString()
Definition: HcalGeometry.h:35
T const * product() const
Definition: ESHandle.h:62
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
DTRecHit1DPair & gt
CaloSubdetectorGeometry::DimVec DimVec
bool isValid() const
Definition: ESHandle.h:37
static void writeIndexed(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const IVec &dins, std::string tag)
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:66
id_type rawId() const
list at
Definition: asciidump.py:428
template<class T, class U>
PtrType CaloGeometryDBEP< T, U >::produceAligned ( const typename T::AlignedRecord &  iRecord)
inline

Definition at line 63 of file CaloGeometryDBEP.h.

References asciidump::at, CaloCellGeometry::getParmPtr(), CaloSubdetectorGeometry::getSummary(), gt, i, edm::ESHandleBase::isValid(), j, findQualityFiles::jj, Alignments::m_align, CaloGeometryDBEP< T, U >::m_applyAlignment, edm::ESHandle< class >::product(), AlCaHLTBitMon_QueryRunRegistry::string, TablePrint::write, and create_public_lumi_plots::xy.

64  {
65  const Alignments* alignPtr ( 0 ) ;
66  const Alignments* globalPtr ( 0 ) ;
67  if( m_applyAlignment ) // get ptr if necessary
68  {
69  edm::ESHandle< Alignments > alignments ;
70  iRecord.template getRecord< typename T::AlignmentRecord >().get( alignments ) ;
71 
72  assert( alignments.isValid() && // require valid alignments and expected size
73  ( alignments->m_align.size() == T::numberOfAlignments() ) ) ;
74  alignPtr = alignments.product() ;
75 
77  iRecord.template getRecord<GlobalPositionRcd>().get( globals ) ;
78 
79  assert( globals.isValid() ) ;
80  globalPtr = globals.product() ;
81  }
82 
83  TrVec tvec ;
84  DimVec dvec ;
85  IVec ivec ;
86  std::vector<uint32_t> dins;
87 
88  if( U::writeFlag() )
89  {
91  iRecord.get( T::producerTag() + std::string("_master"), pG ) ;
92 
93  const CaloSubdetectorGeometry* pGptr ( pG.product() ) ;
94 
95  pGptr->getSummary( tvec, ivec, dvec, dins ) ;
96 
97  U::write( tvec, dvec, ivec, T::dbString() ) ;
98  }
99  else
100  {
102  iRecord.template getRecord<typename T::PGeometryRecord >().get( pG ) ;
103 
104  tvec = pG->getTranslation() ;
105  dvec = pG->getDimension() ;
106  ivec = pG->getIndexes() ;
107  }
108 //*********************************************************************************************
109 
110  const unsigned int nTrParm ( tvec.size()/T::k_NumberOfCellsForCorners ) ;
111 
112  assert( dvec.size() == T::k_NumberOfShapes * T::k_NumberOfParametersPerShape ) ;
113 
114  PtrType ptr ( new T ) ;
115 
116  ptr->fillDefaultNamedParameters() ;
117 
118  ptr->allocateCorners( T::k_NumberOfCellsForCorners ) ;
119 
120  ptr->allocatePar( dvec.size() ,
121  T::k_NumberOfParametersPerShape ) ;
122 
123  for( unsigned int i ( 0 ) ; i != T::k_NumberOfCellsForCorners ; ++i )
124  {
125  const unsigned int nPerShape ( T::k_NumberOfParametersPerShape ) ;
126  DimVec dims ;
127  dims.reserve( nPerShape ) ;
128 
129  const unsigned int indx ( ivec.size()==1 ? 0 : i ) ;
130 
131  DimVec::const_iterator dsrc ( dvec.begin() + ivec[indx]*nPerShape ) ;
132 
133  for( unsigned int j ( 0 ) ; j != nPerShape ; ++j )
134  {
135  dims.push_back( *dsrc ) ;
136  ++dsrc ;
137  }
138 
139  const CCGFloat* myParm ( CaloCellGeometry::getParmPtr( dims,
140  ptr->parMgr(),
141  ptr->parVecVec() ) ) ;
142 
143 
144  const DetId id ( T::DetIdType::detIdFromDenseIndex( i ) ) ;
145 
146  const unsigned int iGlob ( 0 == globalPtr ? 0 :
147  T::alignmentTransformIndexGlobal( id ) ) ;
148 
149  assert( 0 == globalPtr || iGlob < globalPtr->m_align.size() ) ;
150 
151  const AlignTransform* gt ( 0 == globalPtr ? 0 : &globalPtr->m_align[ iGlob ] ) ;
152 
153  assert( 0 == gt || iGlob == T::alignmentTransformIndexGlobal( DetId( gt->rawId() ) ) ) ;
154 
155  const unsigned int iLoc ( 0 == alignPtr ? 0 :
156  T::alignmentTransformIndexLocal( id ) ) ;
157 
158  assert( 0 == alignPtr || iLoc < alignPtr->m_align.size() ) ;
159 
160  const AlignTransform* at ( 0 == alignPtr ? 0 :
161  &alignPtr->m_align[ iLoc ] ) ;
162 
163  assert( 0 == at || ( T::alignmentTransformIndexLocal( DetId( at->rawId() ) ) == iLoc ) ) ;
164 
165  const CaloGenericDetId gId ( id ) ;
166 
167  Pt3D lRef ;
168  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
169  T::localCorners( lc, &dims.front(), i, lRef ) ;
170 
171  const Pt3D lBck ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7] ) ) ; // ctr rear face in local
172  const Pt3D lCor ( lc[0] ) ;
173 
174  //----------------------------------- create transform from 6 numbers ---
175  const unsigned int jj ( i*nTrParm ) ;
176  Tr3D tr ;
177  const ROOT::Math::Translation3D tl ( tvec[jj], tvec[jj+1], tvec[jj+2] ) ;
178  const ROOT::Math::EulerAngles ea (
179  6==nTrParm ?
180  ROOT::Math::EulerAngles( tvec[jj+3], tvec[jj+4], tvec[jj+5] ) :
182  const ROOT::Math::Transform3D rt ( ea, tl ) ;
183  double xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz;
184  rt.GetComponents(xx,xy,xz,dx,yx,yy,yz,dy,zx,zy,zz,dz) ;
185  tr = Tr3D( CLHEP::HepRep3x3( xx, xy, xz,
186  yx, yy, yz,
187  zx, zy, zz ),
188  CLHEP::Hep3Vector(dx,dy,dz) );
189 
190  // now prepend alignment(s) for final transform
191  const Tr3D atr ( 0 == at ? tr :
192  ( 0 == gt ? at->transform()*tr :
193  at->transform()*gt->transform()*tr ) ) ;
194  //--------------------------------- done making transform ---------------
195 
196  const Pt3D gRef ( atr*lRef ) ;
197  const GlobalPoint fCtr ( gRef.x(), gRef.y(), gRef.z() ) ;
198  const Pt3D gBck ( atr*lBck ) ;
199  const GlobalPoint fBck ( gBck.x(), gBck.y(), gBck.z() ) ;
200  const Pt3D gCor ( atr*lCor ) ;
201  const GlobalPoint fCor ( gCor.x(), gCor.y(), gCor.z() ) ;
202 
203  ptr->newCell( fCtr, fBck, fCor, myParm, id ) ;
204  }
205 
206  ptr->initializeParms() ; // initializations; must happen after cells filled
207 
208  return ptr ;
209  }
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::Pt3D Pt3D
boost::shared_ptr< CaloSubdetectorGeometry > PtrType
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
CaloSubdetectorGeometry::IVec IVec
int j
Definition: DBlmapReader.cc:9
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::TrVec TrVec
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
T const * product() const
Definition: ESHandle.h:62
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
DTRecHit1DPair & gt
CaloSubdetectorGeometry::DimVec DimVec
bool isValid() const
Definition: ESHandle.h:37
long double T
id_type rawId() const
list at
Definition: asciidump.py:428

Member Data Documentation

template<class T, class U>
bool CaloGeometryDBEP< T, U >::m_applyAlignment
private

Definition at line 213 of file CaloGeometryDBEP.h.

Referenced by CaloGeometryDBEP< T, U >::produceAligned().

template<class T, class U>
const edm::ParameterSet CaloGeometryDBEP< T, U >::m_pSet
private

Definition at line 214 of file CaloGeometryDBEP.h.