CMS 3D CMS Logo

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

#include <SurveyInputTrackerFromDB.h>

Inheritance diagram for SurveyInputTrackerFromDB:
SurveyInputBase edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 Read ideal tracker geometry from DB. More...
 
 SurveyInputTrackerFromDB (const edm::ParameterSet &)
 
- Public Member Functions inherited from SurveyInputBase
void beginJob () override
 Read data from input. More...
 
 ~SurveyInputBase () override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 Member Functions

void addSurveyInfo (Alignable *)
 Add survey info to an alignable. More...
 

Private Attributes

std::string textFileName
 
SurveyInputTextReader::MapType uIdMap
 

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 SurveyInputBase
static void addComponent (Alignable *)
 
static Alignabledetector ()
 Get alignable detector as read from input. More...
 
- 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
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>
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)
 
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)
 
- Protected Attributes inherited from SurveyInputBase
bool theFirstEvent
 

Detailed Description

Class to read ideal tracker from DB.

Date
2012/06/13 09:22:26
Revision
1.4
Author
Chung Khim Lae

Definition at line 20 of file SurveyInputTrackerFromDB.h.

Constructor & Destructor Documentation

◆ SurveyInputTrackerFromDB()

SurveyInputTrackerFromDB::SurveyInputTrackerFromDB ( const edm::ParameterSet cfg)

Definition at line 22 of file SurveyInputTrackerFromDB.cc.

23  : textFileName(cfg.getParameter<std::string>("textFileName")) {}

Member Function Documentation

◆ addSurveyInfo()

void SurveyInputTrackerFromDB::addSurveyInfo ( Alignable ali)
private

Add survey info to an alignable.

Definition at line 67 of file SurveyInputTrackerFromDB.cc.

67  {
68  const align::Alignables& comp = ali->components();
69  unsigned int nComp = comp.size();
70 
71  for (unsigned int i = 0; i < nComp; ++i)
73 
75 
76  SurveyInputTextReader::MapType::const_iterator it = uIdMap.find(std::make_pair(ali->id(), ali->alignableObjectId()));
77 
78  if (it != uIdMap.end()) {
79  const align::Scalars& parameters = (it)->second;
80 
81  //move the surface
82  //displacement
84  align::GlobalVector gvector = ali->surface().toGlobal(lvector);
85  ali->move(gvector);
86  //rotation
88  align::RotationType rotation(rot_aa, rot_aa.mag());
90 
91  //sets the errors for the hierarchy level
92  double* errorData = error.Array();
93  for (unsigned int i = 0; i < 21; ++i) {
94  errorData[i] = parameters[i + 6];
95  }
96 
97  ali->setSurvey(new SurveyDet(ali->surface(), error * (1e-6)));
98  } else {
99  error = ROOT::Math::SMatrixIdentity();
100  ali->setSurvey(new SurveyDet(ali->surface(), error * 1e-6));
101  }
102 }

References Alignable::alignableObjectId(), AlCaHLTBitMon_QueryRunRegistry::comp, Alignable::components(), MillePedeFileConverter_cfg::e, relativeConstraints::error, mps_fire::i, Alignable::id(), Basic3DVector< T >::mag(), Alignable::move(), Alignable::rotateInLocalFrame(), idealTransformation::rotation, edm::second(), Alignable::setSurvey(), Alignable::surface(), AlignableSurface::toGlobal(), and uIdMap.

Referenced by analyze().

◆ analyze()

void SurveyInputTrackerFromDB::analyze ( const edm::Event ,
const edm::EventSetup setup 
)
overridevirtual

Read ideal tracker geometry from DB.

Implements SurveyInputBase.

Definition at line 25 of file SurveyInputTrackerFromDB.cc.

25  {
26  if (theFirstEvent) {
27  // std::cout << "***************ENTERING INITIALIZATION******************" << std::endl;
28 
29  //Retrieve tracker topology from geometry
31  setup.get<TrackerTopologyRcd>().get(tTopoHandle);
32  const TrackerTopology* const tTopo = tTopoHandle.product();
33 
34  //Get map from textreader
35  SurveyInputTextReader dataReader;
36  dataReader.readFile(textFileName);
37  uIdMap = dataReader.UniqueIdMap();
38 
42  setup.get<PTrackerParametersRcd>().get(ptp);
44 
47 
48  //write out to a DB ...
49  Alignments* myAlignments = detector()->alignments();
50  AlignmentErrorsExtended* myAlignmentErrorsExtended = detector()->alignmentErrors();
51 
52  // 2. Store alignment[Error]s to DB
54  // Call service
55 
56  if (!poolDbService.isAvailable()) // Die if not available
57  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
58 
59  poolDbService->writeOne<Alignments>(myAlignments, poolDbService->beginOfTime(), "TrackerAlignmentRcd");
60  poolDbService->writeOne<AlignmentErrorsExtended>(
61  myAlignmentErrorsExtended, poolDbService->beginOfTime(), "TrackerAlignmentErrorExtendedRcd");
62 
63  theFirstEvent = false;
64  }
65 }

