CMS 3D CMS Logo

Public Types | Public Member Functions

HcalAlignmentEP Class Reference

Inheritance diagram for HcalAlignmentEP:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Types

typedef boost::shared_ptr
< Alignments
ReturnAli
typedef boost::shared_ptr
< AlignmentErrors
ReturnAliErr
typedef AlignTransform::Rotation Rot
typedef AlignTransform::Translation Trl

Public Member Functions

 HcalAlignmentEP (const edm::ParameterSet &)
ReturnAli produceHcalAli (const HcalAlignmentRcd &iRecord)
 ~HcalAlignmentEP ()

Detailed Description

Definition at line 30 of file HcalAlignmentEP.cc.


Member Typedef Documentation

typedef boost::shared_ptr<Alignments> HcalAlignmentEP::ReturnAli

Definition at line 34 of file HcalAlignmentEP.cc.

typedef boost::shared_ptr<AlignmentErrors> HcalAlignmentEP::ReturnAliErr

Definition at line 35 of file HcalAlignmentEP.cc.

Definition at line 38 of file HcalAlignmentEP.cc.

Definition at line 37 of file HcalAlignmentEP.cc.


Constructor & Destructor Documentation

HcalAlignmentEP::HcalAlignmentEP ( const edm::ParameterSet ) [inline]
HcalAlignmentEP::~HcalAlignmentEP ( ) [inline]

Definition at line 45 of file HcalAlignmentEP.cc.

{}

Member Function Documentation

ReturnAli HcalAlignmentEP::produceHcalAli ( const HcalAlignmentRcd iRecord) [inline]

Definition at line 49 of file HcalAlignmentEP.cc.

References filterCSVwithJSON::copy, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), hbt, edm::ESHandleBase::isValid(), HcalGeometry::numberOfAlignments(), HcalGeometry::numberOfBarrelAlignments(), HcalGeometry::numberOfEndcapAlignments(), HcalGeometry::numberOfForwardAlignments(), and HcalGeometry::numberOfOuterAlignments().

Referenced by HcalAlignmentEP().

      {
         ReturnAli ali ( new Alignments ) ;
         std::vector<AlignTransform>& vtr ( ali->m_align ) ;
         const unsigned int nA ( HcalGeometry::numberOfAlignments() ) ; 
         vtr.resize( nA ) ;

         edm::ESHandle<Alignments> hb ;
         edm::ESHandle<Alignments> he ;
         edm::ESHandle<Alignments> hf ;
         edm::ESHandle<Alignments> ho ;
         iRecord.getRecord<HBAlignmentRcd>().get( hb ) ;
         iRecord.getRecord<HEAlignmentRcd>().get( he ) ;
         iRecord.getRecord<HFAlignmentRcd>().get( hf ) ;
         iRecord.getRecord<HOAlignmentRcd>().get( ho ) ;

         assert( hb.isValid() && // require valid alignments and expected size
                 ( hb->m_align.size() == HcalGeometry::numberOfBarrelAlignments() ) ) ;
         assert( he.isValid() && // require valid alignments and expected size
                 ( he->m_align.size() == HcalGeometry::numberOfEndcapAlignments() ) ) ;
         assert( ho.isValid() && // require valid alignments and expected size
                 ( ho->m_align.size() == HcalGeometry::numberOfForwardAlignments() ) ) ;
         assert( ho.isValid() && // require valid alignments and expected size
                 ( ho->m_align.size() == HcalGeometry::numberOfOuterAlignments() ) ) ;
         const std::vector<AlignTransform>& hbt = hb->m_align ;
         const std::vector<AlignTransform>& het = he->m_align ;
         const std::vector<AlignTransform>& hft = hf->m_align ;
         const std::vector<AlignTransform>& hot = ho->m_align ;

         copy( hbt.begin(), hbt.end(), vtr.begin() ) ;
         copy( het.begin(), het.end(), vtr.begin()+hbt.size() ) ;
         copy( hft.begin(), hft.end(), vtr.begin()+hbt.size()+het.size() ) ;
         copy( hot.begin(), hot.end(), vtr.begin()+hbt.size()+het.size()+hft.size() ) ;

         return ali ;
      }