CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes
CocoaDBMgr Class Reference

#include <CocoaDBMgr.h>

Public Member Functions

bool DumpCocoaResults ()
 
 ~CocoaDBMgr ()
 

Static Public Member Functions

static CocoaDBMgrgetInstance ()
 

Private Member Functions

std::pair< std::unique_ptr
< Alignments >
, std::unique_ptr
< AlignmentErrorsExtended > > 
BuildAlignments (bool bDT)
 
std::unique_ptr
< OpticalAlignments
BuildOpticalAlignments ()
 
 CocoaDBMgr ()
 
AlignTransformErrorExtendedGetAlignInfoErrorFromOptO (OpticalObject *opto)
 
AlignTransformGetAlignInfoFromOptO (OpticalObject *opto)
 
double GetEntryError (const Entry *entry)
 
double GetEntryError (const Entry *entry1, const Entry *entry2)
 
OpticalAlignInfo GetOptAlignInfoFromOptO (OpticalObject *opto)
 

Static Private Attributes

static CocoaDBMgrinstance = nullptr
 

Detailed Description

Definition at line 36 of file CocoaDBMgr.h.

Constructor & Destructor Documentation

CocoaDBMgr::CocoaDBMgr ( )
private

Definition at line 46 of file CocoaDBMgr.cc.

Referenced by getInstance().

46 {}
CocoaDBMgr::~CocoaDBMgr ( )
inline

Definition at line 43 of file CocoaDBMgr.h.

43 {}

Member Function Documentation

std::pair< std::unique_ptr< Alignments >, std::unique_ptr< AlignmentErrorsExtended > > CocoaDBMgr::BuildAlignments ( bool  bDT)
private

Definition at line 284 of file CocoaDBMgr.cc.

References gather_cfg::cout, ALIUtils::debug, GetAlignInfoErrorFromOptO(), GetAlignInfoFromOptO(), eostools::move(), and Model::OptOList().

Referenced by DumpCocoaResults().

284  {
285  std::unique_ptr<Alignments> alignments = std::make_unique<Alignments>();
286  std::unique_ptr<AlignmentErrorsExtended> alignmentErrors = std::make_unique<AlignmentErrorsExtended>();
287 
288  //read
289  static std::vector<OpticalObject*> optolist = Model::OptOList();
290  static std::vector<OpticalObject*>::const_iterator ite;
291  for (ite = optolist.begin(); ite != optolist.end(); ++ite) {
292  if ((*ite)->type() == "system")
293  continue;
294  std::cout << "CocoaDBMgr::BuildAlignments getCmsswID " << (*ite) << std::endl;
295  std::cout << "CocoaDBMgr::BuildAlignments getCmsswID " << (*ite)->getCmsswID() << std::endl;
296  //check CMSSW ID
297  if ((*ite)->getCmsswID() > 0) { //put the numbers of DT or CSC objects
298  std::cout << " cal fill alignments " << std::endl;
299  alignments->m_align.push_back(*(GetAlignInfoFromOptO(*ite)));
300  std::cout << " fill alignments " << std::endl;
301  // AlignTransformErrorExtended* err =
302  //GetAlignInfoErrorFromOptO( *ite );
303  alignmentErrors->m_alignError.push_back(*(GetAlignInfoErrorFromOptO(*ite)));
304  std::cout << "CocoaDBMgr::BuildAlignments add alignmentError " << alignmentErrors->m_alignError.size()
305  << std::endl;
306  }
307  }
308 
309  if (ALIUtils::debug >= 4)
310  std::cout << "CocoaDBMgr::BuildAlignments end with n alignment " << alignments->m_align.size()
311  << " n alignmentError " << alignmentErrors->m_alignError.size() << std::endl;
312 
313  return std::make_pair(std::move(alignments), std::move(alignmentErrors));
314 }
AlignTransformErrorExtended * GetAlignInfoErrorFromOptO(OpticalObject *opto)
Definition: CocoaDBMgr.cc:335
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:84
static ALIint debug
Definition: ALIUtils.h:34
def move
Definition: eostools.py:511
AlignTransform * GetAlignInfoFromOptO(OpticalObject *opto)
Definition: CocoaDBMgr.cc:317
tuple cout
Definition: gather_cfg.py:144
std::unique_ptr< OpticalAlignments > CocoaDBMgr::BuildOpticalAlignments ( )
private

