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 | Static Public Member Functions | Private Member Functions | Friends
MuonTransientTrackingRecHit Class Reference

#include <MuonTransientTrackingRecHit.h>

Inheritance diagram for MuonTransientTrackingRecHit:
GenericTransientTrackingRecHit TValidTrackingRecHit TransientTrackingRecHit TrackingRecHit ReferenceCountedPoolAllocated BlockWipedPoolAllocated

Public Types

typedef std::vector
< ConstMuonRecHitPointer
ConstMuonRecHitContainer
 
typedef
ConstReferenceCountingPointer
< MuonTransientTrackingRecHit
ConstMuonRecHitPointer
 
typedef std::vector
< MuonRecHitPointer
MuonRecHitContainer
 
typedef
ReferenceCountingPointer
< MuonTransientTrackingRecHit
MuonRecHitPointer
 
- Public Types inherited from GenericTransientTrackingRecHit
typedef TrackingRecHit::Type Type
 
- Public Types inherited from TValidTrackingRecHit
typedef std::vector
< ConstRecHitPointer
ConstRecHitContainer
 
typedef
ConstReferenceCountingPointer
< TransientTrackingRecHit
ConstRecHitPointer
 
typedef std::vector
< ConstRecHitPointer
RecHitContainer
 
typedef
ReferenceCountingPointer
< TransientTrackingRecHit
RecHitPointer
 
- 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 }
 

Public Member Functions

virtual double chi2 () const
 Chi square of the fit for segments, else 0. More...
 
virtual int degreesOfFreedom () const
 Degrees of freedom for segments, else 0. More...
 
virtual GlobalVector globalDirection () const
 Direction in 3D for segments, otherwise (0,0,0) More...
 
virtual GlobalError globalDirectionError () const
 Error on the global direction. More...
 
void invalidateHit ()
 
bool isCSC () const
 if this rec hit is a CSC rec hit More...
 
bool isDT () const
 if this rec hit is a DT rec hit More...
 
bool isRPC () const
 if this rec hit is a RPC rec hit More...
 
virtual LocalVector localDirection () const
 Direction in 3D for segments, otherwise (0,0,0) More...
 
virtual LocalError localDirectionError () const
 Error on the local direction. More...
 
virtual AlgebraicSymMatrix parametersError () const
 
virtual ConstRecHitContainer transientHits () const
 return the sub components of this transient rechit More...
 
virtual ~MuonTransientTrackingRecHit ()
 
- Public Member Functions inherited from GenericTransientTrackingRecHit
virtual bool canImproveWithTrack () const
 
TrackingRecHitcloneHit () const
 
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 TValidTrackingRecHit
TrackingRecHitcloneHit () const
 
virtual float clusterProbability () const
 cluster probability, overloaded by pixel rechits. More...
 
virtual const GeomDetdet () const GCC11_FINAL
 The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds. More...
 
float errorGlobalR () const GCC11_FINAL
 
float errorGlobalRPhi () const GCC11_FINAL
 
float errorGlobalZ () const GCC11_FINAL
 
virtual GlobalPoint globalPosition () const GCC11_FINAL
 
GlobalError globalPositionError () const GCC11_FINAL
 
TrackingRecHitGlobalState globalState () const
 
virtual const Surfacesurface () const GCC11_FINAL
 
 TValidTrackingRecHit (const GeomDet *geom)
 
template<typename... Args>
 TValidTrackingRecHit (const GeomDet *geom, Args &&...args)
 
- Public Member Functions inherited from TransientTrackingRecHit
virtual RecHitPointer clone (const TrajectoryStateOnSurface &) const
 
virtual const GeomDetUnitdetUnit () const
 
 TransientTrackingRecHit ()
 
 TransientTrackingRecHit (TrackingRecHit::id_type id, Type type=valid)
 
 TransientTrackingRecHit (TrackingRecHit const &rh)
 
virtual ~TransientTrackingRecHit ()
 
- Public Member Functions inherited from TrackingRecHit
DetId geographicalId () const
 
virtual void getKfComponents (KfComponentsHolder &holder) const
 
