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

Definition at line 21 of file AlignableExtras.h.

Constructor & Destructor Documentation

AlignableExtras::AlignableExtras ( )
explicit

Constructor (builds all alignables)

Definition at line 22 of file AlignableExtras.cc.

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

22  {
23  align::Alignables& alis = alignableLists_.get("BeamSpot");
24  alis.push_back(new AlignableBeamSpot());
25  components_.push_back(alis.back());
26 }
align::Alignables & get(const std::string &name="")
Definition: AlignableMap.cc:7
Alignables components_
AlignableMap alignableLists_
std::vector< Alignable * > Alignables
Definition: Utilities.h:31

Member Function Documentation

AlignmentErrorsExtended * AlignableExtras::alignmentErrors ( void  ) const

Return alignment errors, sorted by DetId.

Definition at line 58 of file AlignableExtras.cc.

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

Referenced by components().

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 }
const Alignables & components() const
std::vector< AlignTransformErrorExtended > m_alignError
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
Alignments * AlignableExtras::alignments ( void  ) const

Return alignments, sorted by DetId.

Definition at line 41 of file AlignableExtras.cc.

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

Referenced by components().

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 }
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
const Alignables & components() const
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
Alignables& AlignableExtras::beamSpot ( )
inline

Return beam spot alignable as a vector with one element.

Definition at line 30 of file AlignableExtras.h.

References subStructures().

Referenced by initializeBeamSpot(), and resetBeamSpot().

30 { return this->subStructures("BeamSpot"); }
Alignables & subStructures(const std::string &subStructName)
Return alignables determined by name.
const Alignables& AlignableExtras::components ( ) const
inline
void AlignableExtras::dump ( void  ) const

Definition at line 29 of file AlignableExtras.cc.

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

Referenced by components().

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 }
const Alignables & components() const
align::Alignables Alignables
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.

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

Referenced by components().

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 }
void initialize(double x, double y, double z, double dxdz, double dydz)
initialize the alignable with the passed beam spot parameters
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
Alignables & beamSpot()
Return beam spot alignable as a vector with one element.
void AlignableExtras::resetBeamSpot ( )

Initialize the alignable beam spot with the given parameters.

Definition at line 89 of file AlignableExtras.cc.

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

Referenced by components().

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 }
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
void reset()
reset beam spot to the uninitialized state
Alignables & beamSpot()
Return beam spot alignable as a vector with one element.
Alignables& AlignableExtras::subStructures ( const std::string &  subStructName)
inline

Return alignables determined by name.

Definition at line 27 of file AlignableExtras.h.

References alignableLists_, and AlignableMap::find().

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

27 { return alignableLists_.find(subStructName); }
align::Alignables & find(const std::string &name="")
Definition: AlignableMap.cc:10
AlignableMap alignableLists_

Member Data Documentation

AlignableMap AlignableExtras::alignableLists_
private

Definition at line 49 of file AlignableExtras.h.

Referenced by AlignableExtras(), and subStructures().

Alignables AlignableExtras::components_
private

Definition at line 50 of file AlignableExtras.h.

Referenced by AlignableExtras(), and components().