CMS 3D CMS Logo

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

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

Inheritance diagram for MuonAlignmentInputSurveyDB:
MuonAlignmentInputMethod

Public Member Functions

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

Private Member Functions

void addSurveyInfo_ (Alignable *ali, unsigned int *theSurveyIndex, const Alignments *theSurveyValues, const SurveyErrors *theSurveyErrors) const
 
 MuonAlignmentInputSurveyDB (const MuonAlignmentInputSurveyDB &)=delete
 
const MuonAlignmentInputSurveyDBoperator= (const MuonAlignmentInputSurveyDB &)=delete
 

Private Attributes

std::string idealGeometryLabel
 
std::string m_cscLabel
 
std::string m_dtLabel
 

Detailed Description

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

Usage: <usage>

Definition at line 31 of file MuonAlignmentInputSurveyDB.h.

Constructor & Destructor Documentation

◆ MuonAlignmentInputSurveyDB() [1/3]

MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB ( )

Definition at line 37 of file MuonAlignmentInputSurveyDB.cc.

38  : m_dtLabel(""), m_cscLabel(""), idealGeometryLabel("idealForInputSurveyDB") {}

◆ MuonAlignmentInputSurveyDB() [2/3]

MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB ( std::string  dtLabel,
std::string  cscLabel,
std::string  idealLabel 
)

Definition at line 40 of file MuonAlignmentInputSurveyDB.cc.

◆ ~MuonAlignmentInputSurveyDB()

MuonAlignmentInputSurveyDB::~MuonAlignmentInputSurveyDB ( )
override

Definition at line 50 of file MuonAlignmentInputSurveyDB.cc.

50 {}

◆ MuonAlignmentInputSurveyDB() [3/3]

MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB ( const MuonAlignmentInputSurveyDB )
privatedelete

Member Function Documentation

◆ addSurveyInfo_()

void MuonAlignmentInputSurveyDB::addSurveyInfo_ ( Alignable ali,
unsigned int *  theSurveyIndex,
const Alignments theSurveyValues,
const SurveyErrors theSurveyErrors 
) const
private

Definition at line 108 of file MuonAlignmentInputSurveyDB.cc.

111  {
112  const auto& comp = ali->components();
113 
114  unsigned int nComp = comp.size();
115 
116  for (unsigned int i = 0; i < nComp; ++i)
117  addSurveyInfo_(comp[i], theSurveyIndex, theSurveyValues, theSurveyErrors);
118 
119  const SurveyError& error = theSurveyErrors->m_surveyErrors[*theSurveyIndex];
120 
121  if (ali->geomDetId().rawId() != error.rawId() || ali->alignableObjectId() != error.structureType()) {
122  throw cms::Exception("DatabaseError") << "Error reading survey info from DB. Mismatched id!";
123  }
124 
125  const CLHEP::Hep3Vector& pos = theSurveyValues->m_align[*theSurveyIndex].translation();
126  const CLHEP::HepRotation& rot = theSurveyValues->m_align[*theSurveyIndex].rotation();
127 
128  AlignableSurface surf(
129  align::PositionType(pos.x(), pos.y(), pos.z()),
130  align::RotationType(rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz()));
131 
132  surf.setWidth(ali->surface().width());
133  surf.setLength(ali->surface().length());
134 
135  ali->setSurvey(new SurveyDet(surf, error.matrix()));
136 
137  (*theSurveyIndex)++;
138 }

References Alignable::alignableObjectId(), AlCaHLTBitMon_QueryRunRegistry::comp, Alignable::components(), relativeConstraints::error, Exception, Alignable::geomDetId(), mps_fire::i, AlignableSurface::length(), Alignments::m_align, SurveyErrors::m_surveyErrors, DetId::rawId(), makeMuonMisalignmentScenario::rot, AlignableSurface::setLength(), Alignable::setSurvey(), AlignableSurface::setWidth(), Alignable::surface(), and AlignableSurface::width().

Referenced by newAlignableMuon().

◆ newAlignableMuon()

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

Reimplemented from MuonAlignmentInputMethod.

Definition at line 68 of file MuonAlignmentInputSurveyDB.cc.

