CMS 3D CMS Logo

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

#include <SiStripRecHit1D.h>

Inheritance diagram for SiStripRecHit1D:
RecHit1D TrackingRecHit

Public Types

typedef edm::Ref
< edmNew::DetSetVector
< SiStripCluster >
, SiStripCluster
ClusterRef
 
typedef edm::Ref
< edm::LazyGetter
< SiStripCluster >
, SiStripCluster,
edm::FindValue< SiStripCluster > > 
ClusterRegionalRef
 
- 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 }
 

Public Member Functions

virtual SiStripRecHit1Dclone () const
 
ClusterRef const & cluster () const
 
ClusterRegionalRef const & cluster_regional () const
 
virtual void getKfComponents (KfComponentsHolder &holder) const
 
bool hasPositionAndError () const
 
virtual LocalPoint localPosition () const
 Local position. More...
 
virtual LocalError localPositionError () const
 Error on the local position. More...
 
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...
 
void setClusterRef (ClusterRef const &ref)
 
void setClusterRegionalRef (ClusterRegionalRef const &ref)
 
void setSigmaPitch (double sigmap) const
 
virtual bool sharesInput (const TrackingRecHit *other, SharedInputType what) const
 
double sigmaPitch () const
 
 SiStripRecHit1D ()
 
 SiStripRecHit1D (const LocalPoint &, const LocalError &, const DetId &, ClusterRef const &cluster)
 
 SiStripRecHit1D (const LocalPoint &, const LocalError &, const DetId &, ClusterRegionalRef const &cluster)
 
 SiStripRecHit1D (const SiStripRecHit2D *)
 method to facilitate the convesion from 2D to 1D hits More...
 
 ~SiStripRecHit1D ()
 
- Public Member Functions inherited from RecHit1D
virtual int dimension () const
 Return the RecHit dimension. More...
 
virtual AlgebraicVector parameters () const
 Return just the x. More...
 
virtual AlgebraicSymMatrix parametersError () const
 Return just "(sigma_x)^2". More...
 
virtual AlgebraicMatrix projectionMatrix () const
 Return the projection matrix. More...
 
 RecHit1D (DetId id)
 
 RecHit1D (TrackingRecHit::id_type id=0)
 
virtual ~RecHit1D ()
 Destructor. More...
 
- 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 * > &)
 
 TrackingRecHit (DetId id, Type type=valid)
 
 TrackingRecHit (id_type id=0, Type type=valid)
 
Type type () const
 
virtual float weight () const
 
virtual ~TrackingRecHit ()
 

Private Member Functions

void throwExceptionUninitialized (const char *where) const
 

Private Attributes

ClusterRef cluster_
 
ClusterRegionalRef clusterRegional_
 
LocalError err_
 
LocalPoint pos_
 
double sigmaPitch_
 cache for the matcher.... More...
 

Additional Inherited Members

- Protected Member Functions inherited from TrackingRecHit
void setId (id_type iid)
 
void setType (Type ttype)
 

Detailed Description

Definition at line 13 of file SiStripRecHit1D.h.

Member Typedef Documentation

Definition at line 21 of file SiStripRecHit1D.h.

Definition at line 26 of file SiStripRecHit1D.h.

Constructor & Destructor Documentation

SiStripRecHit1D::SiStripRecHit1D ( )
inline

Definition at line 16 of file SiStripRecHit1D.h.

Referenced by clone().

17  sigmaPitch_(-1.){}
ClusterRef cluster_
RecHit1D(DetId id)
Definition: RecHit1D.h:25
double sigmaPitch_
cache for the matcher....
ClusterRegionalRef clusterRegional_
SiStripRecHit1D::~SiStripRecHit1D ( )
inline

Definition at line 19 of file SiStripRecHit1D.h.

19 {}
SiStripRecHit1D::SiStripRecHit1D ( const LocalPoint pos,
const LocalError err,
const DetId id,
ClusterRef const &  cluster 
)

Definition at line 5 of file SiStripRecHit1D.cc.

7  :
8  RecHit1D(id),pos_(pos),err_(err),
11  sigmaPitch_(-1.)
12  {}
ClusterRef cluster_
RecHit1D(DetId id)
Definition: RecHit1D.h:25
ClusterRef const & cluster() const
double sigmaPitch_
cache for the matcher....
ClusterRegionalRef clusterRegional_
SiStripRecHit1D::SiStripRecHit1D ( const LocalPoint pos,
const LocalError err,
const DetId id,
ClusterRegionalRef const &  cluster 
)

