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 Referencefinal

#include <MuonTransientTrackingRecHit.h>

Inheritance diagram for MuonTransientTrackingRecHit:
GenericTransientTrackingRecHit TValidTrackingRecHit TrackingRecHit

Public Types

typedef std::vector
< ConstMuonRecHitPointer
ConstMuonRecHitContainer
 
typedef
MuonTransientTrackingRecHit
const * 
ConstMuonRecHitPointer
 
typedef std::vector
< MuonRecHitPointer
MuonRecHitContainer
 
typedef
MuonTransientTrackingRecHit
MuonRecHitPointer
 
- Public Types inherited from GenericTransientTrackingRecHit
typedef TrackingRecHit::Type Type
 
- Public Types inherited from TrackingRecHit
typedef std::vector
< ConstRecHitPointer
ConstRecHitContainer
 
using ConstRecHitPointer = std::shared_ptr< TrackingRecHit const >
 
typedef unsigned int id_type
 
typedef std::vector
< ConstRecHitPointer
RecHitContainer
 
using RecHitPointer = std::shared_ptr< TrackingRecHit const >
 
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 override
 
virtual ConstRecHitContainer transientHits () const override
 return the sub components of this transient rechit More...
 
virtual ~MuonTransientTrackingRecHit ()
 
- Public Member Functions inherited from GenericTransientTrackingRecHit
virtual bool canImproveWithTrack () const override
 
TrackingRecHitcloneHit () const
 
virtual int dimension () const
 
virtual const TrackingRecHithit () const
 
virtual LocalPoint localPosition () const override
 
virtual LocalError localPositionError () const override
 
virtual AlgebraicVector parameters () const
 
virtual AlgebraicMatrix projectionMatrix () const
 
virtual std::vector< const
TrackingRecHit * > 
recHits () const override
 Access to component RecHits (if any) More...
 
virtual std::vector
< TrackingRecHit * > 
recHits () override
 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...
 
float errorGlobalR () const
 
float errorGlobalRPhi () const
 
float errorGlobalZ () const
 
virtual GlobalPoint globalPosition () const
 
GlobalError globalPositionError () const
 
TrackingRecHitGlobalState globalState () const
 
virtual const Surfacesurface () const
 
 TValidTrackingRecHit (const GeomDet &geom)
 
template<typename... Args>
 TValidTrackingRecHit (Args &&...args)
 
- Public Member Functions inherited from TrackingRecHit
RecHitPointer cloneForFit (const GeomDet &idet) const
 
virtual RecHitPointer cloneSH () const
 
const GeomDetdet () const
 
virtual const GeomDetUnitdetUnit () const
 
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 * > &)
 
void setDet (const GeomDet &idet)
 
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)
 
 TrackingRecHit (const GeomDet &idet, Type type=valid)
 
 TrackingRecHit (const GeomDet &idet, unsigned int rt, Type type=valid)
 
 TrackingRecHit (const GeomDet &idet, TrackingRecHit const &rh)
 
Type type () const
 
virtual float weight () const
 
virtual ~TrackingRecHit ()
 

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)
 

Private Member Functions

virtual
MuonTransientTrackingRecHit
clone () const override
 
 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
 
- 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.

Author
C. Liu Purdue University

Definition at line 17 of file MuonTransientTrackingRecHit.h.

Member Typedef Documentation

Definition at line 31 of file MuonTransientTrackingRecHit.h.

Definition at line 25 of file MuonTransientTrackingRecHit.h.

Definition at line 30 of file MuonTransientTrackingRecHit.h.

Definition at line 24 of file MuonTransientTrackingRecHit.h.

Constructor & Destructor Documentation

virtual MuonTransientTrackingRecHit::~MuonTransientTrackingRecHit ( )
inlinevirtual

Definition at line 33 of file MuonTransientTrackingRecHit.h.

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

Construct from a TrackingRecHit and its GeomDet.

Definition at line 21 of file MuonTransientTrackingRecHit.cc.

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

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

Copy ctor.

Definition at line 24 of file MuonTransientTrackingRecHit.cc.

24  :
25  GenericTransientTrackingRecHit(*other.det(), *(other.hit())) {}
GenericTransientTrackingRecHit(const GeomDet &geom, const TrackingRecHit &rh)
virtual const TrackingRecHit * hit() const
const GeomDet * det() const

Member Function Documentation

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

FIXME virtual ConstMuonRecHitContainer specificTransientHits() const;.

Definition at line 69 of file MuonTransientTrackingRecHit.h.

References MuonTransientTrackingRecHit().

Referenced by GlobalTrajectoryBuilderBase::fixTEC().

69  {
70  return RecHitPointer( new MuonTransientTrackingRecHit(geom, rh));
71  }
MuonTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit *rh)
Construct from a TrackingRecHit and its GeomDet.
std::shared_ptr< TrackingRecHit const > RecHitPointer
double MuonTransientTrackingRecHit::chi2 ( void  ) const
virtual

Chi square of the fit for segments, else 0.

Definition at line 85 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

