CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Chi2ChargeMeasurementEstimator Class Reference

#include <Chi2ChargeMeasurementEstimator.h>

Inheritance diagram for Chi2ChargeMeasurementEstimator:
Chi2MeasurementEstimator Chi2MeasurementEstimatorBase MeasurementEstimator

Public Member Functions

 Chi2ChargeMeasurementEstimator (double maxChi2, double nSigma, bool cutOnPixelCharge, bool cutOnStripCharge, double minGoodPixelCharge, double minGoodStripCharge, float pTChargeCutThreshold=100000.)
 
virtual
Chi2ChargeMeasurementEstimator
clone () const
 
virtual std::pair< bool, double > estimate (const TrajectoryStateOnSurface &, const TrackingRecHit &) const
 
- Public Member Functions inherited from Chi2MeasurementEstimator
 Chi2MeasurementEstimator (double maxChi2, double nSigma=3.)
 
template<unsigned int D>
std::pair< bool, double > estimate (const TrajectoryStateOnSurface &, const TrackingRecHit &) const
 
- Public Member Functions inherited from Chi2MeasurementEstimatorBase
 Chi2MeasurementEstimatorBase (double maxChi2, double nSigma=3.)
 
double chiSquaredCut () const
 
virtual bool estimate (const TrajectoryStateOnSurface &ts, const Plane &plane) const
 
virtual Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const Plane &plane) const
 
double nSigmaCut () const
 
- Public Member Functions inherited from MeasurementEstimator
virtual ~MeasurementEstimator ()
 

Private Member Functions

bool checkCharge (const TrackingRecHit &aRecHit, int subdet, float chargeCut) const
 
bool checkClusterCharge (const OmniClusterRef::ClusterStripRef cluster, float chargeCut) const
 
double minGoodCharge (int subdet) const
 
float sensorThickness (const DetId &detid) const
 
bool thickSensors (const SiStripDetId &detid) const
 

Private Attributes

bool cutOnPixelCharge_
 
bool cutOnStripCharge_
 
double minGoodPixelCharge_
 
double minGoodStripCharge_
 
float pTChargeCutThreshold_
 

Additional Inherited Members

- Public Types inherited from MeasurementEstimator
typedef std::pair< bool, double > HitReturnType
 
typedef Vector2DBase< float,
LocalTag
Local2DVector
 
typedef bool SurfaceReturnType
 
- Protected Member Functions inherited from Chi2MeasurementEstimatorBase
std::pair< bool, double > returnIt (double est) const
 

Detailed Description

A Chi2 Measurement Estimator, checking also the charge of the cluster. Computhes the Chi^2 of a TrajectoryState with a RecHit or a Plane. The TrajectoryState must have errors. If the cluster passes the chi2 cut, the charge is checked. This cut can be bypassed for high-pt cut. Works for any RecHit dimension.

Author
todorov, cerati, speer

Definition at line 20 of file Chi2ChargeMeasurementEstimator.h.

Constructor & Destructor Documentation

Chi2ChargeMeasurementEstimator::Chi2ChargeMeasurementEstimator ( double  maxChi2,
double  nSigma,
bool  cutOnPixelCharge,
bool  cutOnStripCharge,
double  minGoodPixelCharge,
double  minGoodStripCharge,
float  pTChargeCutThreshold = 100000. 
)
inlineexplicit

Construct with cuts on chi2 and nSigma. The cut on Chi2 is used to define the acceptance of RecHits. The errors of the trajectory state are multiplied by nSigma to define acceptance of Plane and maximalLocalDisplacement.

Definition at line 28 of file Chi2ChargeMeasurementEstimator.h.

References pTChargeCutThreshold_.

Referenced by clone().

30  :
31  Chi2MeasurementEstimator( maxChi2, nSigma), cutOnPixelCharge_(cutOnPixelCharge),
32  cutOnStripCharge_(cutOnStripCharge), minGoodPixelCharge_(minGoodPixelCharge),
33  minGoodStripCharge_(minGoodStripCharge) {
34  if (pTChargeCutThreshold>=0.) pTChargeCutThreshold_=pTChargeCutThreshold;
35  else pTChargeCutThreshold_=100000;
36  }
Chi2MeasurementEstimator(double maxChi2, double nSigma=3.)

