CMS 3D CMS Logo

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

#include <TSiStripMatchedRecHit.h>

Inheritance diagram for TSiStripMatchedRecHit:
GenericTransientTrackingRecHit TransientTrackingRecHit TrackingRecHit ReferenceCountedPoolAllocated BlockWipedPoolAllocated

Classes

struct  DontCloneRecHit
 Dummy struct to pass to the constructor to say 'please don't clone the hit'. More...
 

Public Member Functions

virtual bool canImproveWithTrack () const
 
void clearPersistentHit ()
 
virtual RecHitPointer clone (const TrajectoryStateOnSurface &ts) const
 
void clonePersistentHit ()
 take ownership of the hit, if it wasn't owned (note: if it was owned, this code will leak it) More...
 
const GeomDetUnitdetUnit () const
 
virtual void getKfComponents (KfComponentsHolder &holder) const
 
virtual AlgebraicSymMatrix parametersError () const
 
virtual ConstRecHitContainer transientHits () const
 Composite interface: returns the component hits, if any. More...
 
- Public Member Functions inherited from GenericTransientTrackingRecHit
virtual int dimension () const
 
virtual const TrackingRecHithit () const
 
virtual LocalPoint localPosition () const
 
virtual LocalError localPositionError () const
 
virtual AlgebraicVector parameters () const
 
virtual AlgebraicMatrix projectionMatrix () const
 
virtual std::vector< const
TrackingRecHit * > 
recHits () const
 Access to component RecHits (if any) More...
 
virtual std::vector
< TrackingRecHit * > 
recHits ()
 Non-const access to component RecHits (if any) More...
 
virtual ~GenericTransientTrackingRecHit ()
 
- Public Member Functions inherited from TransientTrackingRecHit
virtual float clusterProbability () const
 cluster probability, overloaded by pixel rechits. More...
 
const GeomDetdet () const
 The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds. More...
 
float errorGlobalR () const
 
float errorGlobalRPhi () const
 
float errorGlobalZ () const
 
float getAnnealingFactor () const
 
virtual GlobalPoint globalPosition () const
 
virtual GlobalError globalPositionError () const
 
void setAnnealingFactor (float annealing)
 
void setWeight (float weight)
 interface needed to set the transient hit weight and to read it back More...
 
virtual const Surfacesurface () const
 
 TransientTrackingRecHit (const GeomDet *geom=0, float weight=1., float annealing=1.)
 
 TransientTrackingRecHit (const GeomDet *geom, DetId id, Type type=valid, float weight=1., float annealing=1.)
 
 TransientTrackingRecHit (const GeomDet *geom, TrackingRecHit::id_type id, Type type=valid, float weight=1., float annealing=1.)
 
 TransientTrackingRecHit (const GeomDet *geom, TrackingRecHit const &rh, float weight=1., float annealing=1.)
 
float weight () const
 
- Public Member Functions inherited from TrackingRecHit
DetId geographicalId () const
 
Type getType () const
 
bool isValid () const
 
virtual void recHitsV (std::vector< const TrackingRecHit * > &) const
 
virtual void recHitsV (std::vector< TrackingRecHit * > &)
 
virtual bool sharesInput (const TrackingRecHit *other, SharedInputType what) const
 
 TrackingRecHit (DetId id, Type type=valid)
 
 TrackingRecHit (id_type id=0, Type type=valid)
 
Type type () const
 
virtual ~TrackingRecHit ()
 
- Public Member Functions inherited from ReferenceCountedPoolAllocated
void addReference () const
 
const
ReferenceCountedPoolAllocated
operator= (const ReferenceCountedPoolAllocated &)
 
 ReferenceCountedPoolAllocated ()
 
 ReferenceCountedPoolAllocated (const ReferenceCountedPoolAllocated &iRHS)
 
unsigned int references () const
 
void removeReference () const
 
virtual ~ReferenceCountedPoolAllocated ()
 
- Public Member Functions inherited from BlockWipedPoolAllocated
virtual ~BlockWipedPoolAllocated ()
 

Static Public Member Functions

static RecHitPointer build (const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, float weight=1., float annealing=1., bool computeCoarseLocalPosition=false)
 
