CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
11 
12 // System
13 #include <memory>
14 
15 // Framework
19 
20 
21 
22 // Alignment
29 
31 {
32  public:
33 
34  typedef boost::shared_ptr<Alignments> ReturnAli ;
35  typedef boost::shared_ptr<AlignmentErrors> ReturnAliErr ;
36 
39 
41  {
43  }
44 
46 
47 //-------------------------------------------------------------------
48 
50  {
51  ReturnAli ali ( new Alignments ) ;
52  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
53  const unsigned int nA ( HcalGeometry::numberOfAlignments() ) ;
54  vtr.resize( nA ) ;
55 
60  iRecord.getRecord<HBAlignmentRcd>().get( hb ) ;
61  iRecord.getRecord<HEAlignmentRcd>().get( he ) ;
62  iRecord.getRecord<HFAlignmentRcd>().get( hf ) ;
63  iRecord.getRecord<HOAlignmentRcd>().get( ho ) ;
64 
65  assert( hb.isValid() && // require valid alignments and expected size
66  ( hb->m_align.size() == HcalGeometry::numberOfBarrelAlignments() ) ) ;
67  assert( he.isValid() && // require valid alignments and expected size
68  ( he->m_align.size() == HcalGeometry::numberOfEndcapAlignments() ) ) ;
69  assert( ho.isValid() && // require valid alignments and expected size
70  ( ho->m_align.size() == HcalGeometry::numberOfForwardAlignments() ) ) ;
71  assert( ho.isValid() && // require valid alignments and expected size
72  ( ho->m_align.size() == HcalGeometry::numberOfOuterAlignments() ) ) ;
73  const std::vector<AlignTransform>& hbt = hb->m_align ;
74  const std::vector<AlignTransform>& het = he->m_align ;
75  const std::vector<AlignTransform>& hft = hf->m_align ;
76  const std::vector<AlignTransform>& hot = ho->m_align ;
77 
78  copy( hbt.begin(), hbt.end(), vtr.begin() ) ;
79  copy( het.begin(), het.end(), vtr.begin()+hbt.size() ) ;
80  copy( hft.begin(), hft.end(), vtr.begin()+hbt.size()+het.size() ) ;
81  copy( hot.begin(), hot.end(), vtr.begin()+hbt.size()+het.size()+hft.size() ) ;
82 
83  return ali ;
84  }
85 };
86 
87 
88 //define this as a plug-in
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:50
AlignTransform::Translation Trl
CLHEP::Hep3Vector Translation
AlignTransform::Rotation Rot
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
#define hbt
Definition: AMPTWrapper.h:50
boost::shared_ptr< Alignments > ReturnAli
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:54
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:52
ReturnAli produceHcalAli(const HcalAlignmentRcd &iRecord)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:48
HcalAlignmentEP(const edm::ParameterSet &)
boost::shared_ptr< AlignmentErrors > ReturnAliErr
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:56
bool isValid() const
Definition: ESHandle.h:37
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:58
CLHEP::HepRotation Rotation