CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void endJob ()
 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 ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 &)
 
- 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 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 30 of file SurveyDBUploader.h.

Definition at line 31 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.

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

Member Function Documentation

virtual void SurveyDBUploader::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlinevirtual

Implements edm::EDAnalyzer.

Definition at line 40 of file SurveyDBUploader.h.

43  {}
void SurveyDBUploader::endJob ( void  )
virtual

Upload to DB.

Reimplemented from edm::EDAnalyzer.

Definition at line 20 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 o2o.O2ORunMgr::executeJob().

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(), theErrorExtendedRcd);
38  }
39  else
40  throw cms::Exception("ConfigError")
41  << "PoolDBOutputService is not available";
42 }
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:46
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 44 of file SurveyDBUploader.cc.

References Alignable::alignableObjectId(), AlCaHLTBitMon_QueryRunRegistry::comp, Alignable::components(), relativeConstraints::error, SurveyDet::errors(), 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 endJob().

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 }
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:185
int i
Definition: DBlmapReader.cc:9
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:210
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
T z() const
Definition: PV3DBase.h:64
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
T zy() const
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 56 of file SurveyDBUploader.h.

Referenced by endJob().

SurveyErrors* SurveyDBUploader::theErrors
private

Definition at line 59 of file SurveyDBUploader.h.

Referenced by endJob(), and getSurveyInfo().

std::string SurveyDBUploader::theValueRcd
private

Definition at line 55 of file SurveyDBUploader.h.

Referenced by endJob().

SurveyValues* SurveyDBUploader::theValues
private

Definition at line 58 of file SurveyDBUploader.h.

Referenced by endJob(), and getSurveyInfo().