CMS 3D CMS Logo

SurveyDBUploader.cc
Go to the documentation of this file.
9 
11 
13  : theValueRcd(cfg.getParameter<std::string>("valueRcd")),
14  theErrorExtendedRcd(cfg.getParameter<std::string>("errorRcd")),
15  theValues(nullptr),
16  theErrors(nullptr) {}
17 
19  theValues = new SurveyValues;
20  theErrors = new SurveyErrors;
21 
22  theValues->m_align.reserve(65536);
23  theErrors->m_surveyErrors.reserve(65536);
24 
26 
28 
29  if (poolDbService.isAvailable()) {
30  poolDbService->writeOne<SurveyValues>(theValues, poolDbService->currentTime(), theValueRcd);
31  poolDbService->writeOne<SurveyErrors>(theErrors, poolDbService->currentTime(), theErrorExtendedRcd);
32  } else
33  throw cms::Exception("ConfigError") << "PoolDBOutputService is not available";
34 }
35 
37  const auto& comp = ali->components();
38 
39  unsigned int nComp = comp.size();
40 
41  for (unsigned int i = 0; i < nComp; ++i)
43 
44  const SurveyDet* survey = ali->survey();
45 
46  const align::PositionType& pos = survey->position();
47  const align::RotationType& rot = survey->rotation();
48 
49  SurveyValue value(CLHEP::Hep3Vector(pos.x(), pos.y(), pos.z()),
50  CLHEP::HepRotation(CLHEP::HepRep3x3(
51  rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz())),
52  ali->id());
53 
54  SurveyError error(ali->alignableObjectId(), ali->id(), survey->errors());
55 
56  theValues->m_align.push_back(value);
57  theErrors->m_surveyErrors.push_back(error);
58 }
59 
60 // Plug in to framework
61 
63 
T xx() const
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:189
SurveyValues * theValues
void getSurveyInfo(const Alignable *)
Get survey info of an alignable in the detector.
const SurveyDet * survey() const
Return survey info.
Definition: Alignable.h:225
#define nullptr
T y() const
Definition: PV3DBase.h:63
T yx() const
const align::ErrorMatrix & errors() const
Definition: SurveyDet.h:73
virtual const Alignables & components() const =0
Return vector of all direct components.
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
const align::RotationType & rotation() const
Definition: SurveyDet.h:68
T zx() const
T xy() const
const align::PositionType & position() const
Definition: SurveyDet.h:63
SurveyErrors * theErrors
T zz() const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
T z() const
Definition: PV3DBase.h:64
bool isAvailable() const
Definition: Service.h:40
T zy() const
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
Definition: value.py:1
static Alignable * detector()
Get alignable detector as read from input.
T yy() const
void endJob() override
Upload to DB.
std::string theErrorExtendedRcd
Alignments SurveyValues
T xz() const
SurveyDBUploader(const edm::ParameterSet &)
Set value & error tag names for survey records.
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:23
T x() const
Definition: PV3DBase.h:62
std::string theValueRcd
T yz() const