CMS 3D CMS Logo

Namespaces | Functions
MuonSelectors.cc File Reference
#include "DataFormats/MuonReco/interface/MuonSelectors.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
#include "DataFormats/MuonDetId/interface/CSCDetId.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/MuonReco/interface/MuonRPCHitMatch.h"

Go to the source code of this file.

Namespaces

 muon
 

Functions

bool outOfTimeMuon (const reco::Muon &muon)
 
SelectionType muon::selectionTypeFromString (const std::string &label)
 

Function Documentation

bool outOfTimeMuon ( const reco::Muon muon)

Definition at line 970 of file MuonSelectors.cc.

References reco::Muon::rpcTime(), and reco::Muon::time().

Referenced by muon::setCutBasedSelectorFlags().

970  {
971  const auto& combinedTime = muon.time();
972  const auto& rpcTime = muon.rpcTime();
973  bool combinedTimeIsOk = (combinedTime.nDof>7);
974  bool rpcTimeIsOk = (rpcTime.nDof>1 && fabs(rpcTime.timeAtIpInOutErr)<0.001);
975  bool outOfTime = false;
976  if (rpcTimeIsOk){
977  if ( (fabs(rpcTime.timeAtIpInOut)>10 ) &&
978  !(combinedTimeIsOk && fabs(combinedTime.timeAtIpInOut)<10) )
979  outOfTime = true;
980  } else {
981  if (combinedTimeIsOk && (combinedTime.timeAtIpInOut>20 || combinedTime.timeAtIpInOut<-45))
982  outOfTime = true;
983  }
984  return outOfTime;
985 }
MuonTime time() const
get DT/CSC combined timing information
Definition: Muon.h:131
MuonTime rpcTime() const
get RPC timing information
Definition: Muon.h:135