unsigned int getRTTI () const
 
Type getType () const
 
virtual bool hasPositionAndError () const
 to be redefined by daughter class More...
 
bool isValid () const
 
id_type rawId () 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)
 
 TrackingRecHit (DetId id, unsigned int rt, Type type=valid)
 
Type type () const
 
virtual float weight () 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)
 FIXME virtual ConstMuonRecHitContainer specificTransientHits() const;. More...
 
static MuonRecHitPointer specificBuild (const GeomDet *geom, const TrackingRecHit *rh)
 
- 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
MuonTransientTrackingRecHit
clone () const
 
 MuonTransientTrackingRecHit (const GeomDet *geom, const TrackingRecHit *rh)
 Construct from a TrackingRecHit and its GeomDet. More...
 
 MuonTransientTrackingRecHit (const MuonTransientTrackingRecHit &other)
 Copy ctor. More...
 

Friends

class kkkwwwxxxyyyzzz
 

Additional Inherited Members

- Static Public Attributes inherited from TrackingRecHit
static const int rttiShift = 24
 
static const int typeMask = 0xf
 
- 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
 
static bool s_usePool =false
 
- Protected Member Functions inherited from GenericTransientTrackingRecHit
 GenericTransientTrackingRecHit (const GeomDet *geom, const TrackingRecHit &rh)
 
 GenericTransientTrackingRecHit (const GeomDet *geom, TrackingRecHit *rh)
 for derived classes convenience, does not clone! More...
 
 GenericTransientTrackingRecHit (const GenericTransientTrackingRecHit &other)
 
- Protected Member Functions inherited from TrackingRecHit
void setId (id_type iid)
 
void setRTTI (unsigned int rt)
 
void setType (Type ttype)
 
- Protected Attributes inherited from GenericTransientTrackingRecHit
TrackingRecHittrackingRecHit_
 

Detailed Description

A TransientTrackingRecHit for muons.

Date:
2012/05/01 09:45:52
Revision:
1.18
Author
C. Liu Purdue University

Definition at line 19 of file MuonTransientTrackingRecHit.h.

Member Typedef Documentation

Definition at line 24 of file MuonTransientTrackingRecHit.h.

Definition at line 22 of file MuonTransientTrackingRecHit.h.

Definition at line 23 of file MuonTransientTrackingRecHit.h.

Definition at line 21 of file MuonTransientTrackingRecHit.h.

Constructor & Destructor Documentation

virtual MuonTransientTrackingRecHit::~MuonTransientTrackingRecHit ( )
inlinevirtual

Definition at line 26 of file MuonTransientTrackingRecHit.h.

26 {}
MuonTransientTrackingRecHit::MuonTransientTrackingRecHit ( const GeomDet geom,
const TrackingRecHit rh 
)
private

Construct from a TrackingRecHit and its GeomDet.

Definition at line 23 of file MuonTransientTrackingRecHit.cc.

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

23  :
GenericTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit &rh)
MuonTransientTrackingRecHit::MuonTransientTrackingRecHit ( const MuonTransientTrackingRecHit other)
private

Copy ctor.

Definition at line 26 of file MuonTransientTrackingRecHit.cc.

26  :
27  GenericTransientTrackingRecHit(other.det(), *(other.hit())) {}
virtual const TrackingRecHit * hit() const
virtual const GeomDet * det() const GCC11_FINAL
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
GenericTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit &rh)

Member Function Documentation

static RecHitPointer MuonTransientTrackingRecHit::build ( const GeomDet geom,
const TrackingRecHit rh 
)
inlinestatic

FIXME virtual ConstMuonRecHitContainer specificTransientHits() const;.

Definition at line 62 of file MuonTransientTrackingRecHit.h.

References MuonTransientTrackingRecHit().

Referenced by GlobalTrajectoryBuilderBase::fixTEC().

62  {
63  return RecHitPointer( new MuonTransientTrackingRecHit(geom, rh));
64  }
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
MuonTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit *rh)
Construct from a TrackingRecHit and its GeomDet.
double MuonTransientTrackingRecHit::chi2 ( void  ) const
virtual

