CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
SurveyDBUploader Class Reference

#include <SurveyDBUploader.h>

Inheritance diagram for SurveyDBUploader:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void endJob () override
 Upload to DB. More...
 
 SurveyDBUploader (const edm::ParameterSet &)
 Set value & error tag names for survey records. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef AlignTransform SurveyValue
 
typedef Alignments SurveyValues
 

Private Member Functions

void getSurveyInfo (const Alignable *)
 Get survey info of an alignable in the detector. More...
 

Private Attributes

std::string theErrorExtendedRcd
 
SurveyErrorstheErrors
 
std::string theValueRcd
 
SurveyValuestheValues
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Module for uploading survey info to the DB.

Usage: module uploader = SurveyDBUploader { string valueTag = "TrackerSurveyRcd" string errorTag = "TrackerSurveyErrorExtendedRcd" }

Date
2007/04/09 01:16:13
Revision
1.2
Author
Chung Khim Lae

Definition at line 27 of file SurveyDBUploader.h.

Member Typedef Documentation

Definition at line 28 of file SurveyDBUploader.h.

Definition at line 29 of file SurveyDBUploader.h.

Constructor & Destructor Documentation

SurveyDBUploader::SurveyDBUploader ( const edm::ParameterSet cfg)

Set value & error tag names for survey records.

Definition at line 12 of file SurveyDBUploader.cc.

13  : theValueRcd(cfg.getParameter<std::string>("valueRcd")),
15  theValues(nullptr),
16  theErrors(nullptr) {}
T getParameter(std::string const &) const
SurveyValues * theValues
SurveyErrors * theErrors
std::string theErrorExtendedRcd
std::string theValueRcd

Member Function Documentation

void SurveyDBUploader::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlineoverride

Definition at line 35 of file SurveyDBUploader.h.

References endJob(), and getSurveyInfo().

35 {}
void SurveyDBUploader::endJob ( void  )
overridevirtual

Upload to DB.

Reimplemented from edm::EDAnalyzer.

Definition at line 18 of file SurveyDBUploader.cc.

References cond::service::PoolDBOutputService::currentTime(), SurveyInputBase::detector(), Exception, getSurveyInfo(), edm::Service< T >::isAvailable(), Alignments::m_align, SurveyErrors::m_surveyErrors, theErrorExtendedRcd, theErrors, theValueRcd, theValues, and cond::service::PoolDBOutputService::writeOne().

Referenced by analyze(), and o2olib.O2ORunMgr::executeJob().

18  {
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 }
SurveyValues * theValues
void getSurveyInfo(const Alignable *)
Get survey info of an alignable in the detector.
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
SurveyErrors * theErrors
bool isAvailable() const
Definition: Service.h:40
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
static Alignable * detector()
Get alignable detector as read from input.
std::string theErrorExtendedRcd
Alignments SurveyValues
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:23
std::string theValueRcd
void SurveyDBUploader::getSurveyInfo ( const Alignable ali)
private

Get survey info of an alignable in the detector.

Definition at line 36 of file SurveyDBUploader.cc.

References Alignable::alignableObjectId(), AlCaHLTBitMon_QueryRunRegistry::comp, Alignable::components(), DEFINE_FWK_MODULE, relativeConstraints::error, SurveyDet::errors(), getSurveyInfo(), mps_fire::i, Alignable::id(), Alignments::m_align, SurveyErrors::m_surveyErrors, SurveyDet::position(), makeMuonMisalignmentScenario::rot, SurveyDet::rotation(), Alignable::survey(), theErrors, theValues, relativeConstraints::value, PV3DBase< T, PVType, FrameType >::x(), TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), PV3DBase< T, PVType, FrameType >::y(), TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), PV3DBase< T, PVType, FrameType >::z(), TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

Referenced by analyze(), endJob(), and getSurveyInfo().

36  {
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 }
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
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
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
T z() const
Definition: PV3DBase.h:64
T zy() const
Definition: value.py:1
T yy() const
AlignTransform SurveyValue
T xz() const
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:23
T x() const
Definition: PV3DBase.h:62
T yz() const

Member Data Documentation

std::string SurveyDBUploader::theErrorExtendedRcd
private

Definition at line 45 of file SurveyDBUploader.h.

Referenced by endJob().

SurveyErrors* SurveyDBUploader::theErrors
private

Definition at line 48 of file SurveyDBUploader.h.

Referenced by endJob(), and getSurveyInfo().

std::string SurveyDBUploader::theValueRcd
private

Definition at line 44 of file SurveyDBUploader.h.

Referenced by endJob().

SurveyValues* SurveyDBUploader::theValues
private

Definition at line 47 of file SurveyDBUploader.h.

Referenced by endJob(), and getSurveyInfo().