Definition at line 15 of file SiStripRecHit1D.cc.

17  :
18  RecHit1D(id),pos_(pos),err_(err),
19  cluster_(),
21  sigmaPitch_(-1.) {}
ClusterRef cluster_
RecHit1D(DetId id)
Definition: RecHit1D.h:25
ClusterRef const & cluster() const
double sigmaPitch_
cache for the matcher....
ClusterRegionalRef clusterRegional_
SiStripRecHit1D::SiStripRecHit1D ( const SiStripRecHit2D hit2D)

method to facilitate the convesion from 2D to 1D hits

Definition at line 23 of file SiStripRecHit1D.cc.

References SiStripRecHit2D::cluster(), cluster_, SiStripRecHit2D::cluster_regional(), clusterRegional_, err_, edm::Ref< C, T, F >::isNonnull(), BaseSiTrackerRecHit2DLocalPos::localPositionError(), and LocalError::xx().

23  :
24  RecHit1D(hit2D->geographicalId()),pos_(hit2D->localPosition()),err_(),
26 {
27  err_ = LocalError (hit2D->localPositionError().xx(),0.,DBL_MAX);
28  if(hit2D->cluster().isNonnull()) cluster_ = hit2D->cluster();
30 }
float xx() const
Definition: LocalError.h:19
virtual LocalError localPositionError() const
ClusterRef cluster_
ClusterRegionalRef const & cluster_regional() const
virtual LocalPoint localPosition() const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:249
RecHit1D(DetId id)
Definition: RecHit1D.h:25
ClusterRef const & cluster() const
DetId geographicalId() const
double sigmaPitch_
cache for the matcher....
ClusterRegionalRef clusterRegional_

Member Function Documentation

virtual SiStripRecHit1D* SiStripRecHit1D::clone ( void  ) const
inlinevirtual

Implements TrackingRecHit.

Definition at line 34 of file SiStripRecHit1D.h.

References SiStripRecHit1D().

34 {return new SiStripRecHit1D( * this); }
ClusterRef const& SiStripRecHit1D::cluster ( ) const
inline
ClusterRegionalRef const& SiStripRecHit1D::cluster_regional ( ) const
inline
void SiStripRecHit1D::getKfComponents ( KfComponentsHolder holder) const
virtual

Reimplemented from TrackingRecHit.

Definition at line 49 of file SiStripRecHit1D.cc.

References err_, KfComponentsHolder::errors(), hasPositionAndError(), KfComponentsHolder::measuredErrors(), KfComponentsHolder::measuredParams(), KfComponentsHolder::params(), pos_, KfComponentsHolder::projection(), throwExceptionUninitialized(), KfComponentsHolder::tsosLocalErrors(), KfComponentsHolder::tsosLocalParameters(), PV3DBase< T, PVType, FrameType >::x(), and LocalError::xx().

Referenced by HelpertRecHit2DLocalPos::getKfComponents().

50 {
51  if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents");
52  AlgebraicVector1 & pars = holder.params<1>();
53  pars[0] = pos_.x();
54 
55  AlgebraicSymMatrix11 & errs = holder.errors<1>();
56  errs(0,0) = err_.xx();
57 
58  AlgebraicMatrix15 & proj = holder.projection<1>();
59  proj(0,3) = 1;
60 
61  holder.measuredParams<1>() = AlgebraicVector1( holder.tsosLocalParameters().At(3) );
62  holder.measuredErrors<1>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix11>( 3, 3 );
63 }
float xx() const
Definition: LocalError.h:19
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
ROOT::Math::SVector< double, 1 > AlgebraicVector1
bool hasPositionAndError() const
void throwExceptionUninitialized(const char *where) const
ROOT::Math::SMatrix< double, 1, 5, ROOT::Math::MatRepStd< double, 1, 5 > > AlgebraicMatrix15
AlgebraicROOTObject< D >::Vector & params()
const AlgebraicVector5 & tsosLocalParameters() const
AlgebraicROOTObject< D >::Vector & measuredParams()
AlgebraicROOTObject< D, D >::SymMatrix & errors()
AlgebraicROOTObject< D, 5 >::Matrix & projection()
T x() const
Definition: PV3DBase.h:56
const AlgebraicSymMatrix55 & tsosLocalErrors() const
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > AlgebraicSymMatrix11
bool SiStripRecHit1D::hasPositionAndError ( ) const

