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 //
38 MuonAlignmentInputDB::MuonAlignmentInputDB() : m_dtLabel(""), m_cscLabel(""), m_getAPEs(false) {}
39 
41  : m_dtLabel(dtLabel), m_cscLabel(cscLabel), m_getAPEs(getAPEs) {}
42 
43 // MuonAlignmentInputDB::MuonAlignmentInputDB(const MuonAlignmentInputDB& rhs)
44 // {
45 // // do actual copying here;
46 // }
47 
49 
50 //
51 // assignment operators
52 //
53 // const MuonAlignmentInputDB& MuonAlignmentInputDB::operator=(const MuonAlignmentInputDB& rhs)
54 // {
55 // //An exception safe implementation is
56 // MuonAlignmentInputDB temp(rhs);
57 // swap(rhs);
58 //
59 // return *this;
60 // }
61 
62 //
63 // member functions
64 //
65 
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 }
124 
125 //
126 // const member functions
127 //
128 
129 //
130 // static member functions
131 //
DTGeometry
Definition: DTGeometry.h:28
MuonAlignmentInputDB::m_cscLabel
std::string m_cscLabel
Definition: MuonAlignmentInputDB.h:50
mps_fire.i
i
Definition: mps_fire.py:355
MuonAlignmentInputDB.h
funct::false
false
Definition: Factorize.h:34
MuonAlignmentInputDB::m_getAPEs
bool m_getAPEs
Definition: MuonAlignmentInputDB.h:51
ESHandle.h
DTAlignmentErrorExtendedRcd.h
DetectorGlobalPosition.h
convertSQLitetoXML_cfg.cscLabel
cscLabel
Definition: convertSQLitetoXML_cfg.py:28
GlobalPositionRcd
Definition: GlobalPositionRcd.h:6
MuonAlignmentInputDB::~MuonAlignmentInputDB
~MuonAlignmentInputDB() override
Definition: MuonAlignmentInputDB.cc:48
CSCGeometry
Definition: CSCGeometry.h:24
align::AlignableMuon
Definition: StructureType.h:84
DetId
Definition: DetId.h:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
convertSQLitetoXML_cfg.getAPEs
getAPEs
Definition: convertSQLitetoXML_cfg.py:31
DTAlignmentRcd
Definition: DTAlignmentRcd.h:6
convertSQLitetoXML_cfg.dtLabel
dtLabel
Definition: convertSQLitetoXML_cfg.py:27
CSCAlignmentErrorExtendedRcd.h
MuonAlignmentInputDB::MuonAlignmentInputDB
MuonAlignmentInputDB()
Definition: MuonAlignmentInputDB.cc:38
edm::ESHandle< Alignments >
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:66
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
MuonAlignmentInputMethod::idealDTGeometry
std::shared_ptr< DTGeometry > idealDTGeometry(const edm::EventSetup &iSetup) const
Definition: MuonAlignmentInputMethod.cc:69
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
GeometryAligner::applyAlignments
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
CSCAlignmentRcd
Definition: CSCAlignmentRcd.h:6
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33
CSCAlignmentRcd.h
MuonAlignmentInputMethod::idealCSCGeometry
std::shared_ptr< CSCGeometry > idealCSCGeometry(const edm::EventSetup &iSetup) const
Definition: MuonAlignmentInputMethod.cc:83