CMS 3D CMS Logo

HcalAlignmentEP.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalAlignmentEP
4 // Class: HcalAlignmentEP
5 //
6 //
7 // Original Author: Brian Heltsley
8 //
9 //
10 
12 
15 }
16 
18 
20 
21  auto ali = std::make_unique<Alignments>();
22 
23  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
24  const unsigned int nA ( HcalGeometry::numberOfAlignments() ) ;
25  vtr.resize( nA ) ;
26 
31  iRecord.getRecord<HBAlignmentRcd>().get( hb ) ;
32  iRecord.getRecord<HEAlignmentRcd>().get( he ) ;
33  iRecord.getRecord<HFAlignmentRcd>().get( hf ) ;
34  iRecord.getRecord<HOAlignmentRcd>().get( ho ) ;
35 
36  assert( hb.isValid() && // require valid alignments and expected size
37  ( hb->m_align.size() == HcalGeometry::numberOfBarrelAlignments() ) ) ;
38  assert( he.isValid() && // require valid alignments and expected size
39  ( he->m_align.size() == HcalGeometry::numberOfEndcapAlignments() ) ) ;
40  assert( hf.isValid() && // require valid alignments and expected size
41  ( hf->m_align.size() == HcalGeometry::numberOfForwardAlignments() ) ) ;
42  assert( ho.isValid() && // require valid alignments and expected size
43  ( ho->m_align.size() == HcalGeometry::numberOfOuterAlignments() ) ) ;
44  const std::vector<AlignTransform>& hbt = hb->m_align ;
45  const std::vector<AlignTransform>& het = he->m_align ;
46  const std::vector<AlignTransform>& hft = hf->m_align ;
47  const std::vector<AlignTransform>& hot = ho->m_align ;
48 
49  copy( hbt.begin(), hbt.end(), vtr.begin() ) ;
50  copy( het.begin(), het.end(), vtr.begin()+hbt.size() ) ;
51  copy( hft.begin(), hft.end(), vtr.begin()+hbt.size()+het.size() ) ;
52  copy( hot.begin(), hot.end(), vtr.begin()+hbt.size()+het.size()+hft.size() ) ;
53 
54  return ali ;
55 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:69
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
ReturnAli produceHcalAli(const HcalAlignmentRcd &iRecord)
def copy(args, dbName)
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
#define hbt
Definition: AMPTWrapper.h:50
std::unique_ptr< Alignments > ReturnAli
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:75
~HcalAlignmentEP() override
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:71
HcalAlignmentEP(const edm::ParameterSet &)
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:73
bool isValid() const
Definition: ESHandle.h:44
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:79