static RecHitPointer build (const GeomDet *geom, std::auto_ptr< TrackingRecHit > rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, float weight=1., float annealing=1., bool computeCoarseLocalPosition=false)
 
static void buildInPlace (std::auto_ptr< TSiStripMatchedRecHit > &memory, const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, float weight=1., float annealing=1., bool computeCoarseLocalPosition=false)
 
- Static Public Member Functions inherited from GenericTransientTrackingRecHit
static RecHitPointer build (const GeomDet *geom, const TrackingRecHit *rh)
 
- Static Public Member Functions inherited from BlockWipedPoolAllocated
static BlockWipedAllocatorallocator (size_t s)
 
static void operator delete (void *p, size_t s)
 
static void * operator new (size_t s, void *p)
 
static void * operator new (size_t s)
 
static BlockWipedAllocator::Stat stat (size_t s)
 
static void usePool ()
 

Private Member Functions

virtual TSiStripMatchedRecHitclone () const
 
void ComputeCoarseLocalPosition ()
 
 TSiStripMatchedRecHit (const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, float weight, float annealing, bool computeCoarseLocalPosition)
 
 TSiStripMatchedRecHit (const GeomDet *geom, std::auto_ptr< TrackingRecHit > rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, float weight, float annealing, bool computeCoarseLocalPosition)
 
 TSiStripMatchedRecHit (const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, float weight, float annealing, bool computeCoarseLocalPosition, const DontCloneRecHit &)
 

Private Attributes

const
StripClusterParameterEstimator
theCPE
 
const SiStripRecHitMatchertheMatcher
 

Additional Inherited Members

- Public Types inherited from GenericTransientTrackingRecHit
typedef TrackingRecHit::Type Type
 
- Public Types inherited from TransientTrackingRecHit
typedef std::vector
< ConstRecHitPointer
ConstRecHitContainer
 
typedef
ConstReferenceCountingPointer
< TransientTrackingRecHit
ConstRecHitPointer
 
typedef std::vector
< ConstRecHitPointer
RecHitContainer
 
typedef
ReferenceCountingPointer
< TransientTrackingRecHit
RecHitPointer
 
- Public Types inherited from TrackingRecHit
typedef unsigned int id_type
 
enum  SharedInputType { all, some }
 definition of equality via shared input More...
 
enum  Type { valid = 0, missing = 1, inactive = 2, bad = 3 }
 
- Static Public Attributes inherited from ReferenceCountedPoolAllocated
static int s_alive =0
 
static int s_referenced =0
 
- Static Public Attributes inherited from BlockWipedPoolAllocated
static int s_alive =0
 
- Protected Member Functions inherited from GenericTransientTrackingRecHit
 GenericTransientTrackingRecHit (const GeomDet *geom, const TrackingRecHit &rh, float weight=1., float annealing=1.)
 
 GenericTransientTrackingRecHit (const GeomDet *geom, TrackingRecHit *rh, float weight=1., float annealing=1.)
 for derived classes convenience, does not clone! More...
 
 GenericTransientTrackingRecHit (const GenericTransientTrackingRecHit &other)
 
- Protected Member Functions inherited from TrackingRecHit
void setId (id_type iid)
 
void setType (Type ttype)
 
- Protected Attributes inherited from GenericTransientTrackingRecHit
TrackingRecHittrackingRecHit_
 

Detailed Description

Definition at line 13 of file TSiStripMatchedRecHit.h.

Constructor & Destructor Documentation

TSiStripMatchedRecHit::TSiStripMatchedRecHit ( const GeomDet geom,
const TrackingRecHit rh,
const SiStripRecHitMatcher matcher,
const StripClusterParameterEstimator cpe,
float  weight,
float  annealing,
bool  computeCoarseLocalPosition 
)
inlineprivate

Definition at line 76 of file TSiStripMatchedRecHit.h.

References ComputeCoarseLocalPosition().

Referenced by build(), buildInPlace(), and clone().

