CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual AlignableMuonnewAlignableMuon (const edm::EventSetup &iSetup) const
 
virtual ~MuonAlignmentInputDB ()
 
- Public Member Functions inherited from MuonAlignmentInputMethod
 MuonAlignmentInputMethod ()
 
virtual ~MuonAlignmentInputMethod ()
 

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from MuonAlignmentInputMethod
boost::shared_ptr< CSCGeometryidealCSCGeometry (const edm::EventSetup &iSetup) const
 
boost::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 ( )
virtual

Definition at line 49 of file MuonAlignmentInputDB.cc.

49 {}
MuonAlignmentInputDB::MuonAlignmentInputDB ( const MuonAlignmentInputDB )
private

Member Function Documentation

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

Reimplemented from MuonAlignmentInputMethod.

Definition at line 67 of file MuonAlignmentInputDB.cc.

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

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

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().