Member Function Documentation

bool Chi2ChargeMeasurementEstimator::checkCharge ( const TrackingRecHit aRecHit,
int  subdet,
float  chargeCut 
) const
private

Definition at line 18 of file Chi2ChargeMeasurementEstimator.cc.

References checkClusterCharge(), OmniClusterRef::cluster_strip(), edm::hlt::Exception, BaseTrackerRecHit::firstClusterRef(), TrackingRecHit::getRTTI(), TrackingRecHit::hit(), likely, SiStripMatchedRecHit2D::monoClusterRef(), and SiStripMatchedRecHit2D::stereoClusterRef().

Referenced by estimate().

20 {
21  auto const & hit = aRecHit.hit(); // this works for both TRH and TTRH!
22 
23  if (aRecHit.getRTTI() == 4) {
24  const SiStripMatchedRecHit2D *matchHit = static_cast<const SiStripMatchedRecHit2D *>(hit);
25  if likely(matchHit!=0) return (checkClusterCharge(matchHit->monoClusterRef().cluster_strip(), chargeCut)
26  &&checkClusterCharge(matchHit->stereoClusterRef().cluster_strip(), chargeCut));
27  else{
28  const std::type_info &type = typeid(aRecHit);
29  throw cms::Exception("Unknown RecHit Type") << "checkCharge/SiStripMatchedRecHit2D: Wrong recHit type: " << type.name();
30  }
31  } else {
32  auto const & thit = static_cast<const BaseTrackerRecHit *>(hit);
33  auto const & clus = thit->firstClusterRef();
34  if (!clus.isPixel()) return checkClusterCharge(clus.cluster_strip(), chargeCut);
35  else return (clus.cluster_pixel()->charge()>chargeCut);
36  }
37 }
type
Definition: HCALResponse.h:21
return((rh^lh)&mask)
#define likely(x)
unsigned int getRTTI() const
virtual TrackingRecHit const * hit() const
virtual OmniClusterRef const & firstClusterRef() const =0
bool checkClusterCharge(const OmniClusterRef::ClusterStripRef cluster, float chargeCut) const
bool Chi2ChargeMeasurementEstimator::checkClusterCharge ( const OmniClusterRef::ClusterStripRef  cluster,
float  chargeCut 
) const
private

Definition at line 12 of file Chi2ChargeMeasurementEstimator.cc.

Referenced by checkCharge().

13 {
14  int clusCharge=accumulate( cluster->amplitudes().begin(), cluster->amplitudes().end(), uint16_t(0));
15  return (clusCharge>chargeCut);
16 }
virtual Chi2ChargeMeasurementEstimator* Chi2ChargeMeasurementEstimator::clone ( void  ) const
inlinevirtual

Reimplemented from Chi2MeasurementEstimator.

Definition at line 43 of file Chi2ChargeMeasurementEstimator.h.

References Chi2ChargeMeasurementEstimator().

43  {
44  return new Chi2ChargeMeasurementEstimator(*this);
45  }
Chi2ChargeMeasurementEstimator(double maxChi2, double nSigma, bool cutOnPixelCharge, bool cutOnStripCharge, double minGoodPixelCharge, double minGoodStripCharge, float pTChargeCutThreshold=100000.)
std::pair< bool, double > Chi2ChargeMeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const TrackingRecHit hit 
) const
virtual

Returns pair( true, value) if the TrajectoryStateOnSurface is compatible with the RecHit, and pair( false, value) if it is not compatible. The TrajectoryStateOnSurface must be on the same Surface as the RecHit. For an estimator where there is no value computed, e.g. fixed window estimator, only the first(bool) part is of interest.

Reimplemented from Chi2MeasurementEstimator.

Definition at line 56 of file Chi2ChargeMeasurementEstimator.cc.