80  :
81  GenericTransientTrackingRecHit(geom, *rh, weight, annealing), theMatcher(matcher),theCPE(cpe) {
82  if (computeCoarseLocalPosition) ComputeCoarseLocalPosition();
83  }
const StripClusterParameterEstimator * theCPE
const SiStripRecHitMatcher * theMatcher
GenericTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit &rh, float weight=1., float annealing=1.)
TSiStripMatchedRecHit::TSiStripMatchedRecHit ( const GeomDet geom,
std::auto_ptr< TrackingRecHit rh,
const SiStripRecHitMatcher matcher,
const StripClusterParameterEstimator cpe,
float  weight,
float  annealing,
bool  computeCoarseLocalPosition 
)
inlineprivate

Definition at line 85 of file TSiStripMatchedRecHit.h.

References ComputeCoarseLocalPosition().

89  :
90  GenericTransientTrackingRecHit(geom, rh.release(), weight, annealing), theMatcher(matcher),theCPE(cpe) {
91  if (computeCoarseLocalPosition) ComputeCoarseLocalPosition();
92  }
const StripClusterParameterEstimator * theCPE
const SiStripRecHitMatcher * theMatcher
GenericTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit &rh, float weight=1., float annealing=1.)
TSiStripMatchedRecHit::TSiStripMatchedRecHit ( const GeomDet geom,
const TrackingRecHit rh,
const SiStripRecHitMatcher matcher,
const StripClusterParameterEstimator cpe,
float  weight,
float  annealing,
bool  computeCoarseLocalPosition,
const DontCloneRecHit  
)
inlineprivate

Definition at line 93 of file TSiStripMatchedRecHit.h.

References ComputeCoarseLocalPosition().

98  :
99  GenericTransientTrackingRecHit(geom, const_cast<TrackingRecHit *>(rh), weight, annealing), theMatcher(matcher),theCPE(cpe) {
100  if (computeCoarseLocalPosition) ComputeCoarseLocalPosition();
101  }
const StripClusterParameterEstimator * theCPE
const SiStripRecHitMatcher * theMatcher
GenericTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit &rh, float weight=1., float annealing=1.)

Member Function Documentation

static RecHitPointer TSiStripMatchedRecHit::build ( const GeomDet geom,
const TrackingRecHit rh,
const SiStripRecHitMatcher matcher,
const StripClusterParameterEstimator cpe = 0,
float  weight = 1.,
float  annealing = 1.,
bool  computeCoarseLocalPosition = false 
)
inlinestatic

Definition at line 26 of file TSiStripMatchedRecHit.h.

References TSiStripMatchedRecHit(), and TransientTrackingRecHit::weight().

Referenced by TkGluedMeasurementDet::HitCollectorForRecHits::add(), SiStripElectronSeedGenerator::altCheckHitsAndTSOS(), TkTransientTrackingRecHitBuilder::build(), SiStripElectronSeedGenerator::checkHitsAndTSOS(), clone(), and TkTransientTrackingRecHitBuilder::oldbuild().

30  {
31  return RecHitPointer( new TSiStripMatchedRecHit( geom, rh, matcher,cpe, weight, annealing, computeCoarseLocalPosition));
32  }
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
TSiStripMatchedRecHit(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, float weight, float annealing, bool computeCoarseLocalPosition)
static RecHitPointer TSiStripMatchedRecHit::build ( const GeomDet geom,
std::auto_ptr< TrackingRecHit rh,
const SiStripRecHitMatcher matcher,
const StripClusterParameterEstimator cpe = 0,
float  weight = 1.,
float  annealing = 1.,
bool  computeCoarseLocalPosition = false 
)
inlinestatic

Definition at line 34 of file TSiStripMatchedRecHit.h.

References TSiStripMatchedRecHit(), and TransientTrackingRecHit::weight().

38  {
39  return RecHitPointer( new TSiStripMatchedRecHit( geom, rh, matcher,cpe,weight, annealing, computeCoarseLocalPosition));
40  }
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
TSiStripMatchedRecHit(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, float weight, float annealing, bool computeCoarseLocalPosition)
static void TSiStripMatchedRecHit::buildInPlace ( std::auto_ptr< TSiStripMatchedRecHit > &  memory,
const GeomDet geom,
const TrackingRecHit rh,
const SiStripRecHitMatcher matcher,
const StripClusterParameterEstimator cpe = 0,
float  weight = 1.,
float  annealing = 1.,
bool  computeCoarseLocalPosition = false 
)
inlinestatic

