CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SurveyDBUploader.cc
Go to the documentation of this file.
9 
11 
13  theValueRcd( cfg.getParameter<std::string>("valueRcd") ),
14  theErrorRcd( cfg.getParameter<std::string>("errorRcd") ),
15  theValues(0),
16  theErrors(0)
17 {
18 }
19 
21 {
22  theValues = new SurveyValues;
23  theErrors = new SurveyErrors;
24 
25  theValues->m_align.reserve(65536);
26  theErrors->m_surveyErrors.reserve(65536);
27 
29 
31 
32  if( poolDbService.isAvailable() )
33  {
34  poolDbService->writeOne<SurveyValues>
35  (theValues, poolDbService->currentTime(), theValueRcd);
36  poolDbService->writeOne<SurveyErrors>
37  (theErrors, poolDbService->currentTime(), theErrorRcd);
38  }
39  else
40  throw cms::Exception("ConfigError")
41  << "PoolDBOutputService is not available";
42 }
43 
45 {
46  const std::vector<Alignable*>& comp = ali->components();
47 
48  unsigned int nComp = comp.size();
49 
50  for (unsigned int i = 0; i < nComp; ++i) getSurveyInfo(comp[i]);
51 
52  const SurveyDet* survey = ali->survey();
53 
54  const align::PositionType& pos = survey->position();
55  const align::RotationType& rot = survey->rotation();
56 
57  SurveyValue value( CLHEP::Hep3Vector( pos.x(), pos.y(), pos.z() ),
58  CLHEP::HepRotation
59  ( CLHEP::HepRep3x3( rot.xx(), rot.xy(), rot.xz(),
60  rot.yx(), rot.yy(), rot.yz(),
61  rot.zx(), rot.zy(), rot.zz() ) ),
62  ali->id() );
63 
65  ali->id(),
66  survey->errors() );
67 
68  theValues->m_align.push_back(value);
69  theErrors->m_surveyErrors.push_back(error);
70 }
71 
72 // Plug in to framework
73 
75 
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:180
int i
Definition: DBlmapReader.cc:9
SurveyValues * theValues
void getSurveyInfo(const Alignable *)
Get survey info of an alignable in the detector.
virtual void endJob()
Upload to DB.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
const SurveyDet * survey() const
Return survey info.
Definition: Alignable.h:205
T y() const
Definition: PV3DBase.h:63
T yx() const
const align::ErrorMatrix & errors() const
Definition: SurveyDet.h:73
virtual 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
std::string theErrorRcd
T z() const
Definition: PV3DBase.h:64
bool isAvailable() const
Definition: Service.h:46
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
T zy() const
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
static Alignable * detector()
Get alignable detector as read from input.
T yy() const
Alignments SurveyValues
T xz() const
SurveyDBUploader(const edm::ParameterSet &)
Set value &amp; 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