References checkCharge(), cutOnPixelCharge_, cutOnStripCharge_, DetId::det(), cond::rpcobgas::detid, LocalTrajectoryParameters::dxdz(), LocalTrajectoryParameters::dydz(), Chi2MeasurementEstimator::estimate(), TrackingRecHit::geographicalId(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::localParameters(), minGoodCharge(), PV3DBase< T, PVType, FrameType >::perp(), pTChargeCutThreshold_, sensorThickness(), mathSSE::sqrt(), and DetId::subdetId().

57  {
58 
59 
60 
61  std::pair<bool,double> estimateResult = Chi2MeasurementEstimator::estimate(tsos, aRecHit);
62  if ( !estimateResult.first || (!(cutOnStripCharge_||cutOnPixelCharge_)) ||
63  (tsos.globalMomentum ().perp()>pTChargeCutThreshold_)) return estimateResult;
64 
65  SiStripDetId detid = aRecHit.geographicalId();
66  uint32_t subdet = detid.subdetId();
67  if((detid.det()==1) && (((subdet>2)&&cutOnStripCharge_) || ((subdet<3)&&cutOnPixelCharge_))) {
68 
69  float theDxdz = tsos.localParameters().dxdz();
70  float theDydz = tsos.localParameters().dydz();
71  float chargeCut = (float) minGoodCharge(subdet) * sensorThickness(detid)*(sqrt(1. + theDxdz*theDxdz + theDydz*theDydz));
72 
73  if (!checkCharge(aRecHit, subdet, chargeCut)) return HitReturnType(false,0.);
74  else return estimateResult;
75  }
76 
77  return estimateResult;
78 }
bool checkCharge(const TrackingRecHit &aRecHit, int subdet, float chargeCut) const
T sqrt(T t)
Definition: SSEVec.h:48
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
float sensorThickness(const DetId &detid) const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
std::pair< bool, double > HitReturnType
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
double Chi2ChargeMeasurementEstimator::minGoodCharge ( int  subdet) const
inlineprivate
float Chi2ChargeMeasurementEstimator::sensorThickness ( const DetId detid) const
private

Definition at line 41 of file Chi2ChargeMeasurementEstimator.cc.

References cond::rpcobgas::detid, SiStripDetId::moduleGeometry(), DetId::subdetId(), SiStripDetId::TIB, SiStripDetId::TOB, SiStripDetId::W5, SiStripDetId::W6, and SiStripDetId::W7.

Referenced by estimate().

42 {
43  if (detid.subdetId()>=SiStripDetId::TIB) {
44  SiStripDetId siStripDetId = detid();
45  if (siStripDetId.subdetId()==SiStripDetId::TOB) return 0.047;
46  if (siStripDetId.moduleGeometry()==SiStripDetId::W5 || siStripDetId.moduleGeometry()==SiStripDetId::W6 ||
47  siStripDetId.moduleGeometry()==SiStripDetId::W7)
48  return 0.047;
49  return 0.029; // so it is TEC ring 1-4 or TIB or TOB;
50  } else if (detid.subdetId()==1) return 0.0285;
51  else return 0.027;
52 }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
ModuleGeometry moduleGeometry() const
Definition: SiStripDetId.h:132
bool Chi2ChargeMeasurementEstimator::thickSensors ( const SiStripDetId detid) const
private

Member Data Documentation

bool Chi2ChargeMeasurementEstimator::cutOnPixelCharge_
private

Definition at line 47 of file Chi2ChargeMeasurementEstimator.h.

Referenced by estimate().

bool Chi2ChargeMeasurementEstimator::cutOnStripCharge_
private

Definition at line 48 of file Chi2ChargeMeasurementEstimator.h.

Referenced by estimate().

double Chi2ChargeMeasurementEstimator::minGoodPixelCharge_
private

Definition at line 49 of file Chi2ChargeMeasurementEstimator.h.

Referenced by minGoodCharge().

double Chi2ChargeMeasurementEstimator::minGoodStripCharge_
private

Definition at line 50 of file Chi2ChargeMeasurementEstimator.h.

Referenced by minGoodCharge().

float Chi2ChargeMeasurementEstimator::pTChargeCutThreshold_
private

Definition at line 51 of file Chi2ChargeMeasurementEstimator.h.

Referenced by Chi2ChargeMeasurementEstimator(), and estimate().