Definition at line 33 of file SiStripRecHit1D.cc.

References err_, pos_, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by getKfComponents(), localPosition(), localPositionError(), and TSiStripRecHit1D::TSiStripRecHit1D().

33  {
34  return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) ||
35  (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0);
36 }
float xx() const
Definition: LocalError.h:19
T y() const
Definition: PV3DBase.h:57
float xy() const
Definition: LocalError.h:20
float yy() const
Definition: LocalError.h:21
T z() const
Definition: PV3DBase.h:58
T x() const
Definition: PV3DBase.h:56
LocalPoint SiStripRecHit1D::localPosition ( ) const
virtual

Local position.

Implements RecHit1D.

Definition at line 38 of file SiStripRecHit1D.cc.

References hasPositionAndError(), pos_, and throwExceptionUninitialized().

Referenced by TSiStripRecHit1D::localPosition().

38  {
39  if (!hasPositionAndError()) throwExceptionUninitialized("localPosition");
40  return pos_;
41 }
bool hasPositionAndError() const
void throwExceptionUninitialized(const char *where) const
LocalError SiStripRecHit1D::localPositionError ( ) const
virtual

Error on the local position.

Implements RecHit1D.

Definition at line 43 of file SiStripRecHit1D.cc.

References err_, hasPositionAndError(), and throwExceptionUninitialized().

Referenced by TSiStripRecHit1D::localPositionError(), and TSiStripRecHit1D::parametersError().

43  {
44  if (!hasPositionAndError()) throwExceptionUninitialized("localPositionError");
45  return err_;
46 }
bool hasPositionAndError() const
void throwExceptionUninitialized(const char *where) const
std::vector< const TrackingRecHit * > SiStripRecHit1D::recHits ( ) const
virtual

Access to component RecHits (if any)

Implements TrackingRecHit.

Definition at line 124 of file SiStripRecHit1D.cc.

Referenced by TSiStripRecHit1D::recHits().

124  {
125  std::vector<const TrackingRecHit*> nullvector;
126  return nullvector;
127 }
std::vector< TrackingRecHit * > SiStripRecHit1D::recHits ( )
virtual

Non-const access to component RecHits (if any)

Implements TrackingRecHit.

Definition at line 128 of file SiStripRecHit1D.cc.

128  {
129  std::vector<TrackingRecHit*> nullvector;
130  return nullvector;
131 }
void SiStripRecHit1D::setClusterRef ( ClusterRef const &  ref)
inline
void SiStripRecHit1D::setClusterRegionalRef ( ClusterRegionalRef const &  ref)
inline

Definition at line 51 of file SiStripRecHit1D.h.

References clusterRegional_.

51 { clusterRegional_ = ref; }
ClusterRegionalRef clusterRegional_
void SiStripRecHit1D::setSigmaPitch ( double  sigmap) const
inline

Definition at line 56 of file SiStripRecHit1D.h.

References sigmaPitch_.

56 { sigmaPitch_=sigmap;}
double sigmaPitch_
cache for the matcher....
bool SiStripRecHit1D::sharesInput ( const TrackingRecHit other,
SharedInputType  what 
) const
virtual

Returns true if the two TrackingRecHits are using the same input information (like Digis, Clusters, etc), false otherwise. The second argument specifies how much sharing is needed in order to return true: the value "all" means that all inputs of the two hits must be identical; the value "some" means that at least one of the inputs is in common.

Reimplemented from TrackingRecHit.

Definition at line 68 of file SiStripRecHit1D.cc.

References TrackingRecHit::all, SiStripRecHit2D::cluster(), cluster(), cluster_, SiStripRecHit2D::cluster_regional(), cluster_regional(), clusterRegional_, TrackingRecHit::geographicalId(), i, edm::Ref< C, T, F >::isNonnull(), TrackingRecHit::isValid(), DetId::kSubdetOffset, DetId::rawId(), and TrackingRecHit::recHits().

