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

References funct::abs().

Referenced by muon::makeSelectorBitset().

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