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, std::string idealLabel, bool getAPEs)
 
AlignableMuonnewAlignableMuon (const edm::EventSetup &iSetup) const override
 
 ~MuonAlignmentInputDB () override
 
- Public Member Functions inherited from MuonAlignmentInputMethod
 MuonAlignmentInputMethod ()
 
 MuonAlignmentInputMethod (std::string idealLabel)
 
virtual ~MuonAlignmentInputMethod ()
 

Private Member Functions

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

Private Attributes

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

Detailed Description

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

Usage: <usage>

Definition at line 29 of file MuonAlignmentInputDB.h.

Constructor & Destructor Documentation

◆ MuonAlignmentInputDB() [1/3]

MuonAlignmentInputDB::MuonAlignmentInputDB ( )

Definition at line 38 of file MuonAlignmentInputDB.cc.

39  : m_dtLabel(""), m_cscLabel(""), idealGeometryLabel("idealForInputDB"), m_getAPEs(false) {}

◆ MuonAlignmentInputDB() [2/3]

MuonAlignmentInputDB::MuonAlignmentInputDB ( std::string  dtLabel,
std::string  cscLabel,
std::string  idealLabel,
bool  getAPEs 
)

Definition at line 41 of file MuonAlignmentInputDB.cc.

◆ ~MuonAlignmentInputDB()

MuonAlignmentInputDB::~MuonAlignmentInputDB ( )
override

Definition at line 52 of file MuonAlignmentInputDB.cc.

52 {}

◆ MuonAlignmentInputDB() [3/3]

MuonAlignmentInputDB::MuonAlignmentInputDB ( const MuonAlignmentInputDB )
privatedelete

Member Function Documentation

◆ newAlignableMuon()

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

Reimplemented from MuonAlignmentInputMethod.

Definition at line 70 of file MuonAlignmentInputDB.cc.

