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)
 
reco::Muon::Selector muon::selectorFromString (const std::string &label)
 

Function Documentation

◆ outOfTimeMuon()

bool outOfTimeMuon ( const reco::Muon muon)

Definition at line 1017 of file MuonSelectors.cc.

References funct::abs().

Referenced by muon::makeSelectorBitset().

1017  {
1018  const auto& combinedTime = muon.time();
1019  const auto& rpcTime = muon.rpcTime();
1020  bool combinedTimeIsOk = (combinedTime.nDof > 7);
1021  bool rpcTimeIsOk = (rpcTime.nDof > 1 && std::abs(rpcTime.timeAtIpInOutErr) < 0.001);
1022  bool outOfTime = false;
1023  if (rpcTimeIsOk) {
1024  if ((std::abs(rpcTime.timeAtIpInOut) > 10) && !(combinedTimeIsOk && std::abs(combinedTime.timeAtIpInOut) < 10))
1025  outOfTime = true;
1026  } else {
1027  if (combinedTimeIsOk && (combinedTime.timeAtIpInOut > 20 || combinedTime.timeAtIpInOut < -45))
1028  outOfTime = true;
1029  }
1030  return outOfTime;
1031 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22