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::one::EDAnalyzer<> edm::one::EDAnalyzerBase 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::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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

◆ SurveyValue

Definition at line 28 of file SurveyDBUploader.h.

◆ SurveyValues

Definition at line 29 of file SurveyDBUploader.h.

Constructor & Destructor Documentation

◆ SurveyDBUploader()

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")),
14  theErrorExtendedRcd(cfg.getParameter<std::string>("errorRcd")),
15  theValues(nullptr),
16  theErrors(nullptr) {}
SurveyValues * theValues
SurveyErrors * theErrors
std::string theErrorExtendedRcd
std::string theValueRcd

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 35 of file SurveyDBUploader.h.

35 {}

◆ endJob()

void SurveyDBUploader::endJob ( void  )
overridevirtual

Upload to DB.

Reimplemented from edm::one::EDAnalyzerBase.

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::writeOneIOV().

Referenced by o2olib.O2ORunMgr::executeJob().

18  {
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 }
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
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
static Alignable * detector()
Get alignable detector as read from input.
std::string theErrorExtendedRcd
Alignments SurveyValues
bool isAvailable() const
Definition: Service.h:40
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:22
std::string theValueRcd

◆ getSurveyInfo()

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(), 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, and relativeConstraints::value.

Referenced by 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 }
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.
Definition: value.py:1
const align::PositionType & position() const
Definition: SurveyDet.h:58
virtual const Alignables & components() const =0
Return vector of all direct components.
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:180
AlignTransform SurveyValue
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:22

Member Data Documentation

◆ theErrorExtendedRcd

std::string SurveyDBUploader::theErrorExtendedRcd
private

Definition at line 45 of file SurveyDBUploader.h.

Referenced by endJob().

◆ theErrors

SurveyErrors* SurveyDBUploader::theErrors
private

Definition at line 48 of file SurveyDBUploader.h.

Referenced by endJob(), and getSurveyInfo().

◆ theValueRcd

std::string SurveyDBUploader::theValueRcd
private

Definition at line 44 of file SurveyDBUploader.h.

Referenced by endJob().

◆ theValues

SurveyValues* SurveyDBUploader::theValues
private

Definition at line 47 of file SurveyDBUploader.h.

Referenced by endJob(), and getSurveyInfo().