CMS 3D CMS Logo

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

#include <SurveyMisalignmentInput.h>

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 Read ideal tracker geometry from DB. More...
 
 SurveyMisalignmentInput (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
 
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::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...
 
AlignableSurface getAlignableSurface (align::ID)
 Get alignable surface from misalignments.db. More...
 

Private Attributes

edm::ESHandle< Alignmentsalignments
 
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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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 = 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)
 
- Protected Attributes inherited from SurveyInputBase
bool theFirstEvent
 

Detailed Description

Class to misaligned tracker from DB.

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

Definition at line 21 of file SurveyMisalignmentInput.h.

Constructor & Destructor Documentation

◆ SurveyMisalignmentInput()

SurveyMisalignmentInput::SurveyMisalignmentInput ( const edm::ParameterSet cfg)

Definition at line 19 of file SurveyMisalignmentInput.cc.

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

Member Function Documentation

◆ addSurveyInfo()

void SurveyMisalignmentInput::addSurveyInfo ( Alignable ali)
private

Add survey info to an alignable.

Definition at line 53 of file SurveyMisalignmentInput.cc.

53  {
54  const align::Alignables& comp = ali->components();
55  unsigned int nComp = comp.size();
56  for (unsigned int i = 0; i < nComp; ++i)
58 
59  SurveyInputTextReader::MapType::const_iterator it = uIdMap.find(std::make_pair(ali->id(), ali->alignableObjectId()));
60 
62 
63  if (it != uIdMap.end()) {
64  //survey error values
65  const align::Scalars& parameters = (it)->second;
66  //sets the errors for the hierarchy level
67  double* errorData = error.Array();
68  for (unsigned int i = 0; i < 21; ++i) {
69  errorData[i] = parameters[i + 6];
70  }
71 
72  //because record only needs global value of modules
74  // fill survey values
75  ali->setSurvey(new SurveyDet(getAlignableSurface(ali->id()), error));
76  } else {
77  ali->setSurvey(new SurveyDet(ali->surface(), error));
78  }
79  } else {
80  //fill
81  error = ROOT::Math::SMatrixIdentity();
82  ali->setSurvey(new SurveyDet(ali->surface(), error * (1e-6)));
83  }
84  //std::cout << "UniqueId: " << id.first << ", " << id.second << std::endl;
85  //std::cout << error << std::endl;
86 }

References align::AlignableDetUnit, Alignable::alignableObjectId(), AlCaHLTBitMon_QueryRunRegistry::comp, Alignable::components(), MillePedeFileConverter_cfg::e, relativeConstraints::error, getAlignableSurface(), mps_fire::i, Alignable::id(), edm::second(), Alignable::setSurvey(), Alignable::surface(), and uIdMap.

Referenced by analyze().

◆ analyze()

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

Read ideal tracker geometry from DB.

Implements SurveyInputBase.

Definition at line 22 of file SurveyMisalignmentInput.cc.

22  {
23  if (theFirstEvent) {
24  //Retrieve tracker topology from geometry
26  setup.get<TrackerTopologyRcd>().get(tTopoHandle);
27  const TrackerTopology* const tTopo = tTopoHandle.product();
28 
31 
33  setup.get<PTrackerParametersRcd>().get(ptp);
35 
37 
38  edm::LogInfo("SurveyMisalignmentInput") << "Starting!";
39  // Retrieve alignment[Error]s from DBase
41 
42  //Get map from textreader
43  SurveyInputTextReader dataReader;
44  dataReader.readFile(textFileName);
45  uIdMap = dataReader.UniqueIdMap();
46 
48 
49  theFirstEvent = false;
50  }
51 }

References SurveyInputBase::addComponent(), addSurveyInfo(), alignments, TrackerGeomBuilderFromGeometricDet::build(), SurveyInputBase::detector(), relativeConstraints::geom, get, edm::ESHandle< T >::product(), SurveyInputTextReader::readFile(), singleTopDQM_cfi::setup, textFileName, SurveyInputBase::theFirstEvent, PbPb_ZMuSkimMuonDPG_cff::tracker, uIdMap, and SurveyInputTextReader::UniqueIdMap().