70 {
71  //here we exclude non si-strip subdetectors
72  if( ((geographicalId().rawId()) >> (DetId::kSubdetOffset) ) != ( (other->geographicalId().rawId())>> (DetId::kSubdetOffset)) ) return false;
73 
74  //Protection against invalid hits
75  if(! other->isValid()) return false;
76 
77  const std::type_info & otherType = typeid(*other);
78  if (otherType == typeid(SiStripRecHit2D)) {
79  const SiStripRecHit2D* otherCast = static_cast<const SiStripRecHit2D*>(other);
80  // as 'null == null' is true, we can't just "or" the two equality tests: one of the two refs is always null! (gpetrucc)
81  if (cluster_.isNonnull()) {
82  return (cluster_ == otherCast->cluster());
83  } else {
84  return (clusterRegional_ == otherCast->cluster_regional());
85  }
86  } else if (otherType == typeid(SiStripRecHit1D)) {
87  const SiStripRecHit1D* otherCast = static_cast<const SiStripRecHit1D*>(other);
88  // as 'null == null' is true, we can't just "or" the two equality tests: one of the two refs is always null! (gpetrucc)
89  if (cluster_.isNonnull()) {
90  return (cluster_ == otherCast->cluster());
91  } else {
92  return (clusterRegional_ == otherCast->cluster_regional());
93  }
94  } else if (otherType == typeid(ProjectedSiStripRecHit2D)) {
95  const SiStripRecHit2D* otherCast = & (static_cast<const ProjectedSiStripRecHit2D*>(other)->originalHit());
96  // as 'null == null' is true, we can't just "or" the two equality tests: one of the two refs is always null! (gpetrucc)
97  if (cluster_.isNonnull()) {
98  return (cluster_ == otherCast->cluster());
99  } else {
100  return (clusterRegional_ == otherCast->cluster_regional());
101  }
102  } else if ((otherType == typeid(SiStripMatchedRecHit2D)) && (what == all)) {
103  return false;
104  } else {
105  // last resort, recur to 'recHits()', even if it returns a vector by value
106  std::vector<const TrackingRecHit*> otherHits = other->recHits();
107  int ncomponents=otherHits.size();
108  if(ncomponents==0)return false;
109  else if(ncomponents==1)return sharesInput(otherHits.front(),what);
110  else if (ncomponents>1){
111  if(what == all )return false;
112  else{
113  for(int i=0;i<ncomponents;i++){
114  if(sharesInput(otherHits[i],what))return true;
115  }
116  return false;
117  }
118  }
119  return false;
120  }
121 }
int i
Definition: DBlmapReader.cc:9
ClusterRef cluster_
ClusterRegionalRef const & cluster_regional() const
static const int kSubdetOffset
Definition: DetId.h:23
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:249
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
ClusterRef const & cluster() const
bool isValid() const
ClusterRegionalRef const & cluster_regional() const
ClusterRef const & cluster() const
DetId geographicalId() const
ClusterRegionalRef clusterRegional_
double SiStripRecHit1D::sigmaPitch ( ) const
inline

Definition at line 55 of file SiStripRecHit1D.h.

References sigmaPitch_.

55 { return sigmaPitch_;}
double sigmaPitch_
cache for the matcher....
void SiStripRecHit1D::throwExceptionUninitialized ( const char *  where) const
private

Definition at line 134 of file SiStripRecHit1D.cc.

References edm::hlt::Exception.

Referenced by getKfComponents(), localPosition(), and localPositionError().

135 {
136  throw cms::Exception("SiStripRecHit1D") <<
137  "Trying to access " << where << " for a RecHit that was read from disk, but since CMSSW_2_1_X local positions are transient.\n" <<
138  "If you want to get coarse position/error estimation from disk, please set: ComputeCoarseLocalPositionFromDisk = True \n " <<
139  " to the TransientTrackingRecHitBuilder you are using from RecoTracker/TransientTrackingRecHit/python/TTRHBuilders_cff.py";
140 }

Member Data Documentation

ClusterRef SiStripRecHit1D::cluster_
private

Definition at line 70 of file SiStripRecHit1D.h.

Referenced by cluster(), setClusterRef(), sharesInput(), and SiStripRecHit1D().

ClusterRegionalRef SiStripRecHit1D::clusterRegional_
private
LocalError SiStripRecHit1D::err_
private
LocalPoint SiStripRecHit1D::pos_
private

Definition at line 66 of file SiStripRecHit1D.h.

Referenced by getKfComponents(), hasPositionAndError(), and localPosition().

double SiStripRecHit1D::sigmaPitch_
mutableprivate

cache for the matcher....

Definition at line 76 of file SiStripRecHit1D.h.

Referenced by setSigmaPitch(), and sigmaPitch().