Referenced by CosmicMuonSeedGenerator::checkQuality(), and MuonSeedCleaner::NChi2OfSegment().

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

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 89 of file MuonTransientTrackingRecHit.h.

References MuonTransientTrackingRecHit().

Referenced by transientHits().

89  {
90  return new MuonTransientTrackingRecHit(*this);
91  }
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 92 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

Referenced by CosmicMuonSeedGenerator::leftIsBetter(), and MuonSeedCleaner::NChi2OfSegment().

93 {
94  if (dynamic_cast<const RecSegment*>(hit()))
95  return dynamic_cast<const RecSegment*>(hit())->degreesOfFreedom();
96  else return 0;
97 }
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 44 of file MuonTransientTrackingRecHit.cc.

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

Referenced by CosmicMuonSeedGenerator::areCorrelated(), CosmicMuonSeedGenerator::createSeed(), and MuonSeedOrcaPatternRecognition::discriminator().

45 {
46  return (det()->surface().toGlobal(localDirection()));
47 }
virtual LocalVector localDirection() const
Direction in 3D for segments, otherwise (0,0,0)
const GeomDet * det() const
virtual const Surface * surface() const
GlobalError MuonTransientTrackingRecHit::globalDirectionError ( ) const
virtual

Error on the global direction.

Definition at line 49 of file MuonTransientTrackingRecHit.cc.

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

50 {
52 }
static GlobalError transform(const LocalError &le, const Surface &surf)
const GeomDet * det() const
virtual LocalError localDirectionError() const
Error on the local direction.
virtual const Surface * surface() const
void MuonTransientTrackingRecHit::invalidateHit ( )

Definition at line 173 of file MuonTransientTrackingRecHit.cc.

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

Referenced by StandAloneMuonFilter::createDefaultTrajectory(), and MuonTrajectoryUpdator::update().

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

if this rec hit is a CSC rec hit

Definition at line 103 of file MuonTransientTrackingRecHit.cc.

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

Referenced by CosmicMuonSeedGenerator::checkQuality(), and invalidateHit().

103  {
104  return (geographicalId().subdetId() == MuonSubdetId::CSC);
105 }
static const int CSC
Definition: MuonSubdetId.h:13
DetId geographicalId() const
bool MuonTransientTrackingRecHit::isDT ( ) const

if this rec hit is a DT rec hit

Definition at line 99 of file MuonTransientTrackingRecHit.cc.

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

Referenced by CosmicMuonSeedGenerator::checkQuality(), MuonSeedOrcaPatternRecognition::discriminator(), invalidateHit(), and transientHits().

99  {
100  return (geographicalId().subdetId() == MuonSubdetId::DT);
101 }
static const int DT
Definition: MuonSubdetId.h:12
DetId geographicalId() const
bool MuonTransientTrackingRecHit::isRPC ( ) const

if this rec hit is a RPC rec hit

Definition at line 107 of file MuonTransientTrackingRecHit.cc.

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

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

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

Definition at line 28 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

Referenced by globalDirection().

28  {
29 
30  if (dynamic_cast<const RecSegment*>(hit()) )
31  return dynamic_cast<const RecSegment*>(hit())->localDirection();
32  else return LocalVector(0.,0.,0.);
33 
34 }
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 36 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

Referenced by globalDirectionError().

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

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 55 of file MuonTransientTrackingRecHit.cc.

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

Referenced by CosmicMuonSeedGenerator::createSeed().

55  {
56 
58 
60  if (lape.valid()) {
61 
62  // Just for speed up the code, the "else" branch can handle also the case of dim = 1.
63  if(err.num_row() == 1) err[0][0] += lape.xx();
64  else{
65  AlgebraicSymMatrix lapeMatrix(5,0);
66  lapeMatrix[3][3] = lape.xx();
67  lapeMatrix[3][4] = lape.xy();
68  lapeMatrix[4][4] = lape.yy();
69 
70  AlgebraicSymMatrix lapeMatrixProj = lapeMatrix.similarity(projectionMatrix());
71 
72  if(err.num_row() != lapeMatrixProj.num_row())
73  throw cms::Exception("MuonTransientTrackingRecHit::parametersError")
74  <<"Discrepancy between alignment error matrix and error matrix: APE "
75  << lapeMatrixProj.num_row()
76  << ", error matrix " << err.num_row()
77  << std::endl;
78 
79  err += lapeMatrixProj;
80  }
81  }
82  return err;
83 }
bool valid() const
Definition: LocalError.h:21
float xx() const
Definition: LocalError.h:24
virtual AlgebraicMatrix projectionMatrix() const
float xy() const
Definition: LocalError.h:25
float yy() const
Definition: LocalError.h:26
virtual AlgebraicSymMatrix parametersError() const
const GeomDet * det() 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
overridevirtual

return the sub components of this transient rechit

Reimplemented from TrackingRecHit.

Definition at line 113 of file MuonTransientTrackingRecHit.cc.

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

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

Friends And Related Function Documentation

friend class kkkwwwxxxyyyzzz
friend

Definition at line 81 of file MuonTransientTrackingRecHit.h.