CMS 3D CMS Logo

SurveyMisalignmentInput.cc
Go to the documentation of this file.
8 
11 
14 
17 
19 
21  : tTopoToken_(esConsumes()),
22  geomDetToken_(esConsumes()),
23  ptpToken_(esConsumes()),
24  ptitpToken_(esConsumes()),
25  aliToken_(esConsumes()),
26  textFileName(cfg.getParameter<std::string>("textFileName")) {}
27 
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 }
53 
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 }
88 
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 }
104 
105 // Plug in to framework
106 
108 
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
MessageLogger.h
SurveyInputBase::addComponent
static void addComponent(Alignable *)
Definition: SurveyInputBase.cc:13
SurveyInputBase::theFirstEvent
bool theFirstEvent
Definition: SurveyInputBase.h:35
SurveyMisalignmentInput
Definition: SurveyMisalignmentInput.h:21
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
SurveyMisalignmentInput::SurveyMisalignmentInput
SurveyMisalignmentInput(const edm::ParameterSet &)
Definition: SurveyMisalignmentInput.cc:20
Alignable
Definition: Alignable.h:27
PTrackerAdditionalParametersPerDet
Definition: PTrackerAdditionalParametersPerDet.h:9
SurveyMisalignmentInput::textFileName
std::string textFileName
Definition: SurveyMisalignmentInput.h:37
Alignments.h
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
PTrackerAdditionalParametersPerDetRcd.h
SurveyMisalignmentInput::uIdMap
SurveyInputTextReader::MapType uIdMap
Definition: SurveyMisalignmentInput.h:35
PTrackerParameters.h
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
SurveyMisalignmentInput.h
MakerMacros.h
Alignable::setSurvey
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:266
TrackerTopologyRcd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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
edm::ParameterSet
Definition: ParameterSet.h:47
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
align::ID
uint32_t ID
Definition: Definitions.h:24
Alignable::id
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
Definition: Alignable.h:180
PTrackerParametersRcd.h
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
IdealGeometryRecord.h
TrackerAlignmentRcd.h
edm::EventSetup
Definition: EventSetup.h:58
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
std
Definition: JetResolutionObject.h:76
SurveyMisalignmentInput::aliToken_
const edm::ESGetToken< Alignments, TrackerAlignmentRcd > aliToken_
Definition: SurveyMisalignmentInput.h:33
AlignableSurface
Definition: AlignableSurface.h:20
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
EventSetup.h
TrackerGeomBuilderFromGeometricDet.h
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
AlignableTracker.h
SurveyMisalignmentInput::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Read ideal tracker geometry from DB.
Definition: SurveyMisalignmentInput.cc:28
ParameterSet.h
SurveyDet.h
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
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