CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Attributes

MuonChamberResidual Class Reference

#include <MuonChamberResidual.h>

Inheritance diagram for MuonChamberResidual:
MuonCSCChamberResidual MuonDT13ChamberResidual MuonDT2ChamberResidual

List of all members.

Public Types

enum  { kDT13, kDT2, kCSC }

Public Member Functions

virtual void addResidual (const TrajectoryStateOnSurface *tsos, const TransientTrackingRecHit *hit)=0
AlignableDetOrUnitPtr chamberAlignable () const
DetId chamberId () const
double chi2 () const
double global_hitresid (int i) const
double global_residual () const
double global_resslope () const
GlobalPoint global_trackpos ()
int hitlayer (int i) const
double hitposition (int i) const
double hitresid (int i) const
DetId localid (int i) const
 MuonChamberResidual (edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
int ndof () const
int numHits () const
double residual () const
double residual_error () const
double resslope () const
double resslope_error () const
virtual double signConvention (const unsigned int rawId=0) const =0
double trackdxdz () const
double trackdydz () const
double trackx () const
double tracky () const
virtual int type () const =0
virtual ~MuonChamberResidual ()

Protected Attributes

AlignableDetOrUnitPtr m_chamberAlignable
DetId m_chamberId
edm::ESHandle
< GlobalTrackingGeometry
m_globalGeometry
std::vector< double > m_individual_weight
std::vector< double > m_individual_x
std::vector< double > m_individual_y
std::vector< DetIdm_localIDs
std::vector< double > m_localResids
AlignableNavigatorm_navigator
int m_numHits
double m_residual_1
double m_residual_x
double m_residual_xx
double m_residual_xy
double m_residual_y
double m_trackx_1
double m_trackx_x
double m_trackx_xx
double m_trackx_xy
double m_trackx_y
double m_tracky_1
double m_tracky_x
double m_tracky_xx
double m_tracky_xy
double m_tracky_y

Detailed Description

Date:
2010/03/07 22:58:34
Revision:
1.6
Author:
J. Pivarski - Texas A&M University <pivarski@physics.tamu.edu>

Definition at line 24 of file MuonChamberResidual.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
kDT13 
kDT2 
kCSC 

Definition at line 51 of file MuonChamberResidual.h.

       {
    kDT13,
    kDT2,
    kCSC
  };

Constructor & Destructor Documentation

MuonChamberResidual::MuonChamberResidual ( edm::ESHandle< GlobalTrackingGeometry globalGeometry,
AlignableNavigator navigator,
DetId  chamberId,
AlignableDetOrUnitPtr  chamberAlignable 
) [inline]

Definition at line 26 of file MuonChamberResidual.h.

    : m_globalGeometry(globalGeometry)
    , m_navigator(navigator)
    , m_chamberId(chamberId)
    , m_chamberAlignable(chamberAlignable)
    , m_numHits(0)
    , m_residual_1(0.)
    , m_residual_x(0.)
    , m_residual_y(0.)
    , m_residual_xx(0.)
    , m_residual_xy(0.)
    , m_trackx_1(0.)
    , m_trackx_x(0.)
    , m_trackx_y(0.)
    , m_trackx_xx(0.)
    , m_trackx_xy(0.)
    , m_tracky_1(0.)
    , m_tracky_x(0.)
    , m_tracky_y(0.)
    , m_tracky_xx(0.)
    , m_tracky_xy(0.)
  {};
virtual MuonChamberResidual::~MuonChamberResidual ( ) [inline, virtual]

Definition at line 49 of file MuonChamberResidual.h.

{};

Member Function Documentation

virtual void MuonChamberResidual::addResidual ( const TrajectoryStateOnSurface tsos,
const TransientTrackingRecHit hit 
) [pure virtual]
AlignableDetOrUnitPtr MuonChamberResidual::chamberAlignable ( ) const [inline]
DetId MuonChamberResidual::chamberId ( ) const [inline]

Definition at line 60 of file MuonChamberResidual.h.

References m_chamberId.

{ return m_chamberId; };
double MuonChamberResidual::chi2 ( ) const [inline]

Definition at line 90 of file MuonChamberResidual.h.

References a, b, m_individual_weight, m_individual_x, m_individual_y, convertSQLitetoXML_cfg::output, funct::pow(), residual(), resslope(), ExpressReco_HICollisions_FallBack::x, and ExpressReco_HICollisions_FallBack::y.

Referenced by AlignmentMonitorMuonSystemMap1D::event(), and MuonAlignmentFromReference::run().

                      {
    double output = 0.;
    double a = residual();
    double b = resslope();

    std::vector<double>::const_iterator x = m_individual_x.begin();
    std::vector<double>::const_iterator y = m_individual_y.begin();
    std::vector<double>::const_iterator w = m_individual_weight.begin();
    for (;  x != m_individual_x.end();  ++x, ++y, ++w) {
      output += pow((*y) - a - b*(*x), 2) * (*w);
    }
    return output;
  };
double MuonChamberResidual::global_hitresid ( int  i) const [inline]

Definition at line 149 of file MuonChamberResidual.h.

References hitresid(), m_localIDs, and signConvention().

Referenced by AlignmentMonitorMuonVsCurvature::event().

                                      {
    return hitresid(i) * signConvention(m_localIDs[i].rawId());
  };
double MuonChamberResidual::global_residual ( ) const [inline]
double MuonChamberResidual::global_resslope ( ) const [inline]
GlobalPoint MuonChamberResidual::global_trackpos ( ) [inline]

Definition at line 132 of file MuonChamberResidual.h.

References chamberAlignable(), trackx(), and tracky().

Referenced by AlignmentMonitorMuonSystemMap1D::event().

                                {
    return chamberAlignable()->surface().toGlobal(LocalPoint(trackx(), tracky(), 0.));
  };
int MuonChamberResidual::hitlayer ( int  i) const [inline]

Definition at line 153 of file MuonChamberResidual.h.

References CSC(), GeomDetEnumerators::DT, DTLayerId::layer(), CSCDetId::layer(), m_chamberId, m_localIDs, DetId::subdetId(), and DTSuperLayerId::superlayer().

                            {  // only difference between DTs and CSCs is the DetId subclass
    assert(0 <= i  &&  i < int(m_localIDs.size()));
    if (m_chamberId.subdetId() == MuonSubdetId::DT) {
      DTLayerId layerId(m_localIDs[i].rawId());
      return 4*(layerId.superlayer() - 1) + layerId.layer();
    }
    else if (m_chamberId.subdetId() == MuonSubdetId::CSC) {
      CSCDetId layerId(m_localIDs[i].rawId());
      return layerId.layer();
    }
    else assert(false);
  };
double MuonChamberResidual::hitposition ( int  i) const [inline]

Definition at line 166 of file MuonChamberResidual.h.

References CSC(), GeomDetEnumerators::DT, m_chamberId, m_globalGeometry, m_localIDs, pos, funct::pow(), mathSSE::sqrt(), DetId::subdetId(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

                                  {
    assert(0 <= i  &&  i < int(m_localIDs.size()));
    if (m_chamberId.subdetId() == MuonSubdetId::DT) {
      GlobalPoint pos = m_globalGeometry->idToDet(m_localIDs[i])->position();
      return sqrt(pow(pos.x(), 2) + pow(pos.y(), 2));                   // R for DTs
    }
    else if (m_chamberId.subdetId() == MuonSubdetId::CSC) {
      return m_globalGeometry->idToDet(m_localIDs[i])->position().z();  // Z for CSCs
    }
    else assert(false);
  };
double MuonChamberResidual::hitresid ( int  i) const [inline]

Definition at line 136 of file MuonChamberResidual.h.

References i, m_localIDs, and m_localResids.

Referenced by AlignmentMonitorMuonVsCurvature::event(), and global_hitresid().

                               {
    assert(0 <= i  &&  i < int(m_localIDs.size()));
    return m_localResids[i];
  }
DetId MuonChamberResidual::localid ( int  i) const [inline]

Definition at line 178 of file MuonChamberResidual.h.

References i, and m_localIDs.

Referenced by AlignmentMonitorMuonVsCurvature::event().

                             {
    return m_localIDs[i];
  };
int MuonChamberResidual::ndof ( ) const [inline]

Definition at line 104 of file MuonChamberResidual.h.

References m_individual_x.

Referenced by AlignmentMonitorMuonSystemMap1D::event(), and MuonAlignmentFromReference::run().

                   {
    return m_individual_x.size() - 2;
  };
int MuonChamberResidual::numHits ( ) const [inline]
double MuonChamberResidual::residual ( ) const [inline]
double MuonChamberResidual::residual_error ( ) const [inline]

Definition at line 72 of file MuonChamberResidual.h.

References delta, m_numHits, m_residual_1, m_residual_x, m_residual_xx, and mathSSE::sqrt().

                                {
    assert(m_numHits > 1);
    double delta = m_residual_1*m_residual_xx - m_residual_x*m_residual_x;
    return sqrt(m_residual_xx / delta);
  };
double MuonChamberResidual::resslope ( ) const [inline]
double MuonChamberResidual::resslope_error ( ) const [inline]

Definition at line 84 of file MuonChamberResidual.h.

References delta, m_numHits, m_residual_1, m_residual_x, m_residual_xx, and mathSSE::sqrt().

                                {
    assert(m_numHits > 1);
    double delta = m_residual_1*m_residual_xx - m_residual_x*m_residual_x;
    return sqrt(m_residual_1 / delta);
  };
virtual double MuonChamberResidual::signConvention ( const unsigned int  rawId = 0) const [pure virtual]
double MuonChamberResidual::trackdxdz ( ) const [inline]
double MuonChamberResidual::trackdydz ( ) const [inline]
double MuonChamberResidual::trackx ( ) const [inline]
double MuonChamberResidual::tracky ( ) const [inline]
virtual int MuonChamberResidual::type ( ) const [pure virtual]

Member Data Documentation

std::vector<double> MuonChamberResidual::m_individual_weight [protected]
std::vector<double> MuonChamberResidual::m_individual_x [protected]
std::vector<double> MuonChamberResidual::m_individual_y [protected]
std::vector<DetId> MuonChamberResidual::m_localIDs [protected]
std::vector<double> MuonChamberResidual::m_localResids [protected]

Definition at line 184 of file MuonChamberResidual.h.

double MuonChamberResidual::m_trackx_1 [protected]
double MuonChamberResidual::m_trackx_x [protected]
double MuonChamberResidual::m_trackx_y [protected]
double MuonChamberResidual::m_tracky_1 [protected]
double MuonChamberResidual::m_tracky_x [protected]
double MuonChamberResidual::m_tracky_y [protected]