◆ getAlignableSurface()

AlignableSurface SurveyMisalignmentInput::getAlignableSurface ( align::ID  id)
private

Get alignable surface from misalignments.db.

Definition at line 88 of file SurveyMisalignmentInput.cc.

88  {
89  std::vector<AlignTransform>::const_iterator it;
90 
91  for (it = alignments->m_align.begin(); it != alignments->m_align.end(); ++it) {
92  if (id == (*it).rawId()) {
93  align::PositionType position((*it).translation().x(), (*it).translation().y(), (*it).translation().z());
94  CLHEP::HepRotation rot((*it).rotation());
96  rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz());
98  }
99  }
100 
101  return AlignableSurface();
102 }

References alignments, Alignments::m_align, position, makeMuonMisalignmentScenario::rot, and idealTransformation::rotation.

Referenced by addSurveyInfo().

Member Data Documentation

◆ alignments

edm::ESHandle<Alignments> SurveyMisalignmentInput::alignments
private

Definition at line 33 of file SurveyMisalignmentInput.h.

Referenced by analyze(), and getAlignableSurface().

◆ textFileName

std::string SurveyMisalignmentInput::textFileName
private

Definition at line 31 of file SurveyMisalignmentInput.h.

Referenced by analyze().

◆ uIdMap

SurveyInputTextReader::MapType SurveyMisalignmentInput::uIdMap
private

Definition at line 29 of file SurveyMisalignmentInput.h.

Referenced by addSurveyInfo(), and analyze().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TkRotation< Scalar >
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
mps_fire.i
i
Definition: mps_fire.py:428
SurveyInputBase::addComponent
static void addComponent(Alignable *)
Definition: SurveyInputBase.cc:13
SurveyInputBase::theFirstEvent
bool theFirstEvent
Definition: SurveyInputBase.h:35
align::Scalars
std::vector< Scalar > Scalars
Definition: Utilities.h:26
TrackerTopology
Definition: TrackerTopology.h:16
SurveyMisalignmentInput::textFileName
std::string textFileName
Definition: SurveyMisalignmentInput.h:31
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
align::ErrorMatrix
math::Error< 6 >::type ErrorMatrix
Definition: Definitions.h:37
TrackerGeomBuilderFromGeometricDet::build
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
Definition: TrackerGeomBuilderFromGeometricDet.cc:43
TrackerAlignmentRcd
Definition: TrackerAlignmentRcd.h:6
SurveyMisalignmentInput::uIdMap
SurveyInputTextReader::MapType uIdMap
Definition: SurveyMisalignmentInput.h:29
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
relativeConstraints.error
error
Definition: relativeConstraints.py:53
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
PTrackerParametersRcd
Definition: PTrackerParametersRcd.h:9
SurveyMisalignmentInput::alignments
edm::ESHandle< Alignments > alignments
Definition: SurveyMisalignmentInput.h:33
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
SurveyMisalignmentInput::addSurveyInfo
void addSurveyInfo(Alignable *)
Add survey info to an alignable.
Definition: SurveyMisalignmentInput.cc:53
SurveyInputTextReader::readFile
void readFile(const std::string &textFileName)
Read given text file.
Definition: SurveyInputTextReader.cc:11
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Alignable::surface
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
Point3DBase< Scalar, GlobalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
align::AlignableDetUnit
Definition: StructureType.h:19
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
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
get
#define get
SurveyInputTextReader::UniqueIdMap
const MapType & UniqueIdMap() const
Definition: SurveyInputTextReader.h:29
looper.cfg
cfg
Definition: looper.py:297
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
SurveyInputTextReader
Definition: SurveyInputTextReader.h:18
AlignableSurface
Definition: AlignableSurface.h:20
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Alignments::m_align
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
TrackerGeomBuilderFromGeometricDet
Definition: TrackerGeomBuilderFromGeometricDet.h:17
SurveyMisalignmentInput::getAlignableSurface
AlignableSurface getAlignableSurface(align::ID)
Get alignable surface from misalignments.db.
Definition: SurveyMisalignmentInput.cc:88
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
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