CMS 3D CMS Logo

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

#include <AlignableExtras.h>

Public Types

typedef align::Alignables Alignables
 

Public Member Functions

 AlignableExtras ()
 Constructor (builds all alignables) More...
 
AlignmentErrorsExtendedalignmentErrors () const
 Return alignment errors, sorted by DetId. More...
 
Alignmentsalignments () const
 Return alignments, sorted by DetId. More...
 
AlignablesbeamSpot ()
 Return beam spot alignable as a vector with one element. More...
 
const Alignablescomponents () const
 
void dump (void) const
 
void initializeBeamSpot (double x, double y, double z, double dxdz, double dydz)
 Initialize the alignable beam spot with the given parameters. More...
 
void resetBeamSpot ()
 Initialize the alignable beam spot with the given parameters. More...
 
AlignablessubStructures (const std::string &subStructName)
 Return alignables determined by name. More...
 

Private Attributes

AlignableMap alignableLists_
 
Alignables components_
 

Detailed Description

A container for additional/extra alignables

Original author: Andreas Mussgiller, August 2010

Date
2009/02/28 21:04:59
Revision
1.3

(last update by

Author
mussgill

)

Definition at line 19 of file AlignableExtras.h.

Member Typedef Documentation

◆ Alignables

Definition at line 21 of file AlignableExtras.h.

Constructor & Destructor Documentation

◆ AlignableExtras()

AlignableExtras::AlignableExtras ( )
explicit

Constructor (builds all alignables)

Definition at line 22 of file AlignableExtras.cc.

22  {
23  align::Alignables& alis = alignableLists_.get("BeamSpot");
24  alis.push_back(new AlignableBeamSpot());
25  components_.push_back(alis.back());
26 }

References alignableLists_, components_, and AlignableMap::get().

Member Function Documentation

◆ alignmentErrors()

AlignmentErrorsExtended * AlignableExtras::alignmentErrors ( void  ) const

Return alignment errors, sorted by DetId.

Definition at line 58 of file AlignableExtras.cc.

58  {
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 }

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), filterCSVwithJSON::copy, mps_fire::i, and AlignmentErrorsExtended::m_alignError.

◆ alignments()

Alignments * AlignableExtras::alignments ( void  ) const

Return alignments, sorted by DetId.

Definition at line 41 of file AlignableExtras.cc.

41  {
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 }

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), filterCSVwithJSON::copy, mps_fire::i, and Alignments::m_align.

◆ beamSpot()

Alignables& AlignableExtras::beamSpot ( )
inline

Return beam spot alignable as a vector with one element.

Definition at line 30 of file AlignableExtras.h.

30 { return this->subStructures("BeamSpot"); }

References subStructures().

Referenced by initializeBeamSpot(), and resetBeamSpot().

◆ components()

const Alignables& AlignableExtras::components ( ) const
inline

◆ dump()

void AlignableExtras::dump ( void  ) const

Definition at line 29 of file AlignableExtras.cc.

29  {
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 }

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), and mps_fire::i.

◆ initializeBeamSpot()

void AlignableExtras::initializeBeamSpot ( double  x,
double  y,
double  z,
double  dxdz,
double  dydz 
)

Initialize the alignable beam spot with the given parameters.

Definition at line 78 of file AlignableExtras.cc.

78  {
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 }

References beamSpot(), BeamSpotPI::dxdz, BeamSpotPI::dydz, AlignableBeamSpot::initialize(), x, y, and z.

◆ resetBeamSpot()

void AlignableExtras::resetBeamSpot ( )

Initialize the alignable beam spot with the given parameters.

Definition at line 89 of file AlignableExtras.cc.

89  {
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 }

References beamSpot(), and AlignableBeamSpot::reset().

◆ subStructures()

Alignables& AlignableExtras::subStructures ( const std::string &  subStructName)
inline

Return alignables determined by name.

Definition at line 27 of file AlignableExtras.h.

27 { return alignableLists_.find(subStructName); }

References alignableLists_, and AlignableMap::find().

Referenced by AlignmentParameterSelector::addSelection(), and beamSpot().

Member Data Documentation

◆ alignableLists_

AlignableMap AlignableExtras::alignableLists_
private

Definition at line 49 of file AlignableExtras.h.

Referenced by AlignableExtras(), and subStructures().

◆ components_

Alignables AlignableExtras::components_
private

Definition at line 50 of file AlignableExtras.h.

Referenced by AlignableExtras(), and components().

DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
AlignableBeamSpot::reset
void reset()
reset beam spot to the uninitialized state
Definition: AlignableBeamSpot.cc:151
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDAxes::x
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
AlignableExtras::components
const Alignables & components() const
Definition: AlignableExtras.h:32
AlignableExtras::components_
Alignables components_
Definition: AlignableExtras.h:50
DDAxes::z
BeamSpotPI::dxdz
Definition: BeamSpotPayloadInspectorHelper.h:36
AlignableMap::find
align::Alignables & find(const std::string &name="")
Definition: AlignableMap.cc:10
AlignableBeamSpot
Definition: AlignableBeamSpot.h:19
BeamSpotPI::dydz
Definition: BeamSpotPayloadInspectorHelper.h:37
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
AlignableExtras::Alignables
align::Alignables Alignables
Definition: AlignableExtras.h:21
AlignableExtras::alignableLists_
AlignableMap alignableLists_
Definition: AlignableExtras.h:49
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
AlignableExtras::subStructures
Alignables & subStructures(const std::string &subStructName)
Return alignables determined by name.
Definition: AlignableExtras.h:27
AlignableExtras::beamSpot
Alignables & beamSpot()
Return beam spot alignable as a vector with one element.
Definition: AlignableExtras.h:30
AlignableMap::get
align::Alignables & get(const std::string &name="")
Definition: AlignableMap.cc:7
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
Alignments
Definition: Alignments.h:10