CMS 3D CMS Logo

Public Types | Public Member Functions

HcalAlignmentEP Class Reference

#include <HcalAlignmentEP.h>

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 20 of file HcalAlignmentEP.h.


Member Typedef Documentation

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

Definition at line 24 of file HcalAlignmentEP.h.

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

Definition at line 25 of file HcalAlignmentEP.h.

Definition at line 28 of file HcalAlignmentEP.h.

Definition at line 27 of file HcalAlignmentEP.h.


Constructor & Destructor Documentation

HcalAlignmentEP::HcalAlignmentEP ( const edm::ParameterSet )
HcalAlignmentEP::~HcalAlignmentEP ( )

Definition at line 17 of file HcalAlignmentEP.cc.

{}

Member Function Documentation

HcalAlignmentEP::ReturnAli HcalAlignmentEP::produceHcalAli ( const HcalAlignmentRcd iRecord)

Definition at line 19 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().

                                                                                          {

  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( hf.isValid() && // require valid alignments and expected size
          ( hf->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 ;
}