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)
 
AlignableMuonnewAlignableMuon (const edm::EventSetup &iSetup) const override
 
 ~MuonAlignmentInputSurveyDB () override
 
- Public Member Functions inherited from MuonAlignmentInputMethod
 MuonAlignmentInputMethod ()
 
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 m_cscLabel
 
std::string m_dtLabel
 

Additional Inherited Members

- Protected Member Functions inherited from MuonAlignmentInputMethod
std::shared_ptr< CSCGeometryidealCSCGeometry (const edm::EventSetup &iSetup) const
 
std::shared_ptr< DTGeometryidealDTGeometry (const edm::EventSetup &iSetup) const
 

Detailed Description

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

Usage: <usage>

Definition at line 31 of file MuonAlignmentInputSurveyDB.h.

Constructor & Destructor Documentation

MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB ( )
MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB ( std::string  dtLabel,
std::string  cscLabel 
)
MuonAlignmentInputSurveyDB::~MuonAlignmentInputSurveyDB ( )
override

Definition at line 46 of file MuonAlignmentInputSurveyDB.cc.

46 {}
MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB ( const MuonAlignmentInputSurveyDB )
privatedelete

Member Function Documentation

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

Definition at line 102 of file MuonAlignmentInputSurveyDB.cc.

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

Referenced by newAlignableMuon().

105  {
106  const auto& comp = ali->components();
107 
108  unsigned int nComp = comp.size();
109 
110  for (unsigned int i = 0; i < nComp; ++i)
111  addSurveyInfo_(comp[i], theSurveyIndex, theSurveyValues, theSurveyErrors);
112 
113  const SurveyError& error = theSurveyErrors->m_surveyErrors[*theSurveyIndex];
114 
115  if (ali->geomDetId().rawId() != error.rawId() || ali->alignableObjectId() != error.structureType()) {
116  throw cms::Exception("DatabaseError") << "Error reading survey info from DB. Mismatched id!";
117  }
118 
119  const CLHEP::Hep3Vector& pos = theSurveyValues->m_align[*theSurveyIndex].translation();
120  const CLHEP::HepRotation& rot = theSurveyValues->m_align[*theSurveyIndex].rotation();
121 
122  AlignableSurface surf(
123  align::PositionType(pos.x(), pos.y(), pos.z()),
124  align::RotationType(rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz()));
125 
126  surf.setWidth(ali->surface().width());
127  surf.setLength(ali->surface().length());
128 
129  ali->setSurvey(new SurveyDet(surf, error.matrix()));
130 
131  (*theSurveyIndex)++;
132 }
align::Scalar width() const
ErrorMatrix matrix() const
Definition: SurveyError.h:63
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
virtual const Alignables & components() const =0
Return vector of all direct components.
uint8_t structureType() const
Definition: SurveyError.h:59
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
void addSurveyInfo_(Alignable *ali, unsigned int *theSurveyIndex, const Alignments *theSurveyValues, const SurveyErrors *theSurveyErrors) const
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
align::ID rawId() const
Definition: SurveyError.h:61
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
align::Scalar length() const
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:266
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:22
const DetId & geomDetId() const
Definition: Alignable.h:177
AlignableMuon * MuonAlignmentInputSurveyDB::newAlignableMuon ( const edm::EventSetup iSetup) const
overridevirtual

Reimplemented from MuonAlignmentInputMethod.

Definition at line 64 of file MuonAlignmentInputSurveyDB.cc.

References addSurveyInfo_(), align::AlignableMuon, AlignableMuon::CSCEndcaps(), AlignableMuon::DTBarrel(), edm::EventSetup::get(), MuonAlignmentInputMethod::idealCSCGeometry(), MuonAlignmentInputMethod::idealDTGeometry(), m_cscLabel, m_dtLabel, and convertSQLitetoXML_cfg::output.

64  {
65  std::shared_ptr<DTGeometry> dtGeometry = idealDTGeometry(iSetup);
66  std::shared_ptr<CSCGeometry> cscGeometry = idealCSCGeometry(iSetup);
67 
69  edm::ESHandle<SurveyErrors> dtSurveyError;
70  edm::ESHandle<Alignments> cscSurvey;
71  edm::ESHandle<SurveyErrors> cscSurveyError;
72  iSetup.get<DTSurveyRcd>().get(m_dtLabel, dtSurvey);
73  iSetup.get<DTSurveyErrorExtendedRcd>().get(m_dtLabel, dtSurveyError);
74  iSetup.get<CSCSurveyRcd>().get(m_cscLabel, cscSurvey);
75  iSetup.get<CSCSurveyErrorExtendedRcd>().get(m_cscLabel, cscSurveyError);
76 
77  AlignableMuon* output = new AlignableMuon(&(*dtGeometry), &(*cscGeometry));
78 
79  unsigned int theSurveyIndex = 0;
80  const Alignments* theSurveyValues = &*dtSurvey;
81  const SurveyErrors* theSurveyErrors = &*dtSurveyError;
82  const auto& barrels = output->DTBarrel();
83  for (const auto& iter : barrels) {
84  addSurveyInfo_(iter, &theSurveyIndex, theSurveyValues, theSurveyErrors);
85  }
86 
87  theSurveyIndex = 0;
88  theSurveyValues = &*cscSurvey;
89  theSurveyErrors = &*cscSurveyError;
90  const auto& endcaps = output->CSCEndcaps();
91  for (const auto& iter : endcaps) {
92  addSurveyInfo_(iter, &theSurveyIndex, theSurveyValues, theSurveyErrors);
93  }
94 
95  return output;
96 }
align::Alignables DTBarrel()
std::shared_ptr< DTGeometry > idealDTGeometry(const edm::EventSetup &iSetup) const
void addSurveyInfo_(Alignable *ali, unsigned int *theSurveyIndex, const Alignments *theSurveyValues, const SurveyErrors *theSurveyErrors) const
std::shared_ptr< CSCGeometry > idealCSCGeometry(const edm::EventSetup &iSetup) const
align::Alignables CSCEndcaps()
T get() const
Definition: EventSetup.h:73
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
const MuonAlignmentInputSurveyDB& MuonAlignmentInputSurveyDB::operator= ( const MuonAlignmentInputSurveyDB )
privatedelete

Member Data Documentation

std::string MuonAlignmentInputSurveyDB::m_cscLabel
private

Definition at line 57 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

std::string MuonAlignmentInputSurveyDB::m_dtLabel
private

Definition at line 57 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().