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 | Protected Attributes
MuonChamberResidual Class Referenceabstract

#include <MuonChamberResidual.h>

Inheritance diagram for MuonChamberResidual:
MuonCSCChamberResidual MuonDT13ChamberResidual MuonDT2ChamberResidual

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:
2009/04/23 05:06:01
Revision:
1.5
Author
J. Pivarski - Texas A&M University pivar.nosp@m.ski@.nosp@m.physi.nosp@m.cs.t.nosp@m.amu.e.nosp@m.du

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.

Constructor & Destructor Documentation

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

Definition at line 26 of file MuonChamberResidual.h.

27  : m_globalGeometry(globalGeometry)
28  , m_navigator(navigator)
29  , m_chamberId(chamberId)
30  , m_chamberAlignable(chamberAlignable)
31  , m_numHits(0)
32  , m_residual_1(0.)
33  , m_residual_x(0.)
34  , m_residual_y(0.)
35  , m_residual_xx(0.)
36  , m_residual_xy(0.)
37  , m_trackx_1(0.)
38  , m_trackx_x(0.)
39  , m_trackx_y(0.)
40  , m_trackx_xx(0.)
41  , m_trackx_xy(0.)
42  , m_tracky_1(0.)
43  , m_tracky_x(0.)
44  , m_tracky_y(0.)
45  , m_tracky_xx(0.)
46  , m_tracky_xy(0.)
47  {};
AlignableNavigator * m_navigator
AlignableDetOrUnitPtr m_chamberAlignable
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
virtual MuonChamberResidual::~MuonChamberResidual ( )
inlinevirtual

Definition at line 49 of file MuonChamberResidual.h.

49 {};

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.

60 { 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(), x, and detailsBasic3DVector::y.

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

90  {
91  double output = 0.;
92  double a = residual();
93  double b = resslope();
94 
95  std::vector<double>::const_iterator x = m_individual_x.begin();
96  std::vector<double>::const_iterator y = m_individual_y.begin();
97  std::vector<double>::const_iterator w = m_individual_weight.begin();
98  for (; x != m_individual_x.end(); ++x, ++y, ++w) {
99  output += pow((*y) - a - b*(*x), 2) * (*w);
100  }
101  return output;
102  };
std::vector< double > m_individual_y
double resslope() const
std::vector< double > m_individual_x
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
Definition: DDAxes.h:10
std::vector< double > m_individual_weight
double residual() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
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().

149  {
150  return hitresid(i) * signConvention(m_localIDs[i].rawId());
151  };
int i
Definition: DBlmapReader.cc:9
std::vector< DetId > m_localIDs
double hitresid(int i) const
virtual double signConvention(const unsigned int rawId=0) const =0
double MuonChamberResidual::global_residual ( ) const
inline

Definition at line 141 of file MuonChamberResidual.h.

References residual(), and signConvention().

Referenced by AlignmentMonitorMuonSystemMap1D::event(), and AlignmentMonitorSegmentDifferences::event().

141  {
142  return residual() * signConvention();
143  };
virtual double signConvention(const unsigned int rawId=0) const =0
double residual() const
double MuonChamberResidual::global_resslope ( ) const
inline

Definition at line 145 of file MuonChamberResidual.h.

References resslope(), and signConvention().

Referenced by AlignmentMonitorMuonSystemMap1D::event(), AlignmentMonitorSegmentDifferences::event(), and AlignmentMonitorMuonVsCurvature::event().

145  {
146  return resslope() * signConvention();
147  };
double resslope() const
virtual double signConvention(const unsigned int rawId=0) const =0
GlobalPoint MuonChamberResidual::global_trackpos ( )
inline

Definition at line 132 of file MuonChamberResidual.h.

References chamberAlignable(), Alignable::surface(), AlignableSurface::toGlobal(), trackx(), and tracky().

Referenced by AlignmentMonitorMuonSystemMap1D::event().

132  {
133  return chamberAlignable()->surface().toGlobal(LocalPoint(trackx(), tracky(), 0.));
134  };
AlignableDetOrUnitPtr chamberAlignable() const
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
int MuonChamberResidual::hitlayer ( int  i) const
inline

Definition at line 153 of file MuonChamberResidual.h.

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

153  { // only difference between DTs and CSCs is the DetId subclass
154  assert(0 <= i && i < int(m_localIDs.size()));
156  DTLayerId layerId(m_localIDs[i].rawId());
157  return 4*(layerId.superlayer() - 1) + layerId.layer();
158  }
159  else if (m_chamberId.subdetId() == MuonSubdetId::CSC) {
160  CSCDetId layerId(m_localIDs[i].rawId());
161  return layerId.layer();
162  }
163  else assert(false);
164  };
int i
Definition: DBlmapReader.cc:9
static const int CSC
Definition: MuonSubdetId.h:15
std::vector< DetId > m_localIDs
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
static const int DT
Definition: MuonSubdetId.h:14
double MuonChamberResidual::hitposition ( int  i) const
inline