Definition at line 266 of file CocoaDBMgr.cc.

References gather_cfg::cout, data, ALIUtils::debug, GetOptAlignInfoFromOptO(), and Model::OptOList().

Referenced by DumpCocoaResults().

266  {
267  std::unique_ptr<OpticalAlignments> optalign = std::make_unique<OpticalAlignments>();
268 
269  static std::vector<OpticalObject*> optolist = Model::OptOList();
270  static std::vector<OpticalObject*>::const_iterator ite;
271  for (ite = optolist.begin(); ite != optolist.end(); ++ite) {
272  if ((*ite)->type() == "system")
273  continue;
275  optalign->opticalAlignments_.push_back(data);
276  if (ALIUtils::debug >= 5) {
277  std::cout << "@@@@ OPTALIGNINFO TO BE WRITTEN TO DB " << data << std::endl;
278  }
279  }
280  return optalign;
281 }
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:84
static ALIint debug
Definition: ALIUtils.h:34
OpticalAlignInfo GetOptAlignInfoFromOptO(OpticalObject *opto)
Definition: CocoaDBMgr.cc:151
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
tuple cout
Definition: gather_cfg.py:144
bool CocoaDBMgr::DumpCocoaResults ( )

Definition at line 49 of file CocoaDBMgr.cc.

References cond::service::PoolDBOutputService::appendOneIOV(), cond::service::PoolDBOutputService::beginOfTime(), BuildAlignments(), BuildOpticalAlignments(), gather_cfg::cout, cond::service::PoolDBOutputService::createOneIOV(), cond::service::PoolDBOutputService::currentTime(), ALIUtils::debug, cond::service::PoolDBOutputService::endOfTime(), Exception, GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), Fit::nEvent, and TRUE.

Referenced by Fit::startFit().