References SurveyInputBase::addComponent(), addSurveyInfo(), Alignable::alignmentErrors(), Alignable::alignments(), cond::service::PoolDBOutputService::beginOfTime(), TrackerGeomBuilderFromGeometricDet::build(), SurveyInputBase::detector(), relativeConstraints::geom, get, edm::Service< T >::isAvailable(), edm::ESHandle< T >::product(), SurveyInputTextReader::readFile(), singleTopDQM_cfi::setup, textFileName, SurveyInputBase::theFirstEvent, PbPb_ZMuSkimMuonDPG_cff::tracker, uIdMap, SurveyInputTextReader::UniqueIdMap(), and cond::service::PoolDBOutputService::writeOne().

Member Data Documentation

◆ textFileName

std::string SurveyInputTrackerFromDB::textFileName
private

Definition at line 30 of file SurveyInputTrackerFromDB.h.

Referenced by analyze().

◆ uIdMap

SurveyInputTextReader::MapType SurveyInputTrackerFromDB::uIdMap
private

Definition at line 28 of file SurveyInputTrackerFromDB.h.

Referenced by addSurveyInfo(), and analyze().

Vector3DBase
Definition: Vector3DBase.h:8
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TkRotation< Scalar >
mps_fire.i
i
Definition: mps_fire.py:355
SurveyInputBase::addComponent
static void addComponent(Alignable *)
Definition: SurveyInputBase.cc:13
SurveyInputBase::theFirstEvent
bool theFirstEvent
Definition: SurveyInputBase.h:35
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:187
align::Scalars
std::vector< Scalar > Scalars
Definition: Utilities.h:26
TrackerTopology
Definition: TrackerTopology.h:16
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
align::ErrorMatrix
math::Error< 6 >::type ErrorMatrix
Definition: Definitions.h:37
Alignable::alignments
virtual Alignments * alignments() const =0
Return vector of alignment data.
TrackerGeomBuilderFromGeometricDet::build
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
Definition: TrackerGeomBuilderFromGeometricDet.cc:43
relativeConstraints.error
error
Definition: relativeConstraints.py:53
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
PTrackerParametersRcd
Definition: PTrackerParametersRcd.h:9
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
SurveyDet
Definition: SurveyDet.h:15
Alignable::setSurvey
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:266
Alignable::alignableObjectId
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
edm::ESHandle< TrackerTopology >
AlignableTracker
Definition: AlignableTracker.h:17
SurveyInputTextReader::readFile
void readFile(const std::string &textFileName)
Read given text file.
Definition: SurveyInputTextReader.cc:11
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
AlignableSurface::toGlobal
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
Definition: AlignableSurface.cc:15
Alignable::surface
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
SurveyInputTrackerFromDB::uIdMap
SurveyInputTextReader::MapType uIdMap
Definition: SurveyInputTrackerFromDB.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
Alignable::id
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
Definition: Alignable.h:180
SurveyInputTrackerFromDB::textFileName
std::string textFileName
Definition: SurveyInputTrackerFromDB.h:30
Alignable::rotateInLocalFrame
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
Definition: Alignable.cc:129
edm::Service< cond::service::PoolDBOutputService >
get
#define get
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
SurveyInputTextReader::UniqueIdMap
const MapType & UniqueIdMap() const
Definition: SurveyInputTextReader.h:29
Alignable::move
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
looper.cfg
cfg
Definition: looper.py:297
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
SurveyInputTextReader
Definition: SurveyInputTextReader.h:18
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:57
Alignable::alignmentErrors
virtual AlignmentErrorsExtended * alignmentErrors() const =0
Return vector of alignment errors.
SurveyInputTrackerFromDB::addSurveyInfo
void addSurveyInfo(Alignable *)
Add survey info to an alignable.
Definition: SurveyInputTrackerFromDB.cc:67
TrackerGeomBuilderFromGeometricDet
Definition: TrackerGeomBuilderFromGeometricDet.h:17
cms::Exception
Definition: Exception.h:70
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
Alignments
Definition: Alignments.h:10
Basic3DVector< align::Scalar >
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
SurveyInputBase::detector
static Alignable * detector()
Get alignable detector as read from input.
Definition: SurveyInputBase.h:41
TrackerGeometry
Definition: TrackerGeometry.h:14