CMS 3D CMS Logo

Public Member Functions

MuonTrackCSCChamberResidual Class Reference

#include <MuonTrackCSCChamberResidual.h>

Inheritance diagram for MuonTrackCSCChamberResidual:
MuonChamberResidual

List of all members.

Public Member Functions

virtual void addResidual (const TrajectoryStateOnSurface *tsos, const TransientTrackingRecHit *hit)
 MuonTrackCSCChamberResidual (edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
virtual void setSegmentResidual (const reco::MuonChamberMatch *, const reco::MuonSegmentMatch *)

Detailed Description

Implementation of tracker muon chamber residuals for CSC

Id:
MuonTrackCSCChamberResidual.h,v 1.1 2011/10/12 23:32:07 khotilov Exp

Definition at line 13 of file MuonTrackCSCChamberResidual.h.


Constructor & Destructor Documentation

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

Definition at line 9 of file MuonTrackCSCChamberResidual.cc.

References MuonChamberResidual::kCSC, MuonChamberResidual::m_chamberId, MuonChamberResidual::m_globalGeometry, MuonChamberResidual::m_sign, and MuonChamberResidual::m_type.

  : MuonChamberResidual(globalGeometry, navigator, chamberId, chamberAlignable)
{
  m_type = MuonChamberResidual::kCSC;
  align::GlobalVector zDirection(0., 0., 1.);
  m_sign = m_globalGeometry->idToDet(m_chamberId)->toLocal(zDirection).z() > 0. ? 1. : -1.;
}

Member Function Documentation

virtual void MuonTrackCSCChamberResidual::addResidual ( const TrajectoryStateOnSurface tsos,
const TransientTrackingRecHit hit 
) [inline, virtual]

Implements MuonChamberResidual.

Definition at line 20 of file MuonTrackCSCChamberResidual.h.

{}
void MuonTrackCSCChamberResidual::setSegmentResidual ( const reco::MuonChamberMatch trk,
const reco::MuonSegmentMatch seg 
) [virtual]

Implements MuonChamberResidual.

Definition at line 19 of file MuonTrackCSCChamberResidual.cc.

References MuonChamberResidual::chamberId(), CSCSegment::chi2(), reco::MuonSegmentMatch::cscSegmentRef, CSCSegment::degreesOfFreedom(), reco::MuonSegmentMatch::dXdZ, reco::MuonChamberMatch::dXdZ, reco::MuonChamberMatch::dXdZErr, reco::MuonSegmentMatch::dXdZErr, reco::MuonSegmentMatch::dYdZ, reco::MuonChamberMatch::dYdZ, edm::Ref< C, T, F >::get(), reco::MuonChamberMatch::id, MuonChamberResidual::m_chi2, MuonChamberResidual::m_ndof, MuonChamberResidual::m_numHits, MuonChamberResidual::m_residual, MuonChamberResidual::m_residual_error, MuonChamberResidual::m_resslope, MuonChamberResidual::m_resslope_error, MuonChamberResidual::m_segdxdz, MuonChamberResidual::m_segdydz, MuonChamberResidual::m_segx, MuonChamberResidual::m_segy, MuonChamberResidual::m_trackdxdz, MuonChamberResidual::m_trackdydz, MuonChamberResidual::m_trackx, MuonChamberResidual::m_tracky, CSCSegment::nRecHits(), funct::pow(), DetId::rawId(), mathSSE::sqrt(), reco::MuonSegmentMatch::x, reco::MuonChamberMatch::x, reco::MuonChamberMatch::xErr, reco::MuonSegmentMatch::xErr, reco::MuonSegmentMatch::y, and reco::MuonChamberMatch::y.

{
  CSCDetId id(trk->id.rawId());
  CSCDetId chamber(id.chamberId());
  
  CSCSegmentRef segmentCSC = seg->cscSegmentRef;
  if (segmentCSC.get() != 0)
  {
    const CSCSegment* segment = segmentCSC.get();
    m_numHits = segment->nRecHits();
    m_ndof = segment->degreesOfFreedom();
    m_chi2 = segment->chi2();
    //std::cout<<"csc seg position = "<<segment->localPosition()<<"  numhits="<<m_numHits<<"  id: "<<id<<std::endl;
  }

  align::LocalPoint l_seg(seg->x, seg->y, 0.);
  align::LocalPoint l_trk(trk->x, trk->y, 0.);

  /*
  double dphi = g_trk.phi() - g_seg.phi();
  while (dphi >  M_PI) dphi -= 2.*M_PI;
  while (dphi < -M_PI) dphi += 2.*M_PI;
  m_residual = - m_sign * g_trk.perp() * dphi; // coming from global, need to adjust the sign
  std::cout<<"cscres="<<m_residual<<"  dx="<<trk->x-seg->x<<"  diff="<<trk->x-seg->x - m_residual<<std::endl;
  */
  m_residual = trk->x-seg->x;
  m_residual_error = sqrt( pow(trk->xErr, 2) + pow(seg->xErr, 2) );
  m_resslope = trk->dXdZ - seg->dXdZ;
  m_resslope_error = sqrt( pow(trk->dXdZErr, 2) + pow(seg->dXdZErr, 2) );
  
  m_trackx = trk->x;
  m_tracky = trk->y;
  m_trackdxdz = trk->dXdZ;
  m_trackdydz = trk->dYdZ;

  m_segx = seg->x;
  m_segy = seg->y;
  m_segdxdz = seg->dXdZ;
  m_segdydz = seg->dYdZ;

  //double yresidual_error = sqrt( pow(trk->yErr, 2) + pow(seg->yErr, 2) );
  //double yresslope_error = sqrt( pow(trk->dYdZErr, 2) + pow(seg->dYdZErr, 2) );
  //std::cout<<"csc res "<<m_residual<<"+-"<<m_residual_error<<"  "<<m_resslope<<"+-"<<m_resslope_error<<"  "<<trk->y-seg->y<<"+-"<<yresidual_error<<"  "<<trk->dYdZ - seg->dYdZ<<"+-"<<yresslope_error<<std::endl;
  //std::cout<<"csc trk "<<m_trackx<<" "<<m_tracky<<" "<<m_trackdxdz<<" "<<m_trackdydz<<std::endl;
  //std::cout<<"csc seg "<<m_segx<<" "<<m_segy<<" "<<m_segdxdz<<" "<<m_segdydz<<std::endl;
}