49  {
51 
53  int nrcd;
54 
55  cond::Time_t appendTime = Fit::nEvent + 1;
56  if (gomgr->GlobalOptions()["writeDBOptAlign"] > 0) {
57  //----- Build OpticalAlignments
58  std::unique_ptr<OpticalAlignments> optalign = BuildOpticalAlignments();
59 
60  //--- Dump OpticalAlignments
61  nrcd = optalign->opticalAlignments_.size();
62  if (!myDbService.isAvailable()) {
63  throw cms::Exception("CocoaDBMgr::DumpCocoaResults DB not available");
64  }
65  // try{
66  if (myDbService->isNewTagRequest("OpticalAlignmentsRcd")) {
67  std::cout << " new OA to DB "
68  << "begin " << myDbService->beginOfTime() << " current " << myDbService->currentTime() << " end "
69  << myDbService->endOfTime() << std::endl;
70  myDbService->createOneIOV<OpticalAlignments>(*optalign, myDbService->beginOfTime(), "OpticalAlignmentsRcd");
71  } else {
72  std::cout << " old OA to DB "
73  << " current " << myDbService->currentTime() << " end " << myDbService->endOfTime() << std::endl;
74  myDbService->appendOneIOV<OpticalAlignments>(*optalign, appendTime, "OpticalAlignmentsRcd");
75  }
76 
77  /* }catch(const cond::Exception& er) {
78  std::cout<<er.what()<<std::endl;
79  }catch(const std::exception& er){
80  std::cout<<"caught std::exception "<<er.what()<<std::endl;
81  }catch(...){
82  std::cout<<"Funny error"<<std::endl;
83  } */
84 
85  if (ALIUtils::debug >= 2)
86  std::cout << "OpticalAlignmentsRcd WRITTEN TO DB : " << nrcd << std::endl;
87  }
88 
89  if (gomgr->GlobalOptions()["writeDBAlign"] > 0) {
90  // Build DT alignments and errors
91  const auto& dtali = BuildAlignments(true);
92  auto& dt_Alignments = dtali.first;
93  auto& dt_AlignmentErrors = dtali.second;
94 
95  // Dump DT alignments and errors
96  nrcd = dt_Alignments->m_align.size();
97  if (myDbService->isNewTagRequest("DTAlignmentRcd")) {
98  myDbService->createOneIOV<Alignments>(*dt_Alignments, myDbService->beginOfTime(), "DTAlignmentRcd");
99  } else {
100  myDbService->appendOneIOV<Alignments>(*dt_Alignments, appendTime, "DTAlignmentRcd");
101  }
102  if (ALIUtils::debug >= 2)
103  std::cout << "DTAlignmentRcd WRITTEN TO DB : " << nrcd << std::endl;
104 
105  nrcd = dt_AlignmentErrors->m_alignError.size();
106  if (myDbService->isNewTagRequest("DTAlignmentErrorExtendedRcd")) {
108  *dt_AlignmentErrors, myDbService->beginOfTime(), "DTAlignmentErrorExtendedRcd");
109  } else {
111  *dt_AlignmentErrors, appendTime, "DTAlignmentErrorExtendedRcd");
112  }
113  if (ALIUtils::debug >= 2)
114  std::cout << "DTAlignmentErrorExtendedRcd WRITTEN TO DB : " << nrcd << std::endl;
115 
116  // Build CSC alignments and errors
117  const auto& cscali = BuildAlignments(false);
118  auto& csc_Alignments = cscali.first;
119  auto& csc_AlignmentErrors = cscali.second;
120 
121  // Dump CSC alignments and errors
122  nrcd = csc_Alignments->m_align.size();
123  if (myDbService->isNewTagRequest("CSCAlignmentRcd")) {
124  myDbService->createOneIOV<Alignments>(*csc_Alignments, myDbService->beginOfTime(), "CSCAlignmentRcd");
125  } else {
126  myDbService->appendOneIOV<Alignments>(*csc_Alignments, appendTime, "CSCAlignmentRcd");
127  }
128  if (ALIUtils::debug >= 2)
129  std::cout << "CSCAlignmentRcd WRITTEN TO DB : " << nrcd << std::endl;
130 
131  nrcd = csc_AlignmentErrors->m_alignError.size();
132  if (myDbService->isNewTagRequest("CSCAlignmentErrorExtendedRcd")) {
134  *csc_AlignmentErrors, myDbService->beginOfTime(), "CSCAlignmentErrorExtendedRcd");
135  } else {
137  *csc_AlignmentErrors, appendTime, "CSCAlignmentErrorExtendedRcd");
138  }
139  if (ALIUtils::debug >= 2)
140  std::cout << "CSCAlignmentErrorExtendedRcd WRITTEN TO DB : " << nrcd << std::endl;
141 
142  //? gives unreadable error??? std::cout << "@@@@ OPTICALALIGNMENTS WRITTEN TO DB " << *optalign << std::endl;
143 
144  return TRUE;
145  }
146 
147  return TRUE;
148 }
#define TRUE
Definition: scimark2.h:12
static ALIint debug
Definition: ALIUtils.h:34
static GlobalOptionMgr * getInstance()
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
unsigned long long Time_t
Definition: Time.h:14
std::unique_ptr< OpticalAlignments > BuildOpticalAlignments()
Definition: CocoaDBMgr.cc:266
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:40
static ALIuint nEvent
Definition: Fit.h:208
std::pair< std::unique_ptr< Alignments >, std::unique_ptr< AlignmentErrorsExtended > > BuildAlignments(bool bDT)
Definition: CocoaDBMgr.cc:284
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
tuple cout
Definition: gather_cfg.py:144
AlignTransformErrorExtended * CocoaDBMgr::GetAlignInfoErrorFromOptO ( OpticalObject opto)
private

Definition at line 335 of file CocoaDBMgr.cc.

