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 
TkRotation< Scalar >
mps_fire.i
i
Definition: mps_fire.py:355
SurveyErrors.h
SurveyDet::errors
const align::ErrorMatrix & errors() const
Definition: SurveyDet.h:62
Alignable
Definition: Alignable.h:27
pos
Definition: PixelAliasList.h:18
SurveyDBUploader::theErrorExtendedRcd
std::string theErrorExtendedRcd
Definition: SurveyDBUploader.h:45
Alignments.h
SurveyDet::position
const align::PositionType & position() const
Definition: SurveyDet.h:58
relativeConstraints.error
error
Definition: relativeConstraints.py:53
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
SurveyErrors
Definition: SurveyErrors.h:19
SurveyDBUploader::SurveyValues
Alignments SurveyValues
Definition: SurveyDBUploader.h:29
SurveyDet
Definition: SurveyDet.h:15
MakerMacros.h
PoolDBOutputService.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
SurveyDBUploader::SurveyDBUploader
SurveyDBUploader(const edm::ParameterSet &)
Set value & error tag names for survey records.
Definition: SurveyDBUploader.cc:12
Alignable::alignableObjectId
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
Service.h
Point3DBase< Scalar, GlobalTag >
SurveyDBUploader::theValueRcd
std::string theValueRcd
Definition: SurveyDBUploader.h:44
SurveyDet::rotation
const align::RotationType & rotation() const
Definition: SurveyDet.h:60
AlignTransform
Definition: AlignTransform.h:15
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SurveyDBUploader::theValues
SurveyValues * theValues
Definition: SurveyDBUploader.h:47
edm::ParameterSet
Definition: ParameterSet.h:36
Alignable::id
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
Definition: Alignable.h:180
edm::Service< cond::service::PoolDBOutputService >
value
Definition: value.py:1
looper.cfg
cfg
Definition: looper.py:297
SurveyDBUploader::getSurveyInfo
void getSurveyInfo(const Alignable *)
Get survey info of an alignable in the detector.
Definition: SurveyDBUploader.cc:36
std
Definition: JetResolutionObject.h:76
SurveyDBUploader::theErrors
SurveyErrors * theErrors
Definition: SurveyDBUploader.h:48
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:246
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:56
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Alignable.h
SurveyError
Definition: SurveyError.h:23
Alignments::m_align
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
SurveyDBUploader
Definition: SurveyDBUploader.h:27
ParameterSet.h
SurveyDet.h
SurveyErrors::m_surveyErrors
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:22
SurveyDBUploader.h
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
SurveyInputBase.h
SurveyDBUploader::endJob
void endJob() override
Upload to DB.
Definition: SurveyDBUploader.cc:18
Alignments
Definition: Alignments.h:10
Alignable::survey
const SurveyDet * survey() const
Return survey info.
Definition: Alignable.h:216
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:179
SurveyInputBase::detector
static Alignable * detector()
Get alignable detector as read from input.
Definition: SurveyInputBase.h:41