CMS 3D CMS Logo

AlignableExtras.cc
Go to the documentation of this file.
1 
12 
13 // Alignment
15 
18 
20 
21 //__________________________________________________________________________________________________
23  align::Alignables& alis = alignableLists_.get("BeamSpot");
24  alis.push_back(new AlignableBeamSpot());
25  components_.push_back(alis.back());
26 }
27 
28 //__________________________________________________________________________________________________
29 void AlignableExtras::dump(void) const {
30  Alignables comp = this->components();
31 
32  // Dump this
33  edm::LogInfo("AlignableDump") << " AlignableExtras knows " << comp.size() << " alignable(s)" << std::endl;
34 
35  // Dump components
36  for (Alignables::iterator i = comp.begin(); i != comp.end(); ++i)
37  (*i)->dump();
38 }
39 
40 //__________________________________________________________________________________________________
43  Alignments* m_alignments = new Alignments();
44  // Add components recursively
45  for (align::Alignables::iterator i = comp.begin(); i != comp.end(); ++i) {
46  Alignments* tmpAlignments = (*i)->alignments();
47  std::copy(tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(), std::back_inserter(m_alignments->m_align));
48  delete tmpAlignments;
49  }
50 
51  // sort by rawId
52  std::sort(m_alignments->m_align.begin(), m_alignments->m_align.end());
53 
54  return m_alignments;
55 }
56 
57 //__________________________________________________________________________________________________
60  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
61 
62  // Add components recursively
63  for (align::Alignables::iterator i = comp.begin(); i != comp.end(); ++i) {
64  AlignmentErrorsExtended* tmpAlignmentErrorsExtended = (*i)->alignmentErrors();
65  std::copy(tmpAlignmentErrorsExtended->m_alignError.begin(),
66  tmpAlignmentErrorsExtended->m_alignError.end(),
67  std::back_inserter(m_alignmentErrors->m_alignError));
68  delete tmpAlignmentErrorsExtended;
69  }
70 
71  // sort by rawId
72  std::sort(m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end());
73 
74  return m_alignmentErrors;
75 }
76 
77 //______________________________________________________________________________
78 void AlignableExtras::initializeBeamSpot(double x, double y, double z, double dxdz, double dydz) {
79  align::Alignables& alis = beamSpot();
80  AlignableBeamSpot* aliBS = dynamic_cast<AlignableBeamSpot*>(alis.back());
81  if (aliBS) {
82  aliBS->initialize(x, y, z, dxdz, dydz);
83  } else {
84  edm::LogError("AlignableExtras") << " AlignableBeamSpot not available. Cannot initialize!" << std::endl;
85  }
86 }
87 
88 //______________________________________________________________________________
90  align::Alignables& alis = beamSpot();
91  AlignableBeamSpot* aliBS = dynamic_cast<AlignableBeamSpot*>(alis.back());
92  if (aliBS) {
93  aliBS->reset();
94  } else {
95  edm::LogWarning("AlignableExtras") << "@SUB=AlignableExtras::resetBeamSpot"
96  << "AlignableBeamSpot not available. Cannot reset!" << std::endl;
97  }
98 }
AlignmentErrorsExtended.h
DDAxes::y
BeamSpotFakeParameters_cfi.dxdz
dxdz
Definition: BeamSpotFakeParameters_cfi.py:12
mps_fire.i
i
Definition: mps_fire.py:355
AlignableBeamSpot.h
AlignableBeamSpot::reset
void reset()
reset beam spot to the uninitialized state
Definition: AlignableBeamSpot.cc:151
MessageLogger.h
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
edm::LogInfo
Definition: MessageLogger.h:254
AlignableExtras.h
Alignments.h
AlignableExtras::resetBeamSpot
void resetBeamSpot()
Initialize the alignable beam spot with the given parameters.
Definition: AlignableExtras.cc:89
DDAxes::x
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
AlignableExtras::alignments
Alignments * alignments() const
Return alignments, sorted by DetId.
Definition: AlignableExtras.cc:41
AlignableExtras::components
const Alignables & components() const
Definition: AlignableExtras.h:32
AlignableExtras::components_
Alignables components_
Definition: AlignableExtras.h:50
vertices_cff.x
x
Definition: vertices_cff.py:29
DDAxes::z
AlignableExtras::initializeBeamSpot
void initializeBeamSpot(double x, double y, double z, double dxdz, double dydz)
Initialize the alignable beam spot with the given parameters.
Definition: AlignableExtras.cc:78
edm::LogWarning
Definition: MessageLogger.h:141
edm::LogError
Definition: MessageLogger.h:183
AlignableBeamSpot
Definition: AlignableBeamSpot.h:19
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
BeamSpotFakeParameters_cfi.dydz
dydz
Definition: BeamSpotFakeParameters_cfi.py:13
AlignableExtras::Alignables
align::Alignables Alignables
Definition: AlignableExtras.h:21
AlignableExtras::AlignableExtras
AlignableExtras()
Constructor (builds all alignables)
Definition: AlignableExtras.cc:22
AlignableExtras::alignableLists_
AlignableMap alignableLists_
Definition: AlignableExtras.h:49
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
AlignableExtras::beamSpot
Alignables & beamSpot()
Return beam spot alignable as a vector with one element.
Definition: AlignableExtras.h:30
AlignableExtras::alignmentErrors
AlignmentErrorsExtended * alignmentErrors() const
Return alignment errors, sorted by DetId.
Definition: AlignableExtras.cc:58
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
AlignableMap::get
align::Alignables & get(const std::string &name="")
Definition: AlignableMap.cc:7
Exception.h
AlignableBeamSpot::initialize
void initialize(double x, double y, double z, double dxdz, double dydz)
initialize the alignable with the passed beam spot parameters
Definition: AlignableBeamSpot.cc:129
Alignments::m_align
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
AlignmentErrorsExtended::m_alignError
std::vector< AlignTransformErrorExtended > m_alignError
Definition: AlignmentErrorsExtended.h:19
AlignableExtras::dump
void dump(void) const
Definition: AlignableExtras.cc:29
Alignments
Definition: Alignments.h:10