CMS 3D CMS Logo

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