Definition at line 166 of file MuonChamberResidual.h.

References MuonSubdetId::CSC, MuonSubdetId::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().

166  {
167  assert(0 <= i && i < int(m_localIDs.size()));
169  GlobalPoint pos = m_globalGeometry->idToDet(m_localIDs[i])->position();
170  return sqrt(pow(pos.x(), 2) + pow(pos.y(), 2)); // R for DTs
171  }
172  else if (m_chamberId.subdetId() == MuonSubdetId::CSC) {
173  return m_globalGeometry->idToDet(m_localIDs[i])->position().z(); // Z for CSCs
174  }
175  else assert(false);
176  };
int i
Definition: DBlmapReader.cc:9
T y() const
Definition: PV3DBase.h:57
static const int CSC
Definition: MuonSubdetId.h:15
std::vector< DetId > m_localIDs
T sqrt(T t)
Definition: SSEVec.h:28
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
static const int DT
Definition: MuonSubdetId.h:14
T x() const
Definition: PV3DBase.h:56
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
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().

136  {
137  assert(0 <= i && i < int(m_localIDs.size()));
138  return m_localResids[i];
139  }
int i
Definition: DBlmapReader.cc:9
std::vector< DetId > m_localIDs
std::vector< double > m_localResids
DetId MuonChamberResidual::localid ( int  i) const
inline

Definition at line 178 of file MuonChamberResidual.h.

References i, and m_localIDs.

Referenced by AlignmentMonitorMuonVsCurvature::event().

178  {
179  return m_localIDs[i];
180  };
int i
Definition: DBlmapReader.cc:9
std::vector< DetId > m_localIDs
int MuonChamberResidual::ndof ( ) const
inline

Definition at line 104 of file MuonChamberResidual.h.

References m_individual_x.

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

104  {
105  return m_individual_x.size() - 2;
106  };
std::vector< double > m_individual_x
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().

72  {
73  assert(m_numHits > 1);
75  return sqrt(m_residual_xx / delta);
76  };
dbl * delta
Definition: mlp_gen.cc:36
T sqrt(T t)
Definition: SSEVec.h:28
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().

84  {
85  assert(m_numHits > 1);
87  return sqrt(m_residual_1 / delta);
88  };
dbl * delta
Definition: mlp_gen.cc:36
T sqrt(T t)
Definition: SSEVec.h:28
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

AlignableDetOrUnitPtr MuonChamberResidual::m_chamberAlignable
protected
DetId MuonChamberResidual::m_chamberId
protected
edm::ESHandle<GlobalTrackingGeometry> MuonChamberResidual::m_globalGeometry
protected
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
AlignableNavigator* MuonChamberResidual::m_navigator
protected

Definition at line 184 of file MuonChamberResidual.h.

int MuonChamberResidual::m_numHits
protected
double MuonChamberResidual::m_residual_1
protected
double MuonChamberResidual::m_residual_x
protected
double MuonChamberResidual::m_residual_xx
protected
double MuonChamberResidual::m_residual_xy
protected
double MuonChamberResidual::m_residual_y
protected
double MuonChamberResidual::m_trackx_1
protected
double MuonChamberResidual::m_trackx_x
protected
double MuonChamberResidual::m_trackx_xx
protected
double MuonChamberResidual::m_trackx_xy
protected
double MuonChamberResidual::m_trackx_y
protected
double MuonChamberResidual::m_tracky_1
protected
double MuonChamberResidual::m_tracky_x
protected
double MuonChamberResidual::m_tracky_xx
protected
double MuonChamberResidual::m_tracky_xy
protected
double MuonChamberResidual::m_tracky_y
protected