CMS 3D CMS Logo

AlignableCSCRing Class Reference

Concrete class for muon CSC Ring alignable. More...

#include <Alignment/MuonAlignment/interface/AlignableCSCRing.h>

Inheritance diagram for AlignableCSCRing:

AlignableComposite Alignable

List of all members.

Public Member Functions

 AlignableCSCRing (const std::vector< AlignableCSCChamber * > cscChambers)
 The constructor simply copies the vector of CSC Chambers and computes the surface from them.
AlignableCSCChamberchamber (int i)
 Return Alignable CSC Chamber at given index.
virtual std::vector< Alignable * > components () const
 Return vector of direct components.
RotationType computeOrientation ()
 Just initialize to default given by default constructor of a RotationType.
PositionType computePosition ()
 Compute average z position from all components (x and y forced to 0).
AlignableSurface computeSurface ()
 Returns surface corresponding to current position and orientation, as given by average on all components.
void dump (void)
 Recursive printout of the muon CSC Ring structure.
 ~AlignableCSCRing ()
 Clean delete of the vector and its elements.

Private Attributes

std::vector
< AlignableCSCChamber * > 
theCSCChambers

Friends

std::ostream & operator<< (std::ostream &, const AlignableCSCRing &)
 Printout muon CSC Ring information (not recursive).


Detailed Description

Concrete class for muon CSC Ring alignable.

The alignable muon CSC ring.

Misalignment can be de-/reactivated (forwarded to components).

Date
2008/04/15 16:05:53
Revision
1.3
Author:
Jim Pivarski - Texas A&M University

Definition at line 30 of file AlignableCSCRing.h.


Constructor & Destructor Documentation

AlignableCSCRing::AlignableCSCRing ( const std::vector< AlignableCSCChamber * >  cscChambers  ) 

The constructor simply copies the vector of CSC Chambers and computes the surface from them.

Definition at line 15 of file AlignableCSCRing.cc.

References computeSurface(), AlignableComposite::setSurface(), and theCSCChambers.

00016    : AlignableComposite(cscChambers[0]->id(), align::AlignableCSCRing)
00017 {
00018 
00019   theCSCChambers.insert( theCSCChambers.end(), cscChambers.begin(), cscChambers.end() );
00020 
00021   setSurface( computeSurface() );
00022    
00023 }

AlignableCSCRing::~AlignableCSCRing (  ) 

Clean delete of the vector and its elements.

Definition at line 27 of file AlignableCSCRing.cc.

References iter, and theCSCChambers.

00028 {
00029   for ( std::vector<AlignableCSCChamber*>::iterator iter = theCSCChambers.begin(); 
00030         iter != theCSCChambers.end(); iter++)
00031     delete *iter;
00032 
00033 }


Member Function Documentation

AlignableCSCChamber & AlignableCSCRing::chamber ( int  i  ) 

Return Alignable CSC Chamber at given index.

Definition at line 36 of file AlignableCSCRing.cc.

References Exception, Alignable::size(), and theCSCChambers.

00037 {
00038   
00039   if (i >= size() ) 
00040         throw cms::Exception("LogicError") << "CSC Chamber index (" << i << ") out of range";
00041 
00042   return *theCSCChambers[i];
00043   
00044 }

virtual std::vector<Alignable*> AlignableCSCRing::components (  )  const [inline, virtual]

Return vector of direct components.

Reimplemented from AlignableComposite.

Definition at line 39 of file AlignableCSCRing.h.

References HLT_VtxMuL3::result, and theCSCChambers.

00040   {
00041 
00042         std::vector<Alignable*> result;
00043         result.insert( result.end(), theCSCChambers.begin(), theCSCChambers.end() );
00044         return result;
00045 
00046   }

AlignableCSCRing::RotationType AlignableCSCRing::computeOrientation (  ) 

Just initialize to default given by default constructor of a RotationType.

Definition at line 76 of file AlignableCSCRing.cc.

Referenced by computeSurface().

00077 {
00078   return RotationType();
00079 }

AlignableCSCRing::PositionType AlignableCSCRing::computePosition (  ) 

Compute average z position from all components (x and y forced to 0).

Definition at line 59 of file AlignableCSCRing.cc.

References theCSCChambers, and PV3DBase< T, PVType, FrameType >::z().

Referenced by computeSurface().

00060 {
00061 
00062   float zz = 0.;
00063 
00064   for ( std::vector<AlignableCSCChamber*>::iterator ichamber = theCSCChambers.begin();
00065                 ichamber != theCSCChambers.end(); ichamber++ )
00066     zz += (*ichamber)->globalPosition().z();
00067 
00068   zz /= static_cast<float>(theCSCChambers.size());
00069 
00070   return PositionType( 0.0, 0.0, zz );
00071 
00072 }

AlignableSurface AlignableCSCRing::computeSurface (  ) 

Returns surface corresponding to current position and orientation, as given by average on all components.

Definition at line 49 of file AlignableCSCRing.cc.

References computeOrientation(), and computePosition().

Referenced by AlignableCSCRing().

00050 {
00051 
00052   return AlignableSurface( computePosition(), computeOrientation() );
00053 
00054 }

void AlignableCSCRing::dump ( void   ) 

Recursive printout of the muon CSC Ring structure.

Recursive printout of whole CSC Ring structure.

Definition at line 106 of file AlignableCSCRing.cc.

References theCSCChambers.

00107 {
00108 
00109   edm::LogInfo("AlignableDump") << (*this);
00110   for ( std::vector<AlignableCSCChamber*>::iterator iChamber = theCSCChambers.begin();
00111                 iChamber != theCSCChambers.end(); iChamber++ )
00112          edm::LogInfo("AlignableDump")  << (**iChamber);
00113 
00114 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const AlignableCSCRing b 
) [friend]

Printout muon CSC Ring information (not recursive).

Definition at line 93 of file AlignableCSCRing.cc.

00094 {
00095 
00096   os << "This CSC Ring contains " << b.theCSCChambers.size() << " CSC chambers" << std::endl;
00097   os << "(phi, r, z) =  (" << b.globalPosition().phi() << "," 
00098      << b.globalPosition().perp() << "," << b.globalPosition().z();
00099   os << "),  orientation:" << std::endl<< b.globalRotation() << std::endl;
00100   return os;
00101 
00102 }


Member Data Documentation

std::vector<AlignableCSCChamber*> AlignableCSCRing::theCSCChambers [private]

Definition at line 69 of file AlignableCSCRing.h.

Referenced by AlignableCSCRing(), chamber(), components(), computePosition(), dump(), operator<<(), and ~AlignableCSCRing().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:14:17 2009 for CMSSW by  doxygen 1.5.4