CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
AlignmentErrorsalignmentErrors () 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...
 
Alignables components () 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...
 
AlignablessubStructures (const std::string &subStructName)
 Return alignables determined by name. More...
 

Private Attributes

AlignSetup< AlignablesalignableLists_
 
Alignables components_
 

Detailed Description

A container for additional/extra alignables

Original author: Andreas Mussgiller, August 2010

Date:
2010/09/10 10:26:20
Revision:
1.1

(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 26 of file AlignableExtras.cc.

References alignableLists_, components_, and AlignSetup< Type >::get().

27 {
28  align::Alignables& alis = alignableLists_.get("BeamSpot");
29  alis.push_back(new AlignableBeamSpot());
30  components_.push_back(alis.back());
31 }
Alignables components_
Type & get(const std::string &name="")
Definition: AlignSetup.h:52
AlignSetup< Alignables > alignableLists_
std::vector< Alignable * > Alignables
Definition: Utilities.h:28

Member Function Documentation

AlignmentErrors * AlignableExtras::alignmentErrors ( void  ) const

Return alignment errors, sorted by DetId.

Definition at line 68 of file AlignableExtras.cc.

References components(), filterCSVwithJSON::copy, i, AlignmentErrors::m_alignError, and python.multivaluedict::sort().

69 {
70  align::Alignables comp = this->components();
71  AlignmentErrors* m_alignmentErrors = new AlignmentErrors();
72 
73  // Add components recursively
74  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
75  {
76  AlignmentErrors* tmpAlignmentErrors = (*i)->alignmentErrors();
77  std::copy( tmpAlignmentErrors->m_alignError.begin(), tmpAlignmentErrors->m_alignError.end(),
78  std::back_inserter(m_alignmentErrors->m_alignError) );
79  delete tmpAlignmentErrors;
80  }
81 
82  std::sort( m_alignmentErrors->m_alignError.begin(), m_alignmentErrors->m_alignError.end(),
84 
85  return m_alignmentErrors;
86 }
int i
Definition: DBlmapReader.cc:9
std::vector< AlignTransformError > m_alignError
Alignables components() const
std::vector< Alignable * > Alignables
Definition: Utilities.h:28
Alignments * AlignableExtras::alignments ( void  ) const

Return alignments, sorted by DetId.

Definition at line 48 of file AlignableExtras.cc.

References components(), filterCSVwithJSON::copy, i, Alignments::m_align, and python.multivaluedict::sort().

49 {
50  align::Alignables comp = this->components();
51  Alignments* m_alignments = new Alignments();
52  // Add components recursively
53  for ( align::Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
54  {
55  Alignments* tmpAlignments = (*i)->alignments();
56  std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(),
57  std::back_inserter(m_alignments->m_align) );
58  delete tmpAlignments;
59  }
60 
61  std::sort( m_alignments->m_align.begin(), m_alignments->m_align.end(),
63 
64  return m_alignments;
65 }
int i
Definition: DBlmapReader.cc:9
std::vector< AlignTransform > m_align
Definition: Alignments.h:14
Alignables components() const
std::vector< Alignable * > Alignables
Definition: Utilities.h:28
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 AlignmentProducer::endOfJob(), and initializeBeamSpot().

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

Definition at line 34 of file AlignableExtras.cc.

References components(), and i.

35 {
36  Alignables comp = this->components();
37 
38  // Dump this
39  edm::LogInfo("AlignableDump")
40  << " AlignableExtras knows " << comp.size() << " alignable(s)" << std::endl;
41 
42  // Dump components
43  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
44  (*i)->dump();
45 }
int i
Definition: DBlmapReader.cc:9
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 88 of file AlignableExtras.cc.

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

Referenced by AlignmentProducer::duringLoop().

90 {
91  align::Alignables& alis = beamSpot();
92  AlignableBeamSpot * aliBS = dynamic_cast<AlignableBeamSpot*>(alis.back());
93  if (aliBS) {
94  aliBS->initialize(x, y, z, dxdz, dydz);
95  } else {
96  edm::LogError("AlignableExtras")
97  << " AlignableBeamSpot not available. Cannot initialize!" << std::endl;
98  }
99 }
void initialize(double x, double y, double z, double dxdz, double dydz)
initialize the alignable with the passed beam spot parameters
double double double z
std::vector< Alignable * > Alignables
Definition: Utilities.h:28
x
Definition: VDTMath.h:216
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 AlignSetup< Type >::find().

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

29  {
30  return alignableLists_.find(subStructName);
31  }
Type & find(const std::string &name="")
Definition: AlignSetup.h:58
AlignSetup< Alignables > alignableLists_

Member Data Documentation

AlignSetup<Alignables> AlignableExtras::alignableLists_
private

Definition at line 52 of file AlignableExtras.h.

Referenced by AlignableExtras(), and subStructures().

Alignables AlignableExtras::components_
private

Definition at line 53 of file AlignableExtras.h.

Referenced by AlignableExtras(), and components().