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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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

◆ 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) {}

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.

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 }

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 o2olib.O2ORunMgr::executeJob().

◆ 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.

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 }

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

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

TkRotation< Scalar >
AlCaHLTBitMon_QueryRunRegistry.comp
string comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
mps_fire.i
i
Definition: mps_fire.py:428
SurveyDet::errors
const align::ErrorMatrix & errors() const
Definition: SurveyDet.h:62
pos
Definition: PixelAliasList.h:18
SurveyDBUploader::theErrorExtendedRcd
std::string theErrorExtendedRcd
Definition: SurveyDBUploader.h:45
SurveyDet::position
const align::PositionType & position() const
Definition: SurveyDet.h:58
SurveyDBUploader::SurveyValue
AlignTransform SurveyValue
Definition: SurveyDBUploader.h:28
relativeConstraints.error
error
Definition: relativeConstraints.py:53
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
SurveyErrors
Definition: SurveyErrors.h:19
SurveyDBUploader::SurveyValues
Alignments SurveyValues
Definition: SurveyDBUploader.h:29
SurveyDet
Definition: SurveyDet.h:15
Alignable::alignableObjectId
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
Point3DBase< Scalar, GlobalTag >
SurveyDBUploader::theValueRcd
std::string theValueRcd
Definition: SurveyDBUploader.h:44
SurveyDet::rotation
const align::RotationType & rotation() const
Definition: SurveyDet.h:60
SurveyDBUploader::theValues
SurveyValues * theValues
Definition: SurveyDBUploader.h:47
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition: looper.py:296
SurveyDBUploader::getSurveyInfo
void getSurveyInfo(const Alignable *)
Get survey info of an alignable in the detector.
Definition: SurveyDBUploader.cc:36
SurveyDBUploader::theErrors
SurveyErrors * theErrors
Definition: SurveyDBUploader.h:48
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:245
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:63
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
SurveyError
Definition: SurveyError.h:23
Alignments::m_align
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
SurveyErrors::m_surveyErrors
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:22
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
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:217
SurveyInputBase::detector
static Alignable * detector()
Get alignable detector as read from input.
Definition: SurveyInputBase.h:41