References asHepMatrix(), OpticalObject::CoordinateEntryList(), gather_cfg::cout, ALIUtils::debug, OpticalObject::getCmsswID(), GetEntryError(), visualization-live-secondInstance_cfg::m, GlobalErrorBase< T, ErrorWeightType >::matrix(), and OpticalObject::name().

Referenced by BuildAlignments().

335  {
336  if (ALIUtils::debug >= 3)
337  std::cout << "@@@ CocoaDBMgr::GetAlignInfoErrorFromOptO " << opto->name() << std::endl;
338 
339  align::ID cmsswID = opto->getCmsswID();
340 
341  GlobalError gerr(1., 0., 1., 0., 0., 1.);
342  //double(dx*dx), 0., double(dy*dy), 0., 0., double(dz*dz) ) ;
343  CLHEP::HepSymMatrix errms = asHepMatrix(gerr.matrix());
344  AlignTransformErrorExtended* alignError = new AlignTransformErrorExtended(errms, cmsswID);
345  return alignError;
346 
347  CLHEP::HepMatrix errm(3, 3);
348  const std::vector<Entry*>& theCoordinateEntryVector = opto->CoordinateEntryList();
349  std::cout << "@@@ CocoaDBMgr::GetAlignInfoFromOptOfill errm " << opto->name() << std::endl;
350  errm(0, 0) = GetEntryError(theCoordinateEntryVector[0]) * dd4hep::m; // m in COCOA, dd4hep unit in DB
351  errm(1, 1) = GetEntryError(theCoordinateEntryVector[1]) * dd4hep::m; // m in COCOA, dd4hep unit in DB
352  errm(2, 2) = GetEntryError(theCoordinateEntryVector[2]) * dd4hep::m; // m in COCOA, dd4hep unit in DB
353  errm(0, 1) = GetEntryError(theCoordinateEntryVector[0], theCoordinateEntryVector[1]) *
354  dd4hep::m; // m in COCOA, dd4hep unit in DB
355  errm(0, 2) = GetEntryError(theCoordinateEntryVector[0], theCoordinateEntryVector[2]) *
356  dd4hep::m; // m in COCOA, dd4hep unit in DB
357  errm(1, 2) = GetEntryError(theCoordinateEntryVector[1], theCoordinateEntryVector[2]) *
358  dd4hep::m; // m in COCOA, dd4hep unit in DB
359  // errm(1,0) = errm(0,1);
360  // errm(2,0) = errm(0,2);
361  // errm(2,1) = errm(1,2);
362 
363  std::cout << "@@@ CocoaDBMgr::GetAlignInfoFromOptO errm filled" << opto->name() << std::endl;
364  // CLHEP::HepSymMatrix errms(3);
365  // errms.assign(errm);
366 
367  std::cout << "@@@ CocoaDBMgr::GetAlignInfoFromOptO errms filled " << opto->name() << std::endl;
368  // AlignTransformErrorExtended* alignError = new AlignTransformErrorExtended( errms, cmsswID );
369  // AlignTransformErrorExtended* alignError = 0;
370 
371  std::cout << alignError << "@@@ CocoaDBMgr::GetAlignInfoFromOptO error built " << opto->name() << std::endl;
372  //t return alignError;
373  return (AlignTransformErrorExtended*)nullptr;
374 }
const ALIuint getCmsswID() const
Definition: OpticalObject.h:97
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:60
uint32_t ID
Definition: Definitions.h:24
static ALIint debug
Definition: ALIUtils.h:34
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:63
double GetEntryError(const Entry *entry)
Definition: CocoaDBMgr.cc:245
tuple cout
Definition: gather_cfg.py:144
const ALIstring & name() const
Definition: OpticalObject.h:58
AlignTransform * CocoaDBMgr::GetAlignInfoFromOptO ( OpticalObject opto)
private

Definition at line 317 of file CocoaDBMgr.cc.

References OpticalObject::centreGlob(), gather_cfg::cout, ALIUtils::debug, OpticalObject::getCmsswID(), OpticalObject::name(), OpticalObject::rmGlob(), and makeMuonMisalignmentScenario::rot.