70  {
71  edm::ESHandle<DTGeometry> dtGeometry;
72  edm::ESHandle<CSCGeometry> cscGeometry;
73  iSetup.get<MuonGeometryRecord>().get(idealGeometryLabel, dtGeometry);
74  iSetup.get<MuonGeometryRecord>().get(idealGeometryLabel, cscGeometry);
75 
76  edm::ESHandle<Alignments> dtAlignments;
77  edm::ESHandle<AlignmentErrorsExtended> dtAlignmentErrorsExtended;
78  edm::ESHandle<Alignments> cscAlignments;
79  edm::ESHandle<AlignmentErrorsExtended> cscAlignmentErrorsExtended;
80  edm::ESHandle<Alignments> globalPositionRcd;
81 
82  iSetup.get<DTAlignmentRcd>().get(m_dtLabel, dtAlignments);
83  iSetup.get<CSCAlignmentRcd>().get(m_cscLabel, cscAlignments);
84  iSetup.get<GlobalPositionRcd>().get(globalPositionRcd);
85 
86  if (m_getAPEs) {
87  iSetup.get<DTAlignmentErrorExtendedRcd>().get(m_dtLabel, dtAlignmentErrorsExtended);
88  iSetup.get<CSCAlignmentErrorExtendedRcd>().get(m_cscLabel, cscAlignmentErrorsExtended);
89 
90  GeometryAligner aligner;
91  aligner.applyAlignments<DTGeometry>(&(*dtGeometry),
92  &(*dtAlignments),
93  &(*dtAlignmentErrorsExtended),
94  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
95  aligner.applyAlignments<CSCGeometry>(&(*cscGeometry),
96  &(*cscAlignments),
97  &(*cscAlignmentErrorsExtended),
98  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
99  } else {
100  AlignmentErrorsExtended dtAlignmentErrorsExtended2, cscAlignmentErrorsExtended2;
101 
102  for (std::vector<AlignTransform>::const_iterator i = dtAlignments->m_align.begin();
103  i != dtAlignments->m_align.end();
104  ++i) {
105  CLHEP::HepSymMatrix empty_matrix(3, 0);
106  AlignTransformErrorExtended empty_error(empty_matrix, i->rawId());
107  dtAlignmentErrorsExtended2.m_alignError.push_back(empty_error);
108  }
109  for (std::vector<AlignTransform>::const_iterator i = cscAlignments->m_align.begin();
110  i != cscAlignments->m_align.end();
111  ++i) {
112  CLHEP::HepSymMatrix empty_matrix(3, 0);
113  AlignTransformErrorExtended empty_error(empty_matrix, i->rawId());
114  cscAlignmentErrorsExtended2.m_alignError.push_back(empty_error);
115  }
116 
117  GeometryAligner aligner;
118  aligner.applyAlignments<DTGeometry>(&(*dtGeometry),
119  &(*dtAlignments),
120  &(dtAlignmentErrorsExtended2),
121  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
122  aligner.applyAlignments<CSCGeometry>(&(*cscGeometry),
123  &(*cscAlignments),
124  &(cscAlignmentErrorsExtended2),
125  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
126  }
127 
128  return new AlignableMuon(&(*dtGeometry), &(*cscGeometry));
129 }

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

◆ operator=()

const MuonAlignmentInputDB& MuonAlignmentInputDB::operator= ( const MuonAlignmentInputDB )
privatedelete

Member Data Documentation

◆ idealGeometryLabel

std::string MuonAlignmentInputDB::idealGeometryLabel
private

Definition at line 50 of file MuonAlignmentInputDB.h.

Referenced by newAlignableMuon().

◆ m_cscLabel

std::string MuonAlignmentInputDB::m_cscLabel
private

Definition at line 50 of file MuonAlignmentInputDB.h.

Referenced by newAlignableMuon().

◆ m_dtLabel

std::string MuonAlignmentInputDB::m_dtLabel
private

Definition at line 50 of file MuonAlignmentInputDB.h.

Referenced by newAlignableMuon().

◆ m_getAPEs

bool MuonAlignmentInputDB::m_getAPEs
private

Definition at line 51 of file MuonAlignmentInputDB.h.

Referenced by newAlignableMuon().

DTGeometry
Definition: DTGeometry.h:28
MuonAlignmentInputDB::m_cscLabel
std::string m_cscLabel
Definition: MuonAlignmentInputDB.h:50
mps_fire.i
i
Definition: mps_fire.py:428
MuonAlignmentInputDB::m_getAPEs
bool m_getAPEs
Definition: MuonAlignmentInputDB.h:51
convertSQLitetoXML_cfg.cscLabel
cscLabel
Definition: convertSQLitetoXML_cfg.py:68
GeometryAligner::applyAlignments
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
GlobalPositionRcd
Definition: GlobalPositionRcd.h:6
CSCGeometry
Definition: CSCGeometry.h:24
align::AlignableMuon
Definition: StructureType.h:84
DetId
Definition: DetId.h:17
MuonAlignmentInputDB::idealGeometryLabel
std::string idealGeometryLabel
Definition: MuonAlignmentInputDB.h:50
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
convertSQLitetoXML_cfg.getAPEs
getAPEs
Definition: convertSQLitetoXML_cfg.py:71
DTAlignmentRcd
Definition: DTAlignmentRcd.h:6
convertSQLitetoXML_cfg.dtLabel
dtLabel
Definition: convertSQLitetoXML_cfg.py:67
edm::ESHandle< DTGeometry >
DTAlignmentErrorExtendedRcd
Definition: DTAlignmentErrorExtendedRcd.h:6
CSCAlignmentErrorExtendedRcd
Definition: CSCAlignmentErrorExtendedRcd.h:6
align::DetectorGlobalPosition
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
Definition: DetectorGlobalPosition.cc:10
get
#define get
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
MuonAlignmentInputDB::m_dtLabel
std::string m_dtLabel
Definition: MuonAlignmentInputDB.h:50
AlignTransformErrorExtended
Definition: AlignTransformErrorExtended.h:13
AlignmentErrorsExtended::m_alignError
std::vector< AlignTransformErrorExtended > m_alignError
Definition: AlignmentErrorsExtended.h:19
DetId::Muon
Definition: DetId.h:26
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
CSCAlignmentRcd
Definition: CSCAlignmentRcd.h:6
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33