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 Attributes
cms::HICSeedMeasurementEstimator Class Reference

#include <HICSeedMeasurementEstimator.h>

Inheritance diagram for cms::HICSeedMeasurementEstimator:
MeasurementEstimator

Public Member Functions

HICSeedMeasurementEstimatorclone () const
 
virtual
MeasurementEstimator::HitReturnType 
estimate (const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const
 
virtual
MeasurementEstimator::SurfaceReturnType 
estimate (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
 
double getPhi ()
 
double getZ ()
 
 HICSeedMeasurementEstimator (bool &trust, int nsig)
 
virtual
MeasurementEstimator::Local2DVector 
maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
 
double nSigmaCut () const
 
void set (double &phi, double &z)
 
- Public Member Functions inherited from MeasurementEstimator
virtual ~MeasurementEstimator ()
 

Private Attributes

int theNSigma
 
double thePhi
 
double theZ
 
bool trtrue
 

Additional Inherited Members

- Public Types inherited from MeasurementEstimator
typedef std::pair< bool, double > HitReturnType
 
typedef Vector2DBase< float,
LocalTag
Local2DVector
 
typedef bool SurfaceReturnType
 

Detailed Description

Definition at line 9 of file HICSeedMeasurementEstimator.h.

Constructor & Destructor Documentation

cms::HICSeedMeasurementEstimator::HICSeedMeasurementEstimator ( bool &  trust,
int  nsig 
)
inlineexplicit

Member Function Documentation

HICSeedMeasurementEstimator* cms::HICSeedMeasurementEstimator::clone ( void  ) const
inlinevirtual

Implements MeasurementEstimator.

Definition at line 32 of file HICSeedMeasurementEstimator.h.

References HICSeedMeasurementEstimator().

32  {
33  return new HICSeedMeasurementEstimator(*this);
34 }
HICSeedMeasurementEstimator(bool &trust, int nsig)
MeasurementEstimator::HitReturnType cms::HICSeedMeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const TransientTrackingRecHit 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.

Implements MeasurementEstimator.

Definition at line 7 of file HICSeedMeasurementEstimator.cc.

References FreeTrajectoryState::charge(), gather_cfg::cout, PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::freeTrajectoryState(), TransientTrackingRecHit::globalPosition(), TrackingRecHit::isValid(), GlobalTrajectoryParameters::momentum(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), thePhi, theZ, and PV3DBase< T, PVType, FrameType >::z().

9 {
10  double dfimean = 0.;
11  double dzmean = 0.;
12  double pi=4.*atan(1.);
13  double twopi=8.*atan(1.);
14 #ifdef DEBUG
15  std::cout<<" HICSeedMeasurementEstimator::estimate::start::eta "<<ts.freeTrajectoryState()->parameters().momentum().eta() <<std::endl;
16 #endif
17 
18 //
19 // For mixed are 0.8<|eta|<1.6 there is a shift for + and -
20 //
21  if( fabs(ts.freeTrajectoryState()->parameters().momentum().eta()) > 0.8 &&
22  fabs(ts.freeTrajectoryState()->parameters().momentum().eta()) < 1.6 )
23  {
24  dfimean = -0.14;
25  if( ts.freeTrajectoryState()->charge() > 0. ) dfimean = -0.24;
26  dzmean = -10.;
27  }
28  if( fabs(ts.freeTrajectoryState()->parameters().momentum().eta()) > 1.6 )
29  {
30  dfimean = -0.02;
31  if( ts.freeTrajectoryState()->charge() > 0. ) dfimean = -0.1776;
32  }
33 
34  if( !(hit.isValid()) ) {
35 #ifdef DEBUG
36  std::cout<<" HICSeedMeasurementEstimator::estimate::hit is not valid " <<std::endl;
37 #endif
38  return HitReturnType(false,0.);
39  }
40 
41 #ifdef DEBUG
42  std::cout<<" HICSeedMeasurementEstimator::estimate::hit is valid " <<std::endl;
43 #endif
44 
45 
46  double dfi = fabs( ts.freeTrajectoryState()->parameters().position().phi()-
47  hit.globalPosition().phi() + dfimean );
48  if(dfi>pi) dfi=twopi-dfi;
49 
50  if(dfi>thePhi) {
51 #ifdef DEBUG
52  std::cout<<"HICSeedMeasurementEstimator::estimate::failed::phi hit::phi fts::thePhi "<<hit.globalPosition().phi()<<" "<<
53  ts.freeTrajectoryState()->parameters().position().phi()<<" "<<dfi<<
54  " "<<thePhi<<std::endl;
55 #endif
56 
57  return HitReturnType(false,0.);
58  }
59  if( fabs(hit.globalPosition().z()) > 120.)
60  {
61 
62  if(fabs(hit.globalPosition().perp()-ts.freeTrajectoryState()->parameters().position().perp())
63  >theZ) {
64 #ifdef DEBUG
65  std::cout<<"HICSeedMeasurementEstimator::estimate::failed::r hit::r fts::theZ "<<hit.globalPosition().perp()<<" "<<
67  " "<<theZ<<std::endl;
68 #endif
69  return HitReturnType(false,0.);
70  }
71  }
72  else
73  {
74 
75  if(fabs(hit.globalPosition().z()-ts.freeTrajectoryState()->parameters().position().z() + dzmean)
76  >theZ) {
77 #ifdef DEBUG
78  std::cout<<"HICSeedMeasurementEstimator::estimate::failed::z hit::z fts::theZ "<<hit.globalPosition().z()<<" "<<
80  " "<<theZ<<std::endl;
81 #endif
82 
83  return HitReturnType(false,0.);
84  }
85  }
86 #ifdef DEBUG
87  std::cout<<"HICSeedMeasurementEstimator::estimate::accepted::phi::r::z "<<hit.globalPosition().phi()<<" "<<
88  hit.globalPosition().perp()<<" "<<
89  hit.globalPosition().z()<<
90  std::endl;
91 #endif
92 
93 return HitReturnType(true,1.);
94 }
T perp() const
Definition: PV3DBase.h:66
const GlobalTrajectoryParameters & parameters() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
TrackCharge charge() const
T z() const
Definition: PV3DBase.h:58
std::pair< bool, double > HitReturnType
bool isValid() const
T eta() const
Definition: PV3DBase.h:70
virtual GlobalPoint globalPosition() const
tuple cout
Definition: gather_cfg.py:41
double pi
MeasurementEstimator::SurfaceReturnType cms::HICSeedMeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const BoundPlane plane 
) const
virtual

Returns true if the TrajectoryStateOnSurface is compatible with the BoundPlane, false otherwise. The TrajectoryStateOnSurface must be on the plane.

Implements MeasurementEstimator.

Definition at line 96 of file HICSeedMeasurementEstimator.cc.

References BoundSurface::bounds(), gather_cfg::cout, TrajectoryStateOnSurface::freeTrajectoryState(), Bounds::length(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), pi, GloballyPositioned< T >::position(), GlobalTrajectoryParameters::position(), thePhi, theZ, Bounds::width(), tablePrinter::width, and PV3DBase< T, PVType, FrameType >::z().

98 {
99 
100  double pi=4.*atan(1.);
101  double twopi=8.*atan(1.);
102 
103 #ifdef DEBUG
104  std::cout<<"HICSeedMeasurementEstimator::estimate::Det::start::r,phi,z "<<plane.position().perp()<<" "<<plane.position().phi()<<" "<<
105  plane.position().z()<<std::endl;
106  std::cout<<"HICSeedMeasurementEstimator::estimate::Track::r,phi,z "<<ts.freeTrajectoryState()->parameters().position().perp()<<" "<<
107  ts.freeTrajectoryState()->parameters().position().phi()<<" "<<
108  ts.freeTrajectoryState()->parameters().position().z()<<std::endl;
109 #endif
110  double length = plane.bounds().length();
111  double width = plane.bounds().width();
112  double deltafi = atan2( width , (double)plane.position().perp() );
113  double phitrack = ts.freeTrajectoryState()->parameters().position().phi();
114  double phiplane = plane.position().phi();
115 
116  if( phitrack < 0. ) phitrack = twopi + phitrack;
117  if( phiplane < 0. ) phiplane = twopi + phiplane;
118 
119  double dphi = fabs(phitrack - phiplane);
120 
121  if( dphi > pi ) dphi = twopi - dphi;
122  if( dphi > thePhi + deltafi ) {
123 #ifdef DEBUG
124  std::cout<<"HICSeedMeasurementEstimator::estimate::Det::phi failed "<<dphi<<" "<<thePhi<<" "<<deltafi<<std::endl;
125 #endif
126  return false;
127  }
128  if ( fabs( plane.position().z() ) < 111. )
129  {
130  // barrel
131  if( fabs(ts.freeTrajectoryState()->parameters().position().z() - plane.position().z())
132  > theZ+length ) {
133 
134 #ifdef DEBUG
135  double dz = fabs(ts.freeTrajectoryState()->parameters().position().z() - plane.position().z());
136  std::cout<<"HICSeedMeasurementEstimator::estimate::Det::z failed "<<dz<<" "<<theZ<<" "<<length<<std::endl;
137 #endif
138 
139  return false;
140  }
141  }
142  else
143  {
144  // forward
145  if( fabs(ts.freeTrajectoryState()->parameters().position().perp() - plane.position().perp())
146  > theZ + length ) {
147 #ifdef DEBUG
148  double dr = fabs(ts.freeTrajectoryState()->parameters().position().perp() - plane.position().perp());
149  std::cout<<"HICSeedMeasurementEstimator::estimate::Det::r failed "<<dr<<" "<<theZ<<" "<<length<<std::endl;
150 #endif
151 
152  return false;
153  }
154  }
155 #ifdef DEBUG
156  std::cout<<" Good detector "<<std::endl;
157 #endif
158  return true;
159 }
virtual float length() const =0
T perp() const
Definition: PV3DBase.h:66
const GlobalTrajectoryParameters & parameters() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:58
const Bounds & bounds() const
Definition: BoundSurface.h:89
tuple cout
Definition: gather_cfg.py:41
double pi
virtual float width() const =0
const PositionType & position() const
double cms::HICSeedMeasurementEstimator::getPhi ( )
inline

Definition at line 30 of file HICSeedMeasurementEstimator.h.

References thePhi.

double cms::HICSeedMeasurementEstimator::getZ ( )
inline

Definition at line 28 of file HICSeedMeasurementEstimator.h.

References theZ.

MeasurementEstimator::Local2DVector cms::HICSeedMeasurementEstimator::maximalLocalDisplacement ( const TrajectoryStateOnSurface ts,
const BoundPlane plane 
) const
virtual

Returns the size of the compatibility region around the local position of the TrajectoryStateOnSurface along the directions of local x and y axis. The TrajectoryStateOnSurface must be on the plane. This method allows to limit the search for compatible detectors or RecHits. The MeasurementEstimator should not return "true" for any RecHit or BoundPlane which is entirely outside of the compatibility region defined by maximalLocalDisplacement().

Reimplemented from MeasurementEstimator.

Definition at line 162 of file HICSeedMeasurementEstimator.cc.

References gather_cfg::cout, TrajectoryStateOnSurface::hasError(), asciidump::le, TrajectoryStateOnSurface::localError(), nSigmaCut(), LocalTrajectoryError::positionError(), mathSSE::sqrt(), LocalError::xx(), and LocalError::yy().

164 {
165 #ifdef DEBUG
166  std::cout<<"HICSeedMeasurementEstimator::malLocalDisplacement::start"
167  <<ts.hasError()<<std::endl;
168 #endif
169 
170  if ( ts.hasError()) {
172 #ifdef DEBUG
173  std::cout<<"HICSeedMeasurementEstimator::malLocalDisplacement::localerror::sigma"<<Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut())<<std::endl;
174 #endif
175  return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
176  }
177  else return Local2DVector(0,0);
178 }
float xx() const
Definition: LocalError.h:19
Vector2DBase< float, LocalTag > Local2DVector
LocalError positionError() const
float yy() const
Definition: LocalError.h:21
T sqrt(T t)
Definition: SSEVec.h:28
const LocalTrajectoryError & localError() const
tuple cout
Definition: gather_cfg.py:41
double cms::HICSeedMeasurementEstimator::nSigmaCut ( ) const
inline

Definition at line 24 of file HICSeedMeasurementEstimator.h.

References theNSigma.

Referenced by maximalLocalDisplacement().

void cms::HICSeedMeasurementEstimator::set ( double &  phi,
double &  z 
)
inline

Member Data Documentation

int cms::HICSeedMeasurementEstimator::theNSigma
private

Definition at line 41 of file HICSeedMeasurementEstimator.h.

Referenced by nSigmaCut().

double cms::HICSeedMeasurementEstimator::thePhi
private

Definition at line 38 of file HICSeedMeasurementEstimator.h.

Referenced by estimate(), getPhi(), and set().

double cms::HICSeedMeasurementEstimator::theZ
private

Definition at line 39 of file HICSeedMeasurementEstimator.h.

Referenced by estimate(), getZ(), and set().

bool cms::HICSeedMeasurementEstimator::trtrue
private

Definition at line 40 of file HICSeedMeasurementEstimator.h.