CMS 3D CMS Logo

List of all members | Public Member Functions
MuonTrackCSCChamberResidual Class Referenceabstract

#include <MuonTrackCSCChamberResidual.h>

Inheritance diagram for MuonTrackCSCChamberResidual:
MuonChamberResidual

Public Member Functions

void addResidual (edm::ESHandle< Propagator > prop, const TrajectoryStateOnSurface *tsos, const TrackingRecHit *hit, double, double) override=0
 
 MuonTrackCSCChamberResidual (edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
 
void setSegmentResidual (const reco::MuonChamberMatch *, const reco::MuonSegmentMatch *) override
 
- Public Member Functions inherited from MuonChamberResidual
AlignableDetOrUnitPtr chamberAlignable () const
 
DetId chamberId () const
 
double Chambl () const
 
double ChambW () const
 
double chi2 () const
 
double global_hitresid (int i) const
 
double global_residual () const
 
double global_resslope () const
 
align::GlobalPoint global_stubpos ()
 
align::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
 
double segdxdz () const
 
double segdydz () const
 
double segx () const
 
double segy () const
 
virtual double signConvention () const
 
double trackdxdz () const
 
double trackdydz () const
 
double trackx () const
 
double tracky () const
 
int type () const
 
virtual ~MuonChamberResidual ()
 

Additional Inherited Members

- Public Types inherited from MuonChamberResidual
enum  { kDT13, kDT2, kCSC }
 
- Protected Attributes inherited from MuonChamberResidual
AlignableDetOrUnitPtr m_chamberAlignable
 
DetId m_chamberId
 
double m_Chambl
 
double m_ChambW
 
double m_chi2
 
edm::ESHandle< GlobalTrackingGeometrym_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_ndof
 
int m_numHits
 
double m_residual
 
double m_residual_error
 
double m_resslope
 
double m_resslope_error
 
double m_segdxdz
 
double m_segdydz
 
double m_segx
 
double m_segy
 
double m_sign
 
double m_trackdxdz
 
double m_trackdydz
 
double m_trackx
 
double m_tracky
 
int m_type
 

Detailed Description

Implementation of tracker muon chamber residuals for CSC

Id

Definition at line 13 of file MuonTrackCSCChamberResidual.h.

Constructor & Destructor Documentation

◆ MuonTrackCSCChamberResidual()

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

Definition at line 8 of file MuonTrackCSCChamberResidual.cc.

References GlobalTrackingGeometry::idToDet(), MuonChamberResidual::kCSC, MuonChamberResidual::m_chamberId, MuonChamberResidual::m_globalGeometry, MuonChamberResidual::m_sign, MuonChamberResidual::m_type, GeomDet::toLocal(), and PV3DBase< T, PVType, FrameType >::z().

14  align::GlobalVector zDirection(0., 0., 1.);
15  m_sign = m_globalGeometry->idToDet(m_chamberId)->toLocal(zDirection).z() > 0. ? 1. : -1.;
16 }
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
T z() const
Definition: PV3DBase.h:61
MuonChamberResidual(edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
const GeomDet * idToDet(DetId) const override
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
AlignableDetOrUnitPtr chamberAlignable() const

Member Function Documentation

◆ addResidual()

void MuonTrackCSCChamberResidual::addResidual ( edm::ESHandle< Propagator prop,
const TrajectoryStateOnSurface tsos,
const TrackingRecHit hit,
double  ,
double   
)
overridepure virtual

Implements MuonChamberResidual.

◆ setSegmentResidual()

void MuonTrackCSCChamberResidual::setSegmentResidual ( const reco::MuonChamberMatch trk,
const reco::MuonSegmentMatch seg 
)
overridevirtual

Implements MuonChamberResidual.

Definition at line 18 of file MuonTrackCSCChamberResidual.cc.

References CSCSegment::chi2(), reco::MuonSegmentMatch::cscSegmentRef, CSCSegment::degreesOfFreedom(), reco::MuonChamberMatch::dXdZ, reco::MuonSegmentMatch::dXdZ, reco::MuonChamberMatch::dXdZErr, reco::MuonSegmentMatch::dXdZErr, reco::MuonChamberMatch::dYdZ, reco::MuonSegmentMatch::dYdZ, reco::MuonChamberMatch::id, l1ctLayer2EG_cff::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(), conifer::pow(), DetId::rawId(), mathSSE::sqrt(), reco::MuonChamberMatch::x, reco::MuonSegmentMatch::x, reco::MuonChamberMatch::xErr, reco::MuonSegmentMatch::xErr, reco::MuonChamberMatch::y, and reco::MuonSegmentMatch::y.

19  {
20  CSCDetId id(trk->id.rawId());
21 
22  CSCSegmentRef segmentCSC = seg->cscSegmentRef;
23  if (segmentCSC.get() != nullptr) {
24  const CSCSegment *segment = segmentCSC.get();
25  m_numHits = segment->nRecHits();
26  m_ndof = segment->degreesOfFreedom();
27  m_chi2 = segment->chi2();
28  //std::cout<<"csc seg position = "<<segment->localPosition()<<" numhits="<<m_numHits<<" id: "<<id<<std::endl;
29  }
30 
31  align::LocalPoint l_seg(seg->x, seg->y, 0.);
32  align::LocalPoint l_trk(trk->x, trk->y, 0.);
33  //align::GlobalPoint g_seg = m_globalGeometry->idToDet(chamber)->toGlobal(l_seg);
34  //align::GlobalPoint g_trk = m_globalGeometry->idToDet(chamber)->toGlobal(l_trk);
35 
36  /*
37  double dphi = g_trk.phi() - g_seg.phi();
38  while (dphi > M_PI) dphi -= 2.*M_PI;
39  while (dphi < -M_PI) dphi += 2.*M_PI;
40  m_residual = - m_sign * g_trk.perp() * dphi; // coming from global, need to adjust the sign
41  std::cout<<"cscres="<<m_residual<<" dx="<<trk->x-seg->x<<" diff="<<trk->x-seg->x - m_residual<<std::endl;
42  */
43  m_residual = trk->x - seg->x;
44  m_residual_error = sqrt(pow(trk->xErr, 2) + pow(seg->xErr, 2));
45  m_resslope = trk->dXdZ - seg->dXdZ;
46  m_resslope_error = sqrt(pow(trk->dXdZErr, 2) + pow(seg->dXdZErr, 2));
47 
48  m_trackx = trk->x;
49  m_tracky = trk->y;
50  m_trackdxdz = trk->dXdZ;
51  m_trackdydz = trk->dYdZ;
52 
53  m_segx = seg->x;
54  m_segy = seg->y;
55  m_segdxdz = seg->dXdZ;
56  m_segdydz = seg->dYdZ;
57 
58  //double yresidual_error = sqrt( pow(trk->yErr, 2) + pow(seg->yErr, 2) );
59  //double yresslope_error = sqrt( pow(trk->dYdZErr, 2) + pow(seg->dYdZErr, 2) );
60  //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;
61  //std::cout<<"csc trk "<<m_trackx<<" "<<m_tracky<<" "<<m_trackdxdz<<" "<<m_trackdydz<<std::endl;
62  //std::cout<<"csc seg "<<m_segx<<" "<<m_segy<<" "<<m_segdxdz<<" "<<m_segdydz<<std::endl;
63 }
CSCSegmentRef cscSegmentRef
constexpr int pow(int x)
Definition: conifer.h:24
double chi2() const override
Chi2 of the segment fit.
Definition: CSCSegment.h:58
T sqrt(T t)
Definition: SSEVec.h:19
int nRecHits() const
Definition: CSCSegment.h:68
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
Definition: CSCSegment.h:62
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57