CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual AlignableMuonnewAlignableMuon (const edm::EventSetup &iSetup) const
 
virtual ~MuonAlignmentInputSurveyDB ()
 
- 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 &)
 
const MuonAlignmentInputSurveyDBoperator= (const MuonAlignmentInputSurveyDB &)
 

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 ( )
virtual

Definition at line 47 of file MuonAlignmentInputSurveyDB.cc.

47 {}
MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB ( const MuonAlignmentInputSurveyDB )
private

Member Function Documentation

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

Definition at line 103 of file MuonAlignmentInputSurveyDB.cc.

References Alignable::alignableObjectId(), AlCaHLTBitMon_QueryRunRegistry::comp, Alignable::components(), relativeConstraints::error, Exception, Alignable::geomDetId(), 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().

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

Reimplemented from MuonAlignmentInputMethod.

Definition at line 65 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.

65  {
66  std::shared_ptr<DTGeometry> dtGeometry = idealDTGeometry(iSetup);
67  std::shared_ptr<CSCGeometry> cscGeometry = idealCSCGeometry(iSetup);
68 
70  edm::ESHandle<SurveyErrors> dtSurveyError;
71  edm::ESHandle<Alignments> cscSurvey;
72  edm::ESHandle<SurveyErrors> cscSurveyError;
73  iSetup.get<DTSurveyRcd>().get(m_dtLabel, dtSurvey);
74  iSetup.get<DTSurveyErrorExtendedRcd>().get(m_dtLabel, dtSurveyError);
75  iSetup.get<CSCSurveyRcd>().get(m_cscLabel, cscSurvey);
76  iSetup.get<CSCSurveyErrorExtendedRcd>().get(m_cscLabel, cscSurveyError);
77 
78  AlignableMuon *output = new AlignableMuon(&(*dtGeometry), &(*cscGeometry));
79 
80  unsigned int theSurveyIndex = 0;
81  const Alignments *theSurveyValues = &*dtSurvey;
82  const SurveyErrors *theSurveyErrors = &*dtSurveyError;
83  std::vector<Alignable*> barrels = output->DTBarrel();
84  for (std::vector<Alignable*>::const_iterator iter = barrels.begin(); iter != barrels.end(); ++iter) {
85  addSurveyInfo_(*iter, &theSurveyIndex, theSurveyValues, theSurveyErrors);
86  }
87 
88  theSurveyIndex = 0;
89  theSurveyValues = &*cscSurvey;
90  theSurveyErrors = &*cscSurveyError;
91  std::vector<Alignable*> endcaps = output->CSCEndcaps();
92  for (std::vector<Alignable*>::const_iterator iter = endcaps.begin(); iter != endcaps.end(); ++iter) {
93  addSurveyInfo_(*iter, &theSurveyIndex, theSurveyValues, theSurveyErrors);
94  }
95 
96  return output;
97 }
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()
const T & get() const
Definition: EventSetup.h:56
Constructor of the full muon geometry.
Definition: AlignableMuon.h:37
const MuonAlignmentInputSurveyDB& MuonAlignmentInputSurveyDB::operator= ( const MuonAlignmentInputSurveyDB )
private

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().