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 
21 
22  theValues.m_align.reserve(65536);
23  theErrors.m_surveyErrors.reserve(65536);
24 
26 
28 
29  if (poolDbService.isAvailable()) {
30  poolDbService->writeOneIOV<SurveyValues>(theValues, poolDbService->currentTime(), theValueRcd);
31  poolDbService->writeOneIOV<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 
SurveyValues * theValues
void getSurveyInfo(const Alignable *)
Get survey info of an alignable in the detector.
const align::ErrorMatrix & errors() const
Definition: SurveyDet.h:62
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
SurveyErrors * theErrors
const align::RotationType & rotation() const
Definition: SurveyDet.h:60
const SurveyDet * survey() const
Return survey info.
Definition: Alignable.h:216
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Definition: value.py:1
const align::PositionType & position() const
Definition: SurveyDet.h:58
static Alignable * detector()
Get alignable detector as read from input.
virtual const Alignables & components() const =0
Return vector of all direct components.
void endJob() override
Upload to DB.
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:180
std::string theErrorExtendedRcd
SurveyDBUploader(const edm::ParameterSet &)
Set value & error tag names for survey records.
bool isAvailable() const
Definition: Service.h:40
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:22
std::string theValueRcd