Chi square of the fit for segments, else 0.

Definition at line 87 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

88 {
89  if (dynamic_cast<const RecSegment*>(hit()))
90  return dynamic_cast<const RecSegment*>(hit())->chi2();
91  else return 0.;
92 }
virtual double chi2() const
Chi square of the fit for segments, else 0.
virtual const TrackingRecHit * hit() const
virtual MuonTransientTrackingRecHit* MuonTransientTrackingRecHit::clone ( void  ) const
inlineprivatevirtual

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 82 of file MuonTransientTrackingRecHit.h.

References MuonTransientTrackingRecHit().

82  {
83  return new MuonTransientTrackingRecHit(*this);
84  }
MuonTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit *rh)
Construct from a TrackingRecHit and its GeomDet.
int MuonTransientTrackingRecHit::degreesOfFreedom ( ) const
virtual

Degrees of freedom for segments, else 0.

Definition at line 94 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

95 {
96  if (dynamic_cast<const RecSegment*>(hit()))
97  return dynamic_cast<const RecSegment*>(hit())->degreesOfFreedom();
98  else return 0;
99 }
virtual int degreesOfFreedom() const
Degrees of freedom for segments, else 0.
virtual const TrackingRecHit * hit() const
GlobalVector MuonTransientTrackingRecHit::globalDirection ( ) const
virtual

Direction in 3D for segments, otherwise (0,0,0)

Definition at line 46 of file MuonTransientTrackingRecHit.cc.

References TValidTrackingRecHit::det(), localDirection(), and TValidTrackingRecHit::surface().

47 {
48  return (det()->surface().toGlobal(localDirection()));
49 }
virtual const GeomDet * det() const GCC11_FINAL
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
virtual LocalVector localDirection() const
Direction in 3D for segments, otherwise (0,0,0)
virtual const Surface * surface() const GCC11_FINAL
GlobalError MuonTransientTrackingRecHit::globalDirectionError ( ) const
virtual

Error on the global direction.

Definition at line 51 of file MuonTransientTrackingRecHit.cc.

References TValidTrackingRecHit::det(), localDirectionError(), TValidTrackingRecHit::surface(), and ErrorFrameTransformer::transform().

52 {
54 }
static GlobalError transform(const LocalError &le, const Surface &surf)
virtual const GeomDet * det() const GCC11_FINAL
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
virtual LocalError localDirectionError() const
Error on the local direction.
virtual const Surface * surface() const GCC11_FINAL
void MuonTransientTrackingRecHit::invalidateHit ( )

Definition at line 175 of file MuonTransientTrackingRecHit.cc.

References TrackingRecHit::bad, GenericTransientTrackingRecHit::dimension(), isCSC(), isDT(), GenericTransientTrackingRecHit::recHits(), TrackingRecHit::setType(), and GenericTransientTrackingRecHit::trackingRecHit_.

175  {
177 
178 
179  if (isDT()){
180  if(dimension() > 1){ // MB4s have 2D, but formatted in 4D segments
181  std::vector<TrackingRecHit*> seg2D = recHits(); // 4D --> 2D
182  // load 1D hits (2D --> 1D)
183  for(std::vector<TrackingRecHit*>::iterator it = seg2D.begin(); it != seg2D.end(); ++it){
184  std::vector<TrackingRecHit*> hits1D = (*it)->recHits();
185  (*it)->setType(bad);
186  for(std::vector<TrackingRecHit*>::iterator it2 = hits1D.begin(); it2 != hits1D.end(); ++it2)
187  (*it2)->setType(bad);
188  }
189  }
190  }
191  else if(isCSC())
192  if(dimension() == 4){
193  std::vector<TrackingRecHit*> hits = recHits(); // load 2D hits (4D --> 1D)
194  for(std::vector<TrackingRecHit*>::iterator it = hits.begin(); it != hits.end(); ++it)
195  (*it)->setType(bad);
196  }
197 
198 
199 }
bool isCSC() const
if this rec hit is a CSC rec hit
bool isDT() const
if this rec hit is a DT rec hit
void setType(Type ttype)
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
bool MuonTransientTrackingRecHit::isCSC ( ) const