Build this hit on the heap, but possibly starting from already allocated memory. if 'memory' is not null, it will call the placed delete, and then the placed new to make a new hit if 'memory' is null, it will fill it with a new heap-allocated hit both at entry and exit of this method any rechit in 'memory' DOES NOT own it's persistent rechit

Definition at line 53 of file TSiStripMatchedRecHit.h.

References TSiStripMatchedRecHit(), and TransientTrackingRecHit::weight().

Referenced by TkGluedMeasurementDet::HitCollectorForFastMeasurements::add().

58  {
59  if (memory.get()) {
60  memory->~TSiStripMatchedRecHit(); // call destructor
61  new (memory.get()) TSiStripMatchedRecHit( geom, rh, matcher,cpe,weight, annealing, computeCoarseLocalPosition, DontCloneRecHit());
62  } else {
63  memory.reset(new TSiStripMatchedRecHit( geom, rh, matcher,cpe,weight, annealing, computeCoarseLocalPosition, DontCloneRecHit()));
64  }
65  }
Definition: vlib.h:187
TSiStripMatchedRecHit(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, float weight, float annealing, bool computeCoarseLocalPosition)
virtual bool TSiStripMatchedRecHit::canImproveWithTrack ( ) const
inlinevirtual

Returns true if the clone( const TrajectoryStateOnSurface&) method returns an improved hit, false if it returns an identical copy. In order to avoid redundent copies one should call canImproveWithTrack() before calling clone( const TrajectoryStateOnSurface&).

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 43 of file TSiStripMatchedRecHit.h.

References theMatcher.

43 {return (theMatcher != 0);}
const SiStripRecHitMatcher * theMatcher
void TSiStripMatchedRecHit::clearPersistentHit ( )
inline

drop the pointer to the hit, so that it's not deleted by the destructor. you must call this before deleting the TSiStripMatchedRecHit IF AND ONLY IF it doesn't own the rechit

Definition at line 71 of file TSiStripMatchedRecHit.h.

References GenericTransientTrackingRecHit::trackingRecHit_.

TSiStripMatchedRecHit::RecHitPointer TSiStripMatchedRecHit::clone ( const TrajectoryStateOnSurface ts) const
virtual

Returns a copy of the hit with parameters and errors computed with respect to the TrajectoryStateOnSurface given as argument. For concrete hits not capable to improve their parameters and errors this method returns an exact copy, and is equivalent to clone() without arguments.

Reimplemented from TransientTrackingRecHit.

Definition at line 36 of file TSiStripMatchedRecHit.cc.

References build(), clone(), SiStripRecHit2D::cluster(), SiStripRecHit2D::cluster_regional(), TransientTrackingRecHit::det(), GeomDet::geographicalId(), TransientTrackingRecHit::getAnnealingFactor(), gluedToStereo(), GenericTransientTrackingRecHit::hit(), edm::Ref< C, T, F >::isNull(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), ClusterParameterEstimator< T >::localParameters(), SiStripRecHitMatcher::match(), GluedGeomDet::monoDet(), SiStripMatchedRecHit2D::monoHit(), GeomDet::position(), query::result, GluedGeomDet::stereoDet(), SiStripMatchedRecHit2D::stereoHit(), GeomDet::surface(), theCPE, theMatcher, GloballyPositioned< T >::toLocal(), and TransientTrackingRecHit::weight().

