CMS 3D CMS Logo

Public Member Functions | Public Attributes

reco::MuonChamberMatch Class Reference

#include <MuonChamberMatch.h>

List of all members.

Public Member Functions

int detector () const
float dist () const
float distErr () const
std::pair< float, float > getDistancePair (float edgeX, float edgeY, float xErr, float yErr) const
int station () const

Public Attributes

float dXdZ
float dXdZErr
float dYdZ
float dYdZErr
float edgeX
float edgeY
DetId id
std::vector
< reco::MuonRPCHitMatch
rpcMatches
std::vector
< reco::MuonSegmentMatch
segmentMatches
std::vector
< reco::MuonSegmentMatch
truthMatches
float x
float xErr
float y
float yErr

Detailed Description

Definition at line 10 of file MuonChamberMatch.h.


Member Function Documentation

int reco::MuonChamberMatch::detector ( ) const [inline]

Definition at line 27 of file MuonChamberMatch.h.

Referenced by station().

{ return id.subdetId(); }
float reco::MuonChamberMatch::dist ( ) const [inline]

Definition at line 31 of file MuonChamberMatch.h.

References edgeX, edgeY, getDistancePair(), xErr, and yErr.

{ return getDistancePair(edgeX, edgeY, xErr, yErr).first; }        // distance to absolute closest edge
float reco::MuonChamberMatch::distErr ( ) const [inline]

Definition at line 32 of file MuonChamberMatch.h.

References edgeX, edgeY, getDistancePair(), xErr, and yErr.

{ return getDistancePair(edgeX, edgeY, xErr, yErr).second; }    // propagation uncertainty in above distance
std::pair< float, float > MuonChamberMatch::getDistancePair ( float  edgeX,
float  edgeY,
float  xErr,
float  yErr 
) const

Definition at line 26 of file MuonChamberMatch.cc.

References edgeX, edgeY, error, mathSSE::sqrt(), xErr, and yErr.

Referenced by dist(), and distErr().

{
   if(edgeX>9E5&&edgeY>9E5&&xErr>9E5&&yErr>9E5) // there is no track
      return std::make_pair(999999, 999999);

   float distance = 999999;
   float error    = 999999;

   if(edgeX<0 && edgeY<0) {
      if(edgeX<edgeY) { distance = edgeY; error = yErr; }
      else { distance = edgeX; error = xErr; }
   }
   if(edgeX<0 && edgeY>0) { distance = edgeY; error = yErr; }
   if(edgeX>0 && edgeY<0) { distance = edgeX; error = xErr; }
   if(edgeX>0 && edgeY>0) { distance = sqrt(edgeX*edgeX+edgeY*edgeY); error = distance ? sqrt(edgeX*edgeX*xErr*xErr+edgeY*edgeY*yErr*yErr)/fabs(distance) : 0; }

   return std::make_pair(distance, error);
}
int MuonChamberMatch::station ( ) const

Definition at line 9 of file MuonChamberMatch.cc.

References MuonSubdetId::CSC, detector(), MuonSubdetId::DT, MuonSubdetId::RPC, RPCDetId::station(), DTChamberId::station(), and CSCDetId::station().

                                     {
   if( detector() ==  MuonSubdetId::DT ) {    // DT
      DTChamberId segId(id.rawId());
      return segId.station();
   }
   if( detector() == MuonSubdetId::CSC ) {    // CSC
      CSCDetId segId(id.rawId());
      return segId.station();
   }
   if( detector() == MuonSubdetId::RPC ) {    //RPC
      RPCDetId segId(id.rawId());
      return segId.station();
   }
   return -1; // is this appropriate? fix this
}

Member Data Documentation

Definition at line 15 of file MuonChamberMatch.h.

Referenced by dist(), distErr(), MuonIdProducer::fillMuonId(), and getDistancePair().

Definition at line 16 of file MuonChamberMatch.h.

Referenced by dist(), distErr(), MuonIdProducer::fillMuonId(), and getDistancePair().

Definition at line 14 of file MuonChamberMatch.h.

Definition at line 12 of file MuonChamberMatch.h.

Referenced by MuonIdProducer::fillMuonId().

Definition at line 13 of file MuonChamberMatch.h.