Referenced by BuildAlignments().

317  {
318  if (ALIUtils::debug >= 3)
319  std::cout << "@@@ CocoaDBMgr::GetAlignInfoFromOptO " << opto->name() << std::endl;
320 
321  const AlignTransform::Translation& trans = opto->centreGlob();
322  const AlignTransform::Rotation& rot = opto->rmGlob();
323  align::ID cmsswID = opto->getCmsswID();
324 
325  std::cout << "@@@ CocoaDBMgr::GetAlignInfoFromOptO buildalign" << opto->name() << std::endl;
326  AlignTransform* align = new AlignTransform(trans, rot, cmsswID);
327 
328  std::cout << "@@@ CocoaDBMgr::GetAlignInfoFromOptO alig built " << opto->name() << std::endl;
329 
330  return align;
331  // return dd;
332 }
const ALIuint getCmsswID() const
Definition: OpticalObject.h:97
uint32_t ID
Definition: Definitions.h:24
CLHEP::Hep3Vector Translation
static ALIint debug
Definition: ALIUtils.h:34
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
tuple cout
Definition: gather_cfg.py:144
const ALIstring & name() const
Definition: OpticalObject.h:58
CLHEP::HepRotation Rotation
double CocoaDBMgr::GetEntryError ( const Entry entry)
private

Definition at line 245 of file CocoaDBMgr.cc.

References Entry::fitPos(), Fit::GetAtWAMatrix(), hlt_dqm_clientPB-live_cfg::me, Entry::quality(), Entry::sigma(), and mathSSE::sqrt().

Referenced by GetAlignInfoErrorFromOptO(), GetEntryError(), and GetOptAlignInfoFromOptO().

245  {
246  if (entry->quality() > 0) {
247  return sqrt(Fit::GetAtWAMatrix()->Mat()->me[entry->fitPos()][entry->fitPos()]);
248  } else { //entry not fitted, return original error
249  return entry->sigma();
250  }
251 }
static ALIMatrix * GetAtWAMatrix()
Definition: Fit.h:152
T sqrt(T t)
Definition: SSEVec.h:19
ALIint fitPos() const
Definition: Entry.h:58
ALIint quality() const
Definition: Entry.h:57
ALIdouble sigma() const
Definition: Entry.h:55
double CocoaDBMgr::GetEntryError ( const Entry entry1,
const Entry entry2 
)
private

Definition at line 254 of file CocoaDBMgr.cc.

References Entry::fitPos(), Fit::GetAtWAMatrix(), GetEntryError(), hlt_dqm_clientPB-live_cfg::me, Entry::quality(), and mathSSE::sqrt().

254  {
255  if (entry1 == entry2)
256  return GetEntryError(entry1);
257 
258  if (entry1->quality() > 0 && entry2->quality() > 0) {
259  return sqrt(Fit::GetAtWAMatrix()->Mat()->me[entry1->fitPos()][entry2->fitPos()]);
260  } else { //entries not fitted, correlation is 0
261  return 0.;
262  }
263 }
static ALIMatrix * GetAtWAMatrix()
Definition: Fit.h:152
T sqrt(T t)
Definition: SSEVec.h:19
double GetEntryError(const Entry *entry)
Definition: CocoaDBMgr.cc:245
ALIint fitPos() const
Definition: Entry.h:58
ALIint quality() const
Definition: Entry.h:57
CocoaDBMgr * CocoaDBMgr::getInstance ( )
static

Definition at line 38 of file CocoaDBMgr.cc.

References CocoaDBMgr(), and instance.

Referenced by Fit::startFit().

38  {
39  if (!instance) {
40  instance = new CocoaDBMgr;
41  }
42  return instance;
43 }
static CocoaDBMgr * instance
Definition: CocoaDBMgr.h:60
OpticalAlignInfo CocoaDBMgr::GetOptAlignInfoFromOptO ( OpticalObject opto)
private

Definition at line 151 of file CocoaDBMgr.cc.