68  {
69  edm::ESHandle<DTGeometry> dtGeometry;
70  edm::ESHandle<CSCGeometry> cscGeometry;
71  iSetup.get<MuonGeometryRecord>().get(idealGeometryLabel, dtGeometry);
72  iSetup.get<MuonGeometryRecord>().get(idealGeometryLabel, cscGeometry);
73 
75  edm::ESHandle<SurveyErrors> dtSurveyError;
76  edm::ESHandle<Alignments> cscSurvey;
77  edm::ESHandle<SurveyErrors> cscSurveyError;
78  iSetup.get<DTSurveyRcd>().get(m_dtLabel, dtSurvey);
79  iSetup.get<DTSurveyErrorExtendedRcd>().get(m_dtLabel, dtSurveyError);
80  iSetup.get<CSCSurveyRcd>().get(m_cscLabel, cscSurvey);
81  iSetup.get<CSCSurveyErrorExtendedRcd>().get(m_cscLabel, cscSurveyError);
82 
83  AlignableMuon* output = new AlignableMuon(&(*dtGeometry), &(*cscGeometry));
84 
85  unsigned int theSurveyIndex = 0;
86  const Alignments* theSurveyValues = &*dtSurvey;
87  const SurveyErrors* theSurveyErrors = &*dtSurveyError;
88  const auto& barrels = output->DTBarrel();
89  for (const auto& iter : barrels) {
90  addSurveyInfo_(iter, &theSurveyIndex, theSurveyValues, theSurveyErrors);
91  }
92 
93  theSurveyIndex = 0;
94  theSurveyValues = &*cscSurvey;
95  theSurveyErrors = &*cscSurveyError;
96  const auto& endcaps = output->CSCEndcaps();
97  for (const auto& iter : endcaps) {
98  addSurveyInfo_(iter, &theSurveyIndex, theSurveyValues, theSurveyErrors);
99  }
100 
101  return output;
102 }

References addSurveyInfo_(), align::AlignableMuon, edm::EventSetup::get(), get, idealGeometryLabel, m_cscLabel, m_dtLabel, and convertSQLitetoXML_cfg::output.

◆ operator=()

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

Member Data Documentation

◆ idealGeometryLabel

std::string MuonAlignmentInputSurveyDB::idealGeometryLabel
private

Definition at line 57 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

◆ m_cscLabel

std::string MuonAlignmentInputSurveyDB::m_cscLabel
private

Definition at line 57 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

◆ m_dtLabel

std::string MuonAlignmentInputSurveyDB::m_dtLabel
private

Definition at line 57 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

TkRotation< Scalar >
mps_fire.i
i
Definition: mps_fire.py:428
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
MuonAlignmentInputSurveyDB::m_dtLabel
std::string m_dtLabel
Definition: MuonAlignmentInputSurveyDB.h:57
pos
Definition: PixelAliasList.h:18
CSCSurveyRcd
Definition: CSCSurveyRcd.h:15
convertSQLitetoXML_cfg.cscLabel
cscLabel
Definition: convertSQLitetoXML_cfg.py:68
AlignableSurface::length
align::Scalar length() const
Definition: AlignableSurface.h:32
relativeConstraints.error
error
Definition: relativeConstraints.py:53
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
SurveyErrors
Definition: SurveyErrors.h:19
SurveyDet
Definition: SurveyDet.h:15
align::AlignableMuon
Definition: StructureType.h:84
Alignable::setSurvey
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:266
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
convertSQLitetoXML_cfg.dtLabel
dtLabel
Definition: convertSQLitetoXML_cfg.py:67
Alignable::alignableObjectId
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
edm::ESHandle< DTGeometry >
Alignable::surface
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
Point3DBase< Scalar, GlobalTag >
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
Alignable::geomDetId
const DetId & geomDetId() const
Definition: Alignable.h:177
DTSurveyRcd
Definition: DTSurveyRcd.h:15
get
#define get
MuonAlignmentInputSurveyDB::addSurveyInfo_
void addSurveyInfo_(Alignable *ali, unsigned int *theSurveyIndex, const Alignments *theSurveyValues, const SurveyErrors *theSurveyErrors) const
Definition: MuonAlignmentInputSurveyDB.cc:108
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
AlignableSurface
Definition: AlignableSurface.h:20
DTSurveyErrorExtendedRcd
Definition: DTSurveyErrorExtendedRcd.h:15
AlignableSurface::width
align::Scalar width() const
Definition: AlignableSurface.h:30
CSCSurveyErrorExtendedRcd
Definition: CSCSurveyErrorExtendedRcd.h:15
Exception
Definition: hltDiff.cc:246
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
MuonAlignmentInputSurveyDB::m_cscLabel
std::string m_cscLabel
Definition: MuonAlignmentInputSurveyDB.h:57
SurveyError
Definition: SurveyError.h:23
Alignments::m_align
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
MuonAlignmentInputSurveyDB::idealGeometryLabel
std::string idealGeometryLabel
Definition: MuonAlignmentInputSurveyDB.h:57
SurveyErrors::m_surveyErrors
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:22
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
Alignments
Definition: Alignments.h:10
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34