CMS 3D CMS Logo

MuonChi2MeasurementEstimator.cc
Go to the documentation of this file.
1 
11 
17 
20  theDTChi2Estimator(maxChi2, nSigma),
21  theCSCChi2Estimator(maxChi2, nSigma),
22  theRPCChi2Estimator(maxChi2, nSigma) {}
23 
25  double cscMaxChi2,
26  double rpcMaxChi2,
27  double nSigma = 3.)
29  theDTChi2Estimator(dtMaxChi2, nSigma),
30  theCSCChi2Estimator(cscMaxChi2, nSigma),
31  theRPCChi2Estimator(rpcMaxChi2, nSigma) {}
32 
34  const TrackingRecHit& recHit) const {
35  DetId id = recHit.geographicalId();
36 
37  // chi2 choise based on recHit provenance
38  if (id.det() == DetId::Muon) {
39  if (id.subdetId() == MuonSubdetId::DT)
40  return theDTChi2Estimator.estimate(tsos, recHit);
41  else if (id.subdetId() == MuonSubdetId::CSC)
42  return theCSCChi2Estimator.estimate(tsos, recHit);
43  else if (id.subdetId() == MuonSubdetId::RPC)
44  return theRPCChi2Estimator.estimate(tsos, recHit);
45  else {
46  edm::LogWarning("Muon|RecoMuon|MuonChi2MeasurementEstimator")
47  << "RecHit with MuonId but not with a SubDetId neither from DT, CSC or rpc. [Use the parameters used for "
48  "DTs]";
49  return theDTChi2Estimator.estimate(tsos, recHit);
50  }
51  } else {
52  edm::LogWarning("Muon|RecoMuon|MuonChi2MeasurementEstimator")
53  << "Rechit with a non-muon det id. [Use the parameters used for DTs]";
54  return theDTChi2Estimator.estimate(tsos, recHit);
55  }
56 }
MuonChi2MeasurementEstimator(double maxChi2, double nSigma=3.)
Constructor detector indipendent.
std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Chi2MeasurementEstimator theDTChi2Estimator
Definition: DetId.h:17
static constexpr int RPC
Definition: MuonSubdetId.h:13
Chi2MeasurementEstimator theRPCChi2Estimator
Chi2MeasurementEstimator theCSCChi2Estimator
static constexpr int DT
Definition: MuonSubdetId.h:11
Log< level::Warning, false > LogWarning
static constexpr int CSC
Definition: MuonSubdetId.h:12
std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Chi2 estimator.