CMS 3D CMS Logo

SurveyMisalignmentInput.cc
Go to the documentation of this file.
7 
10 
13 
16 
18 
20  : textFileName(cfg.getParameter<std::string>("textFileName")) {}
21 
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 }
52 
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 }
87 
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 }
103 
104 // Plug in to framework
105 
107 
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TkRotation< Scalar >
mps_fire.i
i
Definition: mps_fire.py:355
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
align::Scalars
std::vector< Scalar > Scalars
Definition: Utilities.h:26
TrackerTopology
Definition: TrackerTopology.h:16
SurveyMisalignmentInput::SurveyMisalignmentInput
SurveyMisalignmentInput(const edm::ParameterSet &)
Definition: SurveyMisalignmentInput.cc:19
Alignable
Definition: Alignable.h:27
edm::LogInfo
Definition: MessageLogger.h:254
SurveyMisalignmentInput::textFileName
std::string textFileName
Definition: SurveyMisalignmentInput.h:31
Alignments.h
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
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
PTrackerParameters.h
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
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
SurveyMisalignmentInput::alignments
edm::ESHandle< Alignments > alignments
Definition: SurveyMisalignmentInput.h:33
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.
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
edm::ParameterSet
Definition: ParameterSet.h:36
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:57
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
std
Definition: JetResolutionObject.h:76
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:17
SurveyMisalignmentInput::getAlignableSurface
AlignableSurface getAlignableSurface(align::ID)
Get alignable surface from misalignments.db.
Definition: SurveyMisalignmentInput.cc:88
AlignableTracker.h
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
SurveyMisalignmentInput::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Read ideal tracker geometry from DB.
Definition: SurveyMisalignmentInput.cc:22
ParameterSet.h
SurveyDet.h
edm::Event
Definition: Event.h:73
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
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