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 969 of file MuonSelectors.cc.

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

Referenced by muon::setCutBasedSelectorFlags().

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