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::one::EDAnalyzer<> edm::one::EDAnalyzerBase 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::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 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
 
const edm::ESGetToken< Alignments, TrackerAlignmentRcdaliToken_
 
const edm::ESGetToken< GeometricDet, IdealGeometryRecordgeomDetToken_
 
const edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcdptitpToken_
 
const edm::ESGetToken< PTrackerParameters, PTrackerParametersRcdptpToken_
 
std::string textFileName
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 
SurveyInputTextReader::MapType uIdMap
 

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 SurveyInputBase
static void addComponent (Alignable *)
 
static Alignabledetector ()
 Get alignable detector as read from input. More...
 
- 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)
 
- 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 20 of file SurveyMisalignmentInput.cc.

26  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 54 of file SurveyMisalignmentInput.cc.

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

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 28 of file SurveyMisalignmentInput.cc.

28  {
29  if (theFirstEvent) {
30  //Retrieve tracker topology from geometry
31  const TrackerTopology* const tTopo = &setup.getData(tTopoToken_);
32  const GeometricDet* geom = &setup.getData(geomDetToken_);
33  const PTrackerParameters& ptp = setup.getData(ptpToken_);
34  const PTrackerAdditionalParametersPerDet* ptitp = &setup.getData(ptitpToken_);
36 
38 
39  edm::LogInfo("SurveyMisalignmentInput") << "Starting!";
40  // Retrieve alignment[Error]s from DBase
41  alignments = setup.getHandle(aliToken_);
42 
43  //Get map from textreader
44  SurveyInputTextReader dataReader;
45  dataReader.readFile(textFileName);
46  uIdMap = dataReader.UniqueIdMap();
47 
49 
50  theFirstEvent = false;
51  }
52 }

References SurveyInputBase::addComponent(), addSurveyInfo(), alignments, aliToken_, TrackerGeomBuilderFromGeometricDet::build(), SurveyInputBase::detector(), relativeConstraints::geom, geomDetToken_, ptitpToken_, ptpToken_, SurveyInputTextReader::readFile(), singleTopDQM_cfi::setup, textFileName, SurveyInputBase::theFirstEvent, PbPb_ZMuSkimMuonDPG_cff::tracker, tTopoToken_, uIdMap, and SurveyInputTextReader::UniqueIdMap().

◆ getAlignableSurface()

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

Get alignable surface from misalignments.db.

Definition at line 89 of file SurveyMisalignmentInput.cc.

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

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 39 of file SurveyMisalignmentInput.h.

Referenced by analyze(), and getAlignableSurface().

◆ aliToken_

const edm::ESGetToken<Alignments, TrackerAlignmentRcd> SurveyMisalignmentInput::aliToken_
private

Definition at line 33 of file SurveyMisalignmentInput.h.

Referenced by analyze().

◆ geomDetToken_

const edm::ESGetToken<GeometricDet, IdealGeometryRecord> SurveyMisalignmentInput::geomDetToken_
private

Definition at line 30 of file SurveyMisalignmentInput.h.

Referenced by analyze().

◆ ptitpToken_

Definition at line 32 of file SurveyMisalignmentInput.h.

Referenced by analyze().

◆ ptpToken_

const edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> SurveyMisalignmentInput::ptpToken_
private

Definition at line 31 of file SurveyMisalignmentInput.h.

Referenced by analyze().

◆ textFileName

std::string SurveyMisalignmentInput::textFileName
private

Definition at line 37 of file SurveyMisalignmentInput.h.

Referenced by analyze().

◆ tTopoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SurveyMisalignmentInput::tTopoToken_
private

Definition at line 29 of file SurveyMisalignmentInput.h.

Referenced by analyze().

◆ uIdMap

SurveyInputTextReader::MapType SurveyMisalignmentInput::uIdMap
private

Definition at line 35 of file SurveyMisalignmentInput.h.

Referenced by addSurveyInfo(), and analyze().

TkRotation< Scalar >
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
AlCaHLTBitMon_QueryRunRegistry.comp
string comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
SurveyMisalignmentInput::tTopoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: SurveyMisalignmentInput.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
PTrackerParameters
Definition: PTrackerParameters.h:6
align::Scalars
std::vector< Scalar > Scalars
Definition: Utilities.h:26
SurveyMisalignmentInput::ptitpToken_
const edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd > ptitpToken_
Definition: SurveyMisalignmentInput.h:32
TrackerGeomBuilderFromGeometricDet::build
TrackerGeometry * build(const GeometricDet *gd, const PTrackerAdditionalParametersPerDet *ptitp, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
Definition: TrackerGeomBuilderFromGeometricDet.cc:44
TrackerTopology
Definition: TrackerTopology.h:16
PTrackerAdditionalParametersPerDet
Definition: PTrackerAdditionalParametersPerDet.h:9
SurveyMisalignmentInput::textFileName
std::string textFileName
Definition: SurveyMisalignmentInput.h:37
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
SurveyMisalignmentInput::geomDetToken_
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
Definition: SurveyMisalignmentInput.h:30
align::ErrorMatrix
math::Error< 6 >::type ErrorMatrix
Definition: Definitions.h:37
SurveyMisalignmentInput::uIdMap
SurveyInputTextReader::MapType uIdMap
Definition: SurveyMisalignmentInput.h:35
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
relativeConstraints.error
error
Definition: relativeConstraints.py:53
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
SurveyMisalignmentInput::alignments
edm::ESHandle< Alignments > alignments
Definition: SurveyMisalignmentInput.h:39
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.
AlignableTracker
Definition: AlignableTracker.h:17
SurveyMisalignmentInput::addSurveyInfo
void addSurveyInfo(Alignable *)
Add survey info to an alignable.
Definition: SurveyMisalignmentInput.cc:54
SurveyInputTextReader::readFile
void readFile(const std::string &textFileName)
Read given text file.
Definition: SurveyInputTextReader.cc:11
GeometricDet
Definition: GeometricDet.h:31
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 >
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
SurveyInputTextReader::UniqueIdMap
const MapType & UniqueIdMap() const
Definition: SurveyInputTextReader.h:29
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition: looper.py:296
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
SurveyInputTextReader
Definition: SurveyInputTextReader.h:18
SurveyMisalignmentInput::aliToken_
const edm::ESGetToken< Alignments, TrackerAlignmentRcd > aliToken_
Definition: SurveyMisalignmentInput.h:33
AlignableSurface
Definition: AlignableSurface.h:20
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:206
Alignments::m_align
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
TrackerGeomBuilderFromGeometricDet
Definition: TrackerGeomBuilderFromGeometricDet.h:18
SurveyMisalignmentInput::getAlignableSurface
AlignableSurface getAlignableSurface(align::ID)
Get alignable surface from misalignments.db.
Definition: SurveyMisalignmentInput.cc:89
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
SurveyMisalignmentInput::ptpToken_
const edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > ptpToken_
Definition: SurveyMisalignmentInput.h:31
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