CMS 3D CMS Logo

MuonAlignmentInputDB.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: MuonAlignment
4 // Class : MuonAlignmentInputDB
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Jim Pivarski
10 // Created: Thu Mar 6 17:30:46 CST 2008
11 // $Id: MuonAlignmentInputDB.cc,v 1.4 2009/10/07 20:46:39 pivarski Exp $
12 //
13 
14 // system include files
16 
17 // user include files
26 
27 //
28 // constants, enums and typedefs
29 //
30 
31 //
32 // static data member definitions
33 //
34 
35 //
36 // constructors and destructor
37 //
39  : m_dtLabel(""), m_cscLabel(""), idealGeometryLabel("idealForInputDB"), m_getAPEs(false) {}
40 
43  std::string idealLabel,
44  bool getAPEs)
45  : m_dtLabel(dtLabel), m_cscLabel(cscLabel), idealGeometryLabel(idealLabel), m_getAPEs(getAPEs) {}
46 
47 // MuonAlignmentInputDB::MuonAlignmentInputDB(const MuonAlignmentInputDB& rhs)
48 // {
49 // // do actual copying here;
50 // }
51 
53 
54 //
55 // assignment operators
56 //
57 // const MuonAlignmentInputDB& MuonAlignmentInputDB::operator=(const MuonAlignmentInputDB& rhs)
58 // {
59 // //An exception safe implementation is
60 // MuonAlignmentInputDB temp(rhs);
61 // swap(rhs);
62 //
63 // return *this;
64 // }
65 
66 //
67 // member functions
68 //
69 
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 }
130 
131 //
132 // const member functions
133 //
134 
135 //
136 // static member functions
137 //
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.h
funct::false
false
Definition: Factorize.h:29
MuonAlignmentInputDB::m_getAPEs
bool m_getAPEs
Definition: MuonAlignmentInputDB.h:51
ESHandle.h
DTAlignmentErrorExtendedRcd.h
DetectorGlobalPosition.h
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
MuonAlignmentInputDB::~MuonAlignmentInputDB
~MuonAlignmentInputDB() override
Definition: MuonAlignmentInputDB.cc:52
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
CSCAlignmentErrorExtendedRcd.h
MuonAlignmentInputDB::MuonAlignmentInputDB
MuonAlignmentInputDB()
Definition: MuonAlignmentInputDB.cc:38
edm::ESHandle< DTGeometry >
DTAlignmentErrorExtendedRcd
Definition: DTAlignmentErrorExtendedRcd.h:6
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCAlignmentErrorExtendedRcd
Definition: CSCAlignmentErrorExtendedRcd.h:6
align::DetectorGlobalPosition
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
Definition: DetectorGlobalPosition.cc:10
MuonAlignmentInputDB::newAlignableMuon
AlignableMuon * newAlignableMuon(const edm::EventSetup &iSetup) const override
Definition: MuonAlignmentInputDB.cc:70
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
DTAlignmentRcd.h
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
GeometryAligner.h
MuonAlignmentInputDB::m_dtLabel
std::string m_dtLabel
Definition: MuonAlignmentInputDB.h:50
AlignTransformErrorExtended
Definition: AlignTransformErrorExtended.h:13
Alignments::m_align
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
AlignmentErrorsExtended::m_alignError
std::vector< AlignTransformErrorExtended > m_alignError
Definition: AlignmentErrorsExtended.h:19
DetId::Muon
Definition: DetId.h:26
MuonGeometryRecord.h
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
CSCAlignmentRcd.h