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 23 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().

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

Member Function Documentation

AlignmentErrorsExtended * AlignableExtras::alignmentErrors ( void  ) const

Return alignment errors, sorted by DetId.

Definition at line 64 of file AlignableExtras.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), popcon2dropbox::copy(), mps_fire::i, AlignmentErrorsExtended::m_alignError, and jetUpdater_cfi::sort.

Referenced by components().

65 {
67  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
68 
69  // Add components recursively
70  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
71  {
72  AlignmentErrorsExtended* tmpAlignmentErrorsExtended = (*i)->alignmentErrors();
73  std::copy( tmpAlignmentErrorsExtended->m_alignError.begin(), tmpAlignmentErrorsExtended->m_alignError.end(),
74  std::back_inserter(m_alignmentErrors->m_alignError) );
75  delete tmpAlignmentErrorsExtended;
76  }
77 
78  // sort by rawId
79  std::sort( m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end());
80 
81  return m_alignmentErrors;
82 }
def copy(args, dbName)
const Alignables & components() const
std::vector< AlignTransformErrorExtended > m_alignError
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
Alignments * AlignableExtras::alignments ( void  ) const

Return alignments, sorted by DetId.

Definition at line 44 of file AlignableExtras.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), popcon2dropbox::copy(), mps_fire::i, Alignments::m_align, and jetUpdater_cfi::sort.

Referenced by components().

45 {
47  Alignments* m_alignments = new Alignments();
48  // Add components recursively
49  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
50  {
51  Alignments* tmpAlignments = (*i)->alignments();
52  std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(),
53  std::back_inserter(m_alignments->m_align) );
54  delete tmpAlignments;
55  }
56 
57  // sort by rawId
58  std::sort( m_alignments->m_align.begin(), m_alignments->m_align.end());
59 
60  return m_alignments;
61 }
def copy(args, dbName)
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
const Alignables & components() const
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
Alignables& AlignableExtras::beamSpot ( )
inline

Return beam spot alignable as a vector with one element.

Definition at line 34 of file AlignableExtras.h.

References subStructures().

Referenced by initializeBeamSpot(), resetBeamSpot(), and AlignmentProducerBase::storeAlignmentsToDB().

34 { 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 30 of file AlignableExtras.cc.

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

Referenced by components().

31 {
32  Alignables comp = this->components();
33 
34  // Dump this
35  edm::LogInfo("AlignableDump")
36  << " AlignableExtras knows " << comp.size() << " alignable(s)" << std::endl;
37 
38  // Dump components
39  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
40  (*i)->dump();
41 }
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 85 of file AlignableExtras.cc.

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

Referenced by components(), and AlignmentProducerBase::initBeamSpot().

87 {
88  align::Alignables& alis = beamSpot();
89  AlignableBeamSpot * aliBS = dynamic_cast<AlignableBeamSpot*>(alis.back());
90  if (aliBS) {
91  aliBS->initialize(x, y, z, dxdz, dydz);
92  } else {
93  edm::LogError("AlignableExtras")
94  << " AlignableBeamSpot not available. Cannot initialize!" << std::endl;
95  }
96 }
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:32
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 99 of file AlignableExtras.cc.

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

Referenced by components().

100 {
101  align::Alignables& alis = beamSpot();
102  AlignableBeamSpot * aliBS = dynamic_cast<AlignableBeamSpot*>(alis.back());
103  if (aliBS) {
104  aliBS->reset();
105  } else {
106  edm::LogWarning("AlignableExtras")
107  << "@SUB=AlignableExtras::resetBeamSpot"
108  << "AlignableBeamSpot not available. Cannot reset!" << std::endl;
109  }
110 }
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
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 29 of file AlignableExtras.h.

References alignableLists_, and AlignableMap::find().

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

29  {
30  return alignableLists_.find(subStructName);
31  }
align::Alignables & find(const std::string &name="")
Definition: AlignableMap.cc:15
AlignableMap alignableLists_

Member Data Documentation

AlignableMap AlignableExtras::alignableLists_
private

Definition at line 55 of file AlignableExtras.h.

Referenced by AlignableExtras(), and subStructures().

Alignables AlignableExtras::components_
private

Definition at line 56 of file AlignableExtras.h.

Referenced by AlignableExtras(), and components().