37 {
38  if (theMatcher != 0) {
39  const SiStripMatchedRecHit2D *orig = static_cast<const SiStripMatchedRecHit2D *> (this->hit());
40  const GeomDet *det = this->det();
41  const GluedGeomDet *gdet = static_cast<const GluedGeomDet *> (det);
42  //if ((orig == 0) || (gdet == 0)) return this->clone(); // or just die ?
43  LocalVector tkDir = (ts.isValid() ? ts.localDirection() :
44  det->surface().toLocal( det->position()-GlobalPoint(0,0,0)));
45 
46  if(theCPE != 0){
47  //approximation: the ts parameter on the glued surface are used on the mono
48  // and stereo surface to re-evaluate cluster parameter. A further propagation
49  //is slow// and useless (?) in this case.
50 
51  const SiStripMatchedRecHit2D* better;
52 
53  if(!orig->monoHit()->cluster().isNull()){
54  const SiStripCluster& monoclust = *orig->monoHit()->cluster();
55  const SiStripCluster& stereoclust = *orig->stereoHit()->cluster();
56 
58  theCPE->localParameters( monoclust, *gdet->monoDet(), ts);
60  theCPE->localParameters( stereoclust, *gdet->stereoDet(), gluedToStereo(ts, gdet));
61 
62  SiStripRecHit2D monoHit = SiStripRecHit2D( lvMono.first, lvMono.second,
63  gdet->monoDet()->geographicalId(),
64  orig->monoHit()->cluster());
65 
66  SiStripRecHit2D stereoHit = SiStripRecHit2D( lvStereo.first, lvStereo.second,
67  gdet->stereoDet()->geographicalId(),
68  orig->stereoHit()->cluster());
69  better = theMatcher->match(&monoHit,&stereoHit,gdet,tkDir);
70  }else{
71  const SiStripCluster& monoclust = *orig->monoHit()->cluster_regional();
72  const SiStripCluster& stereoclust = *orig->stereoHit()->cluster_regional();
74  theCPE->localParameters( monoclust, *gdet->monoDet(), ts);
76  theCPE->localParameters( stereoclust, *gdet->stereoDet(), gluedToStereo(ts, gdet));
77 
78  SiStripRecHit2D monoHit = SiStripRecHit2D( lvMono.first, lvMono.second,
79  gdet->monoDet()->geographicalId(),
80  orig->monoHit()->cluster_regional());
81 
82  SiStripRecHit2D stereoHit = SiStripRecHit2D( lvStereo.first, lvStereo.second,
83  gdet->stereoDet()->geographicalId(),
84  orig->stereoHit()->cluster_regional());
85  better = theMatcher->match(&monoHit,&stereoHit,gdet,tkDir);
86  }
87 
88  if (better == 0) {
89  //dm::LogWarning("TSiStripMatchedRecHit") << "Refitting of a matched rechit returns NULL";
90  return this->clone();
91  }
92 
94  delete better; //the ownership of the object is passed to the caller of the matcher
95  return result;
96 
97  }else{
98  const SiStripMatchedRecHit2D *better = theMatcher->match(orig,gdet,tkDir);
99  if (better == 0) {
100  //edm::LogWarning("TSiStripMatchedRecHit") << "Refitting of a matched rechit returns NULL";
101  return this->clone();
102  }
104  delete better; //the ownership of the object is passed to the caller of the matcher
105  return result;
106  }
107  }
108  return this->clone();
109 
110 }
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
SiStripMatchedRecHit2D * match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
const SiStripRecHit2D * stereoHit() const
LocalVector localDirection() const
virtual const TrackingRecHit * hit() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const StripClusterParameterEstimator * theCPE
ClusterRegionalRef const & cluster_regional() const
const LocalTrajectoryParameters & gluedToStereo(const TrajectoryStateOnSurface &tsos, const GluedGeomDet *gdet)
std::pair< LocalPoint, LocalError > LocalValues
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
bool isNull() const
Checks for null.
Definition: Ref.h:244
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
LocalPoint toLocal(const GlobalPoint &gp) const
const SiStripRecHitMatcher * theMatcher
tuple result
Definition: query.py:137
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
ClusterRef const & cluster() const
static RecHitPointer build(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, float weight=1., float annealing=1., bool computeCoarseLocalPosition=false)
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
const SiStripRecHit2D * monoHit() const
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
virtual TSiStripMatchedRecHit * clone() const
virtual TSiStripMatchedRecHit* TSiStripMatchedRecHit::clone ( void  ) const
inlineprivatevirtual

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 158 of file TSiStripMatchedRecHit.h.

References TSiStripMatchedRecHit().

Referenced by clone().

158  {
159  return new TSiStripMatchedRecHit(*this);
160  }
TSiStripMatchedRecHit(const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, float weight, float annealing, bool computeCoarseLocalPosition)
void TSiStripMatchedRecHit::clonePersistentHit ( )
inline