if this rec hit is a CSC rec hit

Definition at line 105 of file MuonTransientTrackingRecHit.cc.

References MuonSubdetId::CSC, and TrackingRecHit::geographicalId().

Referenced by invalidateHit().

105  {
106  return (geographicalId().subdetId() == MuonSubdetId::CSC);
107 }
static const int CSC
Definition: MuonSubdetId.h:15
DetId geographicalId() const
bool MuonTransientTrackingRecHit::isDT ( ) const

if this rec hit is a DT rec hit

Definition at line 101 of file MuonTransientTrackingRecHit.cc.

References MuonSubdetId::DT, and TrackingRecHit::geographicalId().

Referenced by invalidateHit(), and transientHits().

101  {
102  return (geographicalId().subdetId() == MuonSubdetId::DT);
103 }
static const int DT
Definition: MuonSubdetId.h:14
DetId geographicalId() const
bool MuonTransientTrackingRecHit::isRPC ( ) const

if this rec hit is a RPC rec hit

Definition at line 109 of file MuonTransientTrackingRecHit.cc.

References TrackingRecHit::geographicalId(), and MuonSubdetId::RPC.

109  {
110  return (geographicalId().subdetId() == MuonSubdetId::RPC);
111 }
static const int RPC
Definition: MuonSubdetId.h:16
DetId geographicalId() const
LocalVector MuonTransientTrackingRecHit::localDirection ( ) const
virtual

Direction in 3D for segments, otherwise (0,0,0)

Definition at line 30 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

Referenced by globalDirection().

30  {
31 
32  if (dynamic_cast<const RecSegment*>(hit()) )
33  return dynamic_cast<const RecSegment*>(hit())->localDirection();
34  else return LocalVector(0.,0.,0.);
35 
36 }
Local3DVector LocalVector
Definition: LocalVector.h:12
virtual const TrackingRecHit * hit() const
virtual LocalVector localDirection() const
Direction in 3D for segments, otherwise (0,0,0)
LocalError MuonTransientTrackingRecHit::localDirectionError ( ) const
virtual

Error on the local direction.

Definition at line 38 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

Referenced by globalDirectionError().

38  {
39 
40  if (dynamic_cast<const RecSegment*>(hit()))
41  return dynamic_cast<const RecSegment*>(hit())->localDirectionError();
42  else return LocalError(0.,0.,0.);
43 
44 }
virtual const TrackingRecHit * hit() const
virtual LocalError localDirectionError() const
Error on the local direction.
AlgebraicSymMatrix MuonTransientTrackingRecHit::parametersError ( ) const
virtual

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 57 of file MuonTransientTrackingRecHit.cc.

References TValidTrackingRecHit::det(), GeomDet::localAlignmentError(), GenericTransientTrackingRecHit::parametersError(), GenericTransientTrackingRecHit::projectionMatrix(), LocalError::valid(), LocalError::xx(), LocalError::xy(), and LocalError::yy().

57  {
58 
60 
62  if (lape.valid()) {
63 
64  // Just for speed up the code, the "else" branch can handle also the case of dim = 1.
65  if(err.num_row() == 1) err[0][0] += lape.xx();
66  else{
67  AlgebraicSymMatrix lapeMatrix(5,0);
68  lapeMatrix[3][3] = lape.xx();
69  lapeMatrix[3][4] = lape.xy();
70  lapeMatrix[4][4] = lape.yy();
71 
72  AlgebraicSymMatrix lapeMatrixProj = lapeMatrix.similarity(projectionMatrix());
73 
74  if(err.num_row() != lapeMatrixProj.num_row())
75  throw cms::Exception("MuonTransientTrackingRecHit::parametersError")
76  <<"Discrepancy between alignment error matrix and error matrix: APE "
77  << lapeMatrixProj.num_row()
78  << ", error matrix " << err.num_row()
79  << std::endl;
80 
81  err += lapeMatrixProj;
82  }
83  }
84  return err;
85 }
bool valid() const
Definition: LocalError.h:21
float xx() const
Definition: LocalError.h:24
virtual const GeomDet * det() const GCC11_FINAL
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
virtual AlgebraicMatrix projectionMatrix() const
float xy() const
Definition: LocalError.h:25
float yy() const
Definition: LocalError.h:26
virtual AlgebraicSymMatrix parametersError() const
LocalError const & localAlignmentError() const
Return local alligment error.
Definition: GeomDet.h:78
CLHEP::HepSymMatrix AlgebraicSymMatrix
static MuonRecHitPointer MuonTransientTrackingRecHit::specificBuild ( const GeomDet geom,
const TrackingRecHit rh 
)
inlinestatic
TransientTrackingRecHit::ConstRecHitContainer MuonTransientTrackingRecHit::transientHits ( ) const
virtual

