CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MuonAlignmentInputDB Class Reference

#include <Alignment/MuonAlignment/interface/MuonAlignmentInputDB.h>

Inheritance diagram for MuonAlignmentInputDB:
MuonAlignmentInputMethod

Public Member Functions

 MuonAlignmentInputDB ()
 
 MuonAlignmentInputDB (std::string dtLabel, std::string cscLabel, bool getAPEs)
 
AlignableMuonnewAlignableMuon (const edm::EventSetup &iSetup) const override
 
 ~MuonAlignmentInputDB () override
 
- Public Member Functions inherited from MuonAlignmentInputMethod
 MuonAlignmentInputMethod ()
 
virtual ~MuonAlignmentInputMethod ()
 

Private Member Functions

 MuonAlignmentInputDB (const MuonAlignmentInputDB &)=delete
 
const MuonAlignmentInputDBoperator= (const MuonAlignmentInputDB &)=delete
 

Private Attributes

std::string m_cscLabel
 
std::string m_dtLabel
 
bool m_getAPEs
 

Additional Inherited Members

- Protected Member Functions inherited from MuonAlignmentInputMethod
std::shared_ptr< CSCGeometryidealCSCGeometry (const edm::EventSetup &iSetup) const
 
std::shared_ptr< DTGeometryidealDTGeometry (const edm::EventSetup &iSetup) const
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 29 of file MuonAlignmentInputDB.h.

Constructor & Destructor Documentation

MuonAlignmentInputDB::MuonAlignmentInputDB ( )

Definition at line 38 of file MuonAlignmentInputDB.cc.

MuonAlignmentInputDB::MuonAlignmentInputDB ( std::string  dtLabel,
std::string  cscLabel,
bool  getAPEs 
)
MuonAlignmentInputDB::~MuonAlignmentInputDB ( )
override

Definition at line 48 of file MuonAlignmentInputDB.cc.

48 {}
MuonAlignmentInputDB::MuonAlignmentInputDB ( const MuonAlignmentInputDB )
privatedelete

Member Function Documentation

AlignableMuon * MuonAlignmentInputDB::newAlignableMuon ( const edm::EventSetup iSetup) const
overridevirtual

Reimplemented from MuonAlignmentInputMethod.

Definition at line 66 of file MuonAlignmentInputDB.cc.

References align::AlignableMuon, GeometryAligner::applyAlignments(), align::DetectorGlobalPosition(), edm::EventSetup::get(), mps_fire::i, MuonAlignmentInputMethod::idealCSCGeometry(), MuonAlignmentInputMethod::idealDTGeometry(), Alignments::m_align, AlignmentErrorsExtended::m_alignError, m_cscLabel, m_dtLabel, m_getAPEs, and DetId::Muon.

66  {
67  std::shared_ptr<DTGeometry> dtGeometry = idealDTGeometry(iSetup);
68  std::shared_ptr<CSCGeometry> cscGeometry = idealCSCGeometry(iSetup);
69 
70  edm::ESHandle<Alignments> dtAlignments;
71  edm::ESHandle<AlignmentErrorsExtended> dtAlignmentErrorsExtended;
72  edm::ESHandle<Alignments> cscAlignments;
73  edm::ESHandle<AlignmentErrorsExtended> cscAlignmentErrorsExtended;
74  edm::ESHandle<Alignments> globalPositionRcd;
75 
76  iSetup.get<DTAlignmentRcd>().get(m_dtLabel, dtAlignments);
77  iSetup.get<CSCAlignmentRcd>().get(m_cscLabel, cscAlignments);
78  iSetup.get<GlobalPositionRcd>().get(globalPositionRcd);
79 
80  if (m_getAPEs) {
81  iSetup.get<DTAlignmentErrorExtendedRcd>().get(m_dtLabel, dtAlignmentErrorsExtended);
82  iSetup.get<CSCAlignmentErrorExtendedRcd>().get(m_cscLabel, cscAlignmentErrorsExtended);
83 
84  GeometryAligner aligner;
85  aligner.applyAlignments<DTGeometry>(&(*dtGeometry),
86  &(*dtAlignments),
87  &(*dtAlignmentErrorsExtended),
88  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
89  aligner.applyAlignments<CSCGeometry>(&(*cscGeometry),
90  &(*cscAlignments),
91  &(*cscAlignmentErrorsExtended),
92  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
93  } else {
94  AlignmentErrorsExtended dtAlignmentErrorsExtended2, cscAlignmentErrorsExtended2;
95 
96  for (std::vector<AlignTransform>::const_iterator i = dtAlignments->m_align.begin();
97  i != dtAlignments->m_align.end();
98  ++i) {
99  CLHEP::HepSymMatrix empty_matrix(3, 0);
100  AlignTransformErrorExtended empty_error(empty_matrix, i->rawId());
101  dtAlignmentErrorsExtended2.m_alignError.push_back(empty_error);
102  }
103  for (std::vector<AlignTransform>::const_iterator i = cscAlignments->m_align.begin();
104  i != cscAlignments->m_align.end();
105  ++i) {
106  CLHEP::HepSymMatrix empty_matrix(3, 0);
107  AlignTransformErrorExtended empty_error(empty_matrix, i->rawId());
108  cscAlignmentErrorsExtended2.m_alignError.push_back(empty_error);
109  }
110 
111  GeometryAligner aligner;
112  aligner.applyAlignments<DTGeometry>(&(*dtGeometry),
113  &(*dtAlignments),
114  &(dtAlignmentErrorsExtended2),
115  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
116  aligner.applyAlignments<CSCGeometry>(&(*cscGeometry),
117  &(*cscAlignments),
118  &(cscAlignmentErrorsExtended2),
119  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
120  }
121 
122  return new AlignableMuon(&(*dtGeometry), &(*cscGeometry));
123 }
Class to update a given geometry with a set of alignments.
std::shared_ptr< DTGeometry > idealDTGeometry(const edm::EventSetup &iSetup) const
std::shared_ptr< CSCGeometry > idealCSCGeometry(const edm::EventSetup &iSetup) const
Definition: DetId.h:17
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
std::vector< AlignTransformErrorExtended > m_alignError
T get() const
Definition: EventSetup.h:73
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
const MuonAlignmentInputDB& MuonAlignmentInputDB::operator= ( const MuonAlignmentInputDB )
privatedelete

Member Data Documentation

std::string MuonAlignmentInputDB::m_cscLabel
private

Definition at line 50 of file MuonAlignmentInputDB.h.

Referenced by newAlignableMuon().

std::string MuonAlignmentInputDB::m_dtLabel
private

Definition at line 50 of file MuonAlignmentInputDB.h.

Referenced by newAlignableMuon().

bool MuonAlignmentInputDB::m_getAPEs
private

Definition at line 51 of file MuonAlignmentInputDB.h.

Referenced by newAlignableMuon().