take ownership of the hit, if it wasn't owned (note: if it was owned, this code will leak it)

Definition at line 68 of file TSiStripMatchedRecHit.h.

References TrackingRecHit::clone(), and GenericTransientTrackingRecHit::trackingRecHit_.

virtual TrackingRecHit * clone() const =0
void TSiStripMatchedRecHit::ComputeCoarseLocalPosition ( )
inlineprivate

Definition at line 104 of file TSiStripMatchedRecHit.h.

References SiStripMatchedRecHit2D::clone(), SiStripRecHit2D::cluster(), SiStripRecHit2D::cluster_regional(), TransientTrackingRecHit::det(), GeomDet::geographicalId(), BaseSiTrackerRecHit2DLocalPos::hasPositionAndError(), edm::Ref< C, T, F >::isNull(), ClusterParameterEstimator< T >::localParameters(), LogDebug, SiStripRecHitMatcher::match(), GluedGeomDet::monoDet(), SiStripMatchedRecHit2D::monoHit(), GeomDet::position(), GluedGeomDet::stereoDet(), SiStripMatchedRecHit2D::stereoHit(), GeomDet::surface(), theCPE, theMatcher, GloballyPositioned< T >::toLocal(), and GenericTransientTrackingRecHit::trackingRecHit_.

Referenced by TSiStripMatchedRecHit().

104  {
105  if (!theCPE || !theMatcher) return;
106  const SiStripMatchedRecHit2D *orig = static_cast<const SiStripMatchedRecHit2D *> (trackingRecHit_);
107  if (orig && !orig->hasPositionAndError()){
108  LogDebug("TSiStripMatchedRecHit")<<"calculating coarse position/error.";
109  const GeomDet *det = this->det();
110  const GluedGeomDet *gdet = static_cast<const GluedGeomDet *> (det);
111  LocalVector tkDir = det->surface().toLocal( det->position()-GlobalPoint(0,0,0));
112 
113  const SiStripMatchedRecHit2D* better=0;
114 
115  if(!orig->monoHit()->cluster().isNull()){
116  const SiStripCluster& monoclust = *orig->monoHit()->cluster();
117  const SiStripCluster& stereoclust = *orig->stereoHit()->cluster();
118 
120  theCPE->localParameters( monoclust, *gdet->monoDet());
122  theCPE->localParameters( stereoclust, *gdet->stereoDet());
123 
124  SiStripRecHit2D monoHit = SiStripRecHit2D( lvMono.first, lvMono.second,
125  gdet->monoDet()->geographicalId(),
126  orig->monoHit()->cluster());
127 
128  SiStripRecHit2D stereoHit = SiStripRecHit2D( lvStereo.first, lvStereo.second,
129  gdet->stereoDet()->geographicalId(),
130  orig->stereoHit()->cluster());
131  better = theMatcher->match(&monoHit,&stereoHit,gdet,tkDir);
132  }else{
133  const SiStripCluster& monoclust = *orig->monoHit()->cluster_regional();
134  const SiStripCluster& stereoclust = *orig->stereoHit()->cluster_regional();
136  theCPE->localParameters( monoclust, *gdet->monoDet());
138  theCPE->localParameters( stereoclust, *gdet->stereoDet());
139 
140  SiStripRecHit2D monoHit = SiStripRecHit2D( lvMono.first, lvMono.second,
141  gdet->monoDet()->geographicalId(),
142  orig->monoHit()->cluster_regional());
143 
144  SiStripRecHit2D stereoHit = SiStripRecHit2D( lvStereo.first, lvStereo.second,
145  gdet->stereoDet()->geographicalId(),
146  orig->stereoHit()->cluster_regional());
147  better = theMatcher->match(&monoHit,&stereoHit,gdet,tkDir);
148 
149  }
150  if (!better) {
151  edm::LogWarning("TSiStripMatchedRecHit")<<"could not get a matching rechit.";
152  }else{
153  trackingRecHit_ = better->clone();
154  }
155  }
156  }
#define LogDebug(id)
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
SiStripMatchedRecHit2D * match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
const SiStripRecHit2D * stereoHit() const
virtual SiStripRecHit2D * clone() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const StripClusterParameterEstimator * theCPE
ClusterRegionalRef const & cluster_regional() const
std::pair< LocalPoint, LocalError > LocalValues
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
bool isNull() const
Checks for null.
Definition: Ref.h:244
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
LocalPoint toLocal(const GlobalPoint &gp) const
const SiStripRecHitMatcher * theMatcher
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
ClusterRef const & cluster() const
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
const SiStripRecHit2D * monoHit() const
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
const GeomDetUnit* TSiStripMatchedRecHit::detUnit ( ) const
inlinevirtual