return the sub components of this transient rechit

Reimplemented from TransientTrackingRecHit.

Definition at line 115 of file MuonTransientTrackingRecHit.cc.

References GeomDet::components(), filterCSVwithJSON::copy, TValidTrackingRecHit::det(), GenericTransientTrackingRecHit::dimension(), GeomDet::geographicalId(), isDT(), GenericTransientTrackingRecHit::recHits(), and tmp.

115  {
116 
117  ConstRecHitContainer theSubTransientRecHits;
118 
119  // the sub rec hit of this TransientRecHit
120  std::vector<const TrackingRecHit*> ownRecHits = recHits();
121 
122  if(ownRecHits.size() == 0){
123  theSubTransientRecHits.push_back(this);
124  return theSubTransientRecHits;
125  }
126 
127  // the components of the geom det on which reside this rechit
128  std::vector<const GeomDet *> geomDets = det()->components();
129 
130  if(isDT() && dimension() == 2 && ownRecHits.front()->dimension() == 1
131  && (geomDets.size() == 3 || geomDets.size() == 2) ){ // it is a phi segment!!
132 
133  std::vector<const GeomDet *> subGeomDets;
134 
135  int sl = 1;
136  for(std::vector<const GeomDet *>::const_iterator geoDet = geomDets.begin();
137  geoDet != geomDets.end(); ++geoDet){
138  if(sl != 3){ // FIXME!! this maybe is not always true
139  std::vector<const GeomDet *> tmp = (*geoDet)->components();
140  std::copy(tmp.begin(),tmp.end(),back_inserter(subGeomDets));
141  }
142  ++sl;
143  }
144  geomDets.clear();
145  geomDets = subGeomDets;
146  }
147 
148  // Fill the GeomDet map
149  std::map<DetId,const GeomDet*> gemDetMap;
150 
151  for (std::vector<const GeomDet*>::const_iterator subDet = geomDets.begin();
152  subDet != geomDets.end(); ++subDet)
153  gemDetMap[ (*subDet)->geographicalId() ] = *subDet;
154 
155  std::map<DetId,const GeomDet*>::iterator gemDetMap_iter;
156 
157  // Loop in order to check the ids
158  for (std::vector<const TrackingRecHit*>::const_iterator rechit = ownRecHits.begin();
159  rechit != ownRecHits.end(); ++rechit){
160 
161  gemDetMap_iter = gemDetMap.find( (*rechit)->geographicalId() );
162 
163  if(gemDetMap_iter != gemDetMap.end() )
164  theSubTransientRecHits.push_back(new MuonTransientTrackingRecHit(gemDetMap_iter->second,
165  *rechit) );
166  else if( (*rechit)->geographicalId() == det()->geographicalId() ) // Phi in DT is on Chamber
167  theSubTransientRecHits.push_back(new MuonTransientTrackingRecHit(det(),
168  *rechit) );
169  }
170  return theSubTransientRecHits;
171 
172 }
virtual const GeomDet * det() const GCC11_FINAL
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
bool isDT() const
if this rec hit is a DT rec hit
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
virtual std::vector< const GeomDet * > components() const =0
Returns direct components, if any.
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer

Friends And Related Function Documentation

friend class kkkwwwxxxyyyzzz
friend

Definition at line 74 of file MuonTransientTrackingRecHit.h.