25 double chamber_length) {
29 std::cout <<
"MuonCSCChamberResidual::addResidual 1" << std::endl;
32 std::cout <<
"MuonCSCChamberResidual::addResidual 2" << std::endl;
35 std::cout <<
"MuonCSCChamberResidual::addResidual 3" << std::endl;
40 <<
" tsos->localPosition() x: " << tsos->
localPosition().
x() << std::endl;
42 <<
" tsos->localPosition() y: " << tsos->
localPosition().
y() << std::endl;
44 <<
" tsos->localPosition() z: " << tsos->
localPosition().
z() << std::endl;
57 double sinAngle =
sin(angle);
58 double cosAngle =
cos(angle);
60 double residual = cosAngle * (tsosChamberPos.
x() - hitChamberPos.
x()) +
61 sinAngle * (tsosChamberPos.
y() - hitChamberPos.
y());
64 std::cout <<
" MuonCSCChamberResidual residual: " << residual << std::endl;
69 double weight = 1. / (xx * cosAngle * cosAngle + 2. * xy * sinAngle * cosAngle + yy * sinAngle * sinAngle);
71 double layerPosition = tsosChamberPos.
z();
72 double layerHitPos = hitChamberPos.
z();
87 m_trackx_xx += weight * layerPosition * layerPosition;
88 m_trackx_xy += weight * layerPosition * tsosChamberPos.
x();
94 m_tracky_xx += weight * layerPosition * layerPosition;
95 m_tracky_xy += weight * layerPosition * tsosChamberPos.
y();
100 m_hitx_xx += weight * layerHitPos * layerHitPos;
101 m_hitx_xy += weight * layerHitPos * hitChamberPos.
x();
106 m_hity_xx += weight * layerHitPos * layerHitPos;
107 m_hity_xy += weight * layerHitPos * hitChamberPos.
y();
void addResidual(edm::ESHandle< Propagator > prop, const TrajectoryStateOnSurface *tsos, const TrackingRecHit *hit, double, double) override
std::vector< double > m_individual_y
LocalPoint localPosition() const
Sin< T >::type sin(const T &t)
std::vector< double > m_individual_x
std::vector< DetId > m_localIDs
align::RotationType toLocal(const align::RotationType &) const
Return in local frame a rotation given in global frame.
std::vector< double > m_localResids
Cos< T >::type cos(const T &t)
AlignableDetOrUnitPtr m_chamberAlignable
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
int nearestStrip(const LocalPoint &lp) const
Basic2DVector< T > xy() const
MuonCSCChamberResidual(edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
virtual LocalError localPositionError() const =0
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
std::vector< double > m_individual_weight
float stripAngle(int strip) const
const CSCLayerGeometry * geometry() const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)