References OpticalAlignInfo::angx_, OpticalAlignInfo::angy_, OpticalAlignInfo::angz_, OpticalObject::centreGlob(), OpticalObject::CoordinateEntryList(), gather_cfg::cout, data, OpticalAlignParam::dim_type_, OpticalAlignParam::error_, OpticalAlignInfo::extraEntries_, OpticalObject::ExtraEntryList(), OpticalObject::getCmsswID(), GetEntryError(), OpticalObject::getLocalRotationAngles(), OpticalAlignInfo::ID_, LogDebug, visualization-live-secondInstance_cfg::m, Entry::name(), OpticalObject::name(), OpticalAlignParam::name_, OpticalAlignInfo::name_, OpticalObject::parent(), Entry::quality(), OpticalAlignParam::quality_, OpticalObject::rmGlob(), Entry::type(), OpticalObject::type(), OpticalAlignInfo::type_, OpticalAlignParam::value_, OpticalAlignInfo::x_, OpticalAlignInfo::y_, and OpticalAlignInfo::z_.

Referenced by BuildOpticalAlignments().

151  {
152  LogDebug("Alignment") << " CocoaDBMgr::GetOptAlignInfoFromOptO " << opto->name();
154  data.ID_ = opto->getCmsswID();
155  data.type_ = opto->type();
156  data.name_ = opto->name();
157 
158  //----- Centre in local coordinates
159  CLHEP::Hep3Vector centreLocal = opto->centreGlob() - opto->parent()->centreGlob();
160  CLHEP::HepRotation parentRmGlobInv = inverseOf(opto->parent()->rmGlob());
161  centreLocal = parentRmGlobInv * centreLocal;
162 
163  const std::vector<Entry*>& theCoordinateEntryVector = opto->CoordinateEntryList();
164  LogDebug("Alignment") << " CocoaDBMgr::GetOptAlignInfoFromOptO starting coord ";
165  if (theCoordinateEntryVector.size() == 6) {
166  const Entry* const translationX = theCoordinateEntryVector.at(0);
167  OpticalAlignParam translationXDataForDB;
168  translationXDataForDB.name_ = translationX->name();
169  translationXDataForDB.dim_type_ = translationX->type();
170  translationXDataForDB.value_ = centreLocal.x() * dd4hep::m; // m in COCOA, dd4hep unit in DB
171  translationXDataForDB.error_ = GetEntryError(translationX) * dd4hep::m; // m in COCOA, dd4hep unit in DB
172  translationXDataForDB.quality_ = translationX->quality();
173  data.x_ = translationXDataForDB;
174 
175  const Entry* const translationY = theCoordinateEntryVector.at(1);
176  OpticalAlignParam translationYDataForDB;
177  translationYDataForDB.name_ = translationY->name();
178  translationYDataForDB.dim_type_ = translationY->type();
179  translationYDataForDB.value_ = centreLocal.y() * dd4hep::m; // m in COCOA, dd4hep unit in DB
180  translationYDataForDB.error_ = GetEntryError(translationY) * dd4hep::m; // m in COCOA, dd4hep unit in DB
181  translationYDataForDB.quality_ = translationY->quality();
182  data.y_ = translationYDataForDB;
183 
184  const Entry* const translationZ = theCoordinateEntryVector.at(2);
185  OpticalAlignParam translationZDataForDB;
186  translationZDataForDB.name_ = translationZ->name();
187  translationZDataForDB.dim_type_ = translationZ->type();
188  translationZDataForDB.value_ = centreLocal.z() * dd4hep::m; // m in COCOA, dd4hep unit in DB
189  translationZDataForDB.error_ = GetEntryError(translationZ) * dd4hep::m; // m in COCOA, dd4hep unit in DB
190  translationZDataForDB.quality_ = translationZ->quality();
191  data.z_ = translationZDataForDB;
192 
193  //----- angles in local coordinates
194  std::vector<double> anglocal = opto->getLocalRotationAngles(theCoordinateEntryVector);
195  if (anglocal.size() == 3) {
196  const Entry* const rotationX = theCoordinateEntryVector.at(3);
197  OpticalAlignParam rotationXDataForDB;
198  rotationXDataForDB.name_ = rotationX->name();
199  rotationXDataForDB.dim_type_ = rotationX->type();
200  rotationXDataForDB.value_ = anglocal.at(0);
201  rotationXDataForDB.error_ = GetEntryError(rotationX);
202  rotationXDataForDB.quality_ = rotationX->quality();
203  data.angx_ = rotationXDataForDB;
204 
205  const Entry* const rotationY = theCoordinateEntryVector.at(4);
206  OpticalAlignParam rotationYDataForDB;
207  rotationYDataForDB.name_ = rotationY->name();
208  rotationYDataForDB.dim_type_ = rotationY->type();
209  rotationYDataForDB.value_ = anglocal.at(1);
210  rotationYDataForDB.error_ = GetEntryError(rotationY);
211  rotationYDataForDB.quality_ = rotationY->quality();
212  data.angy_ = rotationYDataForDB;
213 
214  const Entry* const rotationZ = theCoordinateEntryVector.at(5);
215  OpticalAlignParam rotationZDataForDB;
216  rotationZDataForDB.name_ = rotationZ->name();
217  rotationZDataForDB.dim_type_ = rotationZ->type();
218  rotationZDataForDB.value_ = anglocal.at(2);
219  rotationZDataForDB.error_ = GetEntryError(rotationZ);
220  rotationZDataForDB.quality_ = rotationZ->quality();
221  data.angz_ = rotationZDataForDB;
222  }
223  }
224 
225  std::cout << " CocoaDBMgr::GetOptAlignInfoFromOptO starting entry " << std::endl;
226  for (const auto& myDBExtraEntry : opto->ExtraEntryList()) {
227  OpticalAlignParam extraEntry;
228  extraEntry.name_ = myDBExtraEntry->name();
229  extraEntry.dim_type_ = myDBExtraEntry->type();
230  extraEntry.value_ = myDBExtraEntry->value();
231  extraEntry.error_ = myDBExtraEntry->sigma();
232  if (extraEntry.dim_type_ == "centre" || extraEntry.dim_type_ == "length") {
233  extraEntry.value_ *= dd4hep::m; // m in COCOA, dd4hep unit in DB
234  extraEntry.error_ *= dd4hep::m; // m in COCOA, dd4hep unit in DB
235  }
236  extraEntry.quality_ = myDBExtraEntry->quality();
237  data.extraEntries_.emplace_back(extraEntry);
238  std::cout << " CocoaDBMgr::GetOptAlignInfoFromOptO done extra entry " << extraEntry.name_ << std::endl;
239  }
240 
241  return data;
242 }
const ALIuint getCmsswID() const
Definition: OpticalObject.h:97
const ALIstring & type() const
Definition: Entry.h:52
OpticalAlignParam x_
Definition: Entry.h:18
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:63
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
OpticalAlignParam angx_
std::vector< double > getLocalRotationAngles(const std::vector< Entry * > &entries) const
OpticalAlignParam y_
const OpticalObject * parent() const
Definition: OpticalObject.h:60
double GetEntryError(const Entry *entry)
Definition: CocoaDBMgr.cc:245
OpticalAlignParam angz_
const ALIstring & name() const
Definition: Entry.h:50
OpticalAlignParam z_
std::vector< OpticalAlignParam > extraEntries_
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
OpticalAlignParam angy_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ALIint quality() const
Definition: Entry.h:57
tuple cout
Definition: gather_cfg.py:144
const ALIstring & name() const
Definition: OpticalObject.h:58
std::string dim_type_
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:65
unsigned int ID_
#define LogDebug(id)
const ALIstring & type() const
Definition: OpticalObject.h:59

Member Data Documentation

CocoaDBMgr * CocoaDBMgr::instance = nullptr
staticprivate

Definition at line 60 of file CocoaDBMgr.h.

Referenced by getInstance(), and production_tasks.Task::getname().