CAUTION: the GeomDetUnit* is zero for composite hits (matched hits in the tracker, segments in the muon). Always check this pointer before using it!

Reimplemented from TransientTrackingRecHit.

Definition at line 24 of file TSiStripMatchedRecHit.h.

24 {return 0;}
virtual void TSiStripMatchedRecHit::getKfComponents ( KfComponentsHolder holder) const
inlinevirtual

Reimplemented from TrackingRecHit.

Definition at line 16 of file TSiStripMatchedRecHit.h.

References TransientTrackingRecHit::det(), HelpertRecHit2DLocalPos::getKfComponents(), and GenericTransientTrackingRecHit::hit().

16  {
18  }
virtual const TrackingRecHit * hit() const
static void getKfComponents(KfComponentsHolder &holder, const TrackingRecHit &hit2dLocalPos, const GeomDet &det)
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
virtual AlgebraicSymMatrix TSiStripMatchedRecHit::parametersError ( ) const
inlinevirtual

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 20 of file TSiStripMatchedRecHit.h.

References TransientTrackingRecHit::det(), GenericTransientTrackingRecHit::localPositionError(), and HelpertRecHit2DLocalPos::parError().

20  {
22  }
virtual LocalError localPositionError() const
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
static AlgebraicSymMatrix parError(const LocalError &le, const GeomDet &det)
TransientTrackingRecHit::ConstRecHitContainer TSiStripMatchedRecHit::transientHits ( ) const
virtual

Composite interface: returns the component hits, if any.

Reimplemented from TransientTrackingRecHit.

Definition at line 115 of file TSiStripMatchedRecHit.cc.

References TSiStripRecHit2DLocalPos::build(), TransientTrackingRecHit::det(), GenericTransientTrackingRecHit::hit(), GluedGeomDet::monoDet(), SiStripMatchedRecHit2D::monoHit(), query::result, GluedGeomDet::stereoDet(), SiStripMatchedRecHit2D::stereoHit(), and theCPE.

115  {
117 
118  const GluedGeomDet *gdet = static_cast<const GluedGeomDet *> (this->det());
119  const SiStripMatchedRecHit2D *orig = static_cast<const SiStripMatchedRecHit2D *> (this->hit());
120 
121  result.push_back(TSiStripRecHit2DLocalPos::build( gdet->monoDet(),orig->monoHit(),theCPE));
122  result.push_back(TSiStripRecHit2DLocalPos::build( gdet->stereoDet(),orig->stereoHit(),theCPE));
123  return result;
124 }
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
const SiStripRecHit2D * stereoHit() const
virtual const TrackingRecHit * hit() const
const StripClusterParameterEstimator * theCPE
static RecHitPointer build(const GeomDet *geom, const SiStripRecHit2D *rh, const StripClusterParameterEstimator *cpe, float weight=1., float annealing=1., bool computeCoarseLocalPosition=false)
tuple result
Definition: query.py:137
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
const SiStripRecHit2D * monoHit() const
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21

Member Data Documentation

const StripClusterParameterEstimator* TSiStripMatchedRecHit::theCPE
private

Definition at line 75 of file TSiStripMatchedRecHit.h.

Referenced by clone(), ComputeCoarseLocalPosition(), and transientHits().

const SiStripRecHitMatcher* TSiStripMatchedRecHit::theMatcher
private

Definition at line 74 of file TSiStripMatchedRecHit.h.

Referenced by canImproveWithTrack(), clone(), and ComputeCoarseLocalPosition().