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

References funct::abs().

Referenced by muon::makeSelectorBitset().

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