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 (const DTGeometry *dtGeometry, const CSCGeometry *cscGeometry, const GEMGeometry *gemGeometry, const Alignments *dtSurvey, const Alignments *cscSurvey, const SurveyErrors *dtSurveyError, const SurveyErrors *cscSurveyError)
 
 MuonAlignmentInputSurveyDB (const MuonAlignmentInputSurveyDB &)=delete
 
AlignableMuonnewAlignableMuon () const override
 
const MuonAlignmentInputSurveyDBoperator= (const MuonAlignmentInputSurveyDB &)=delete
 
 ~MuonAlignmentInputSurveyDB () override
 
- Public Member Functions inherited from MuonAlignmentInputMethod
 MuonAlignmentInputMethod ()
 
 MuonAlignmentInputMethod (const DTGeometry *dtGeometry, const CSCGeometry *cscGeometry, const GEMGeometry *gemGeometry)
 
 MuonAlignmentInputMethod (const MuonAlignmentInputMethod &)=delete
 
const MuonAlignmentInputMethodoperator= (const MuonAlignmentInputMethod &)=delete
 
virtual ~MuonAlignmentInputMethod ()
 

Private Member Functions

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

Private Attributes

const CSCGeometrycscGeometry_
 
const AlignmentscscSurvey_
 
const SurveyErrorscscSurveyError_
 
const DTGeometrydtGeometry_
 
const AlignmentsdtSurvey_
 
const SurveyErrorsdtSurveyError_
 
const GEMGeometrygemGeometry_
 

Detailed Description

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

Usage: <usage>

Definition at line 31 of file MuonAlignmentInputSurveyDB.h.

Constructor & Destructor Documentation

◆ MuonAlignmentInputSurveyDB() [1/2]

MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB ( const DTGeometry dtGeometry,
const CSCGeometry cscGeometry,
const GEMGeometry gemGeometry,
const Alignments dtSurvey,
const Alignments cscSurvey,
const SurveyErrors dtSurveyError,
const SurveyErrors cscSurveyError 
)

Definition at line 37 of file MuonAlignmentInputSurveyDB.cc.

44  : dtGeometry_(dtGeometry),
45  cscGeometry_(cscGeometry),
47  dtSurvey_(dtSurvey),
48  cscSurvey_(cscSurvey),
49  dtSurveyError_(dtSurveyError),
50  cscSurveyError_(cscSurveyError) {}

◆ ~MuonAlignmentInputSurveyDB()

MuonAlignmentInputSurveyDB::~MuonAlignmentInputSurveyDB ( )
override

Definition at line 57 of file MuonAlignmentInputSurveyDB.cc.

57 {}

◆ MuonAlignmentInputSurveyDB() [2/2]

MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB ( const MuonAlignmentInputSurveyDB )
delete

Member Function Documentation

◆ addSurveyInfo_()

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

Definition at line 101 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, DetId::rawId(), makeMuonMisalignmentScenario::rot, AlignableSurface::setLength(), Alignable::setSurvey(), AlignableSurface::setWidth(), Alignable::surface(), and AlignableSurface::width().

Referenced by newAlignableMuon().

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

◆ newAlignableMuon()

AlignableMuon * MuonAlignmentInputSurveyDB::newAlignableMuon ( ) const
overridevirtual

Reimplemented from MuonAlignmentInputMethod.

Definition at line 75 of file MuonAlignmentInputSurveyDB.cc.

References addSurveyInfo_(), align::AlignableMuon, cscGeometry_, cscSurvey_, cscSurveyError_, dtGeometry_, dtSurvey_, dtSurveyError_, gemGeometry_, and convertSQLitetoXML_cfg::output.

75  {
77 
78  unsigned int theSurveyIndex = 0;
79  const Alignments* theSurveyValues = dtSurvey_;
80  const SurveyErrors* theSurveyErrors = dtSurveyError_;
81  const auto& barrels = output->DTBarrel();
82  for (const auto& iter : barrels) {
83  addSurveyInfo_(iter, &theSurveyIndex, theSurveyValues, theSurveyErrors);
84  }
85 
86  theSurveyIndex = 0;
87  theSurveyValues = cscSurvey_;
88  theSurveyErrors = cscSurveyError_;
89  const auto& endcaps = output->CSCEndcaps();
90  for (const auto& iter : endcaps) {
91  addSurveyInfo_(iter, &theSurveyIndex, theSurveyValues, theSurveyErrors);
92  }
93 
94  return output;
95 }
void addSurveyInfo_(Alignable *ali, unsigned int *theSurveyIndex, const Alignments *theSurveyValues, const SurveyErrors *theSurveyErrors) const
Definition: output.py:1
Constructor of the full muon geometry.
Definition: AlignableMuon.h:38

◆ operator=()

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

Member Data Documentation

◆ cscGeometry_

const CSCGeometry* MuonAlignmentInputSurveyDB::cscGeometry_
private

Definition at line 62 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

◆ cscSurvey_

const Alignments* MuonAlignmentInputSurveyDB::cscSurvey_
private

Definition at line 65 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

◆ cscSurveyError_

const SurveyErrors* MuonAlignmentInputSurveyDB::cscSurveyError_
private

Definition at line 67 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

◆ dtGeometry_

const DTGeometry* MuonAlignmentInputSurveyDB::dtGeometry_
private

Definition at line 61 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

◆ dtSurvey_

const Alignments* MuonAlignmentInputSurveyDB::dtSurvey_
private

Definition at line 64 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

◆ dtSurveyError_

const SurveyErrors* MuonAlignmentInputSurveyDB::dtSurveyError_
private

Definition at line 66 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().

◆ gemGeometry_

const GEMGeometry* MuonAlignmentInputSurveyDB::gemGeometry_
private

Definition at line 63 of file MuonAlignmentInputSurveyDB.h.

Referenced by newAlignableMuon().