CMS 3D CMS Logo

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