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
CSCSegment Class Reference

#include <CSCSegment.h>

Inheritance diagram for CSCSegment:
RecSegment TrackingRecHit

Public Member Functions

double chi2 () const
 Chi2 of the segment fit. More...
 
CSCSegmentclone () const
 
CSCDetId cscDetId () const
 
 CSCSegment ()
 Default constructor. More...
 
 CSCSegment (std::vector< const CSCRecHit2D * > proto_segment, LocalPoint origin, LocalVector direction, AlgebraicSymMatrix errors, double chi2)
 Constructor. More...
 
virtual int degreesOfFreedom () const
 Degrees of freedom of the segment fit. More...
 
virtual int dimension () const
 Dimension (in parameter space) More...
 
const std::vector< CSCSegment > & duplicateSegments () const
 
bool isME11a_duplicate () const
 
LocalVector localDirection () const
 Local direction. More...
 
LocalError localDirectionError () const
 Error on the local direction. More...
 
LocalPoint localPosition () const
 
LocalError localPositionError () const
 
int nRecHits () const
 
AlgebraicVector parameters () const
 Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y ) More...
 
AlgebraicSymMatrix parametersError () const
 Covariance matrix of parameters() More...
 
void print () const
 
virtual AlgebraicMatrix projectionMatrix () const
 The projection matrix relates the trajectory state parameters to the segment parameters(). 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 setDuplicateSegments (std::vector< CSCSegment * > &duplicates)
 
bool sharesRecHits (const CSCSegment &anotherSegment, CSCRecHit2D::SharedInputType sharesInput) const
 
bool sharesRecHits (const CSCSegment &anotherSegment) const
 
const std::vector< CSCRecHit2D > & specificRecHits () const
 
bool testSharesAllInSpecificRecHits (const std::vector< CSCRecHit2D > &specificRecHits_1, const std::vector< CSCRecHit2D > &specificRecHits_2, CSCRecHit2D::SharedInputType) const
 
virtual ~CSCSegment ()
 Destructor. More...
 
- Public Member Functions inherited from RecSegment
 RecSegment (DetId id)
 
 RecSegment (TrackingRecHit::id_type id=0)
 
virtual ~RecSegment ()
 Destructor. More...
 
- Public Member Functions inherited from TrackingRecHit
DetId geographicalId () const
 
virtual void getKfComponents (KfComponentsHolder &holder) 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 float weight () const
 
virtual ~TrackingRecHit ()
 

Private Attributes

bool aME11a_duplicate
 
double theChi2
 
AlgebraicSymMatrix theCovMatrix
 
std::vector< CSCRecHit2DtheCSCRecHits
 
std::vector< CSCSegmenttheDuplicateSegments
 
LocalVector theLocalDirection
 
LocalPoint theOrigin
 

Additional Inherited Members

- 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 }
 
- Protected Member Functions inherited from TrackingRecHit
void setId (id_type iid)
 
void setType (Type ttype)
 

Detailed Description

Describes a reconstructed track segment in the 6 layers of a CSC chamber. This is 4-dimensional since it has an origin (x,y) and a direction (x,y) in the local coordinate system of the chamber.

Date:
2010/09/09 10:09:21
Author
Matteo Sani
Rick Wilkinson
Tim Cox

Definition at line 22 of file CSCSegment.h.

Constructor & Destructor Documentation

CSCSegment::CSCSegment ( )
inline

Default constructor.

Definition at line 27 of file CSCSegment.h.

Referenced by clone().

27 : theChi2(0.), aME11a_duplicate(false) {}
bool aME11a_duplicate
Definition: CSCSegment.h:97
double theChi2
Definition: CSCSegment.h:96
CSCSegment::CSCSegment ( std::vector< const CSCRecHit2D * >  proto_segment,
LocalPoint  origin,
LocalVector  direction,
AlgebraicSymMatrix  errors,
double  chi2 
)

Constructor.

Definition at line 19 of file CSCSegment.cc.

References i, and theCSCRecHits.

20  :
21  RecSegment(buildDetId(proto_segment.front()->cscDetId())),
22  theOrigin(origin),
24 
25  for(unsigned int i=0; i<proto_segment.size(); ++i)
26  theCSCRecHits.push_back(*proto_segment[i]);
27 }
int i
Definition: DBlmapReader.cc:9
bool aME11a_duplicate
Definition: CSCSegment.h:97
double theChi2
Definition: CSCSegment.h:96
AlgebraicSymMatrix theCovMatrix
Definition: CSCSegment.h:95
LocalPoint theOrigin
Definition: CSCSegment.h:93
std::vector< CSCRecHit2D > theCSCRecHits
Definition: CSCSegment.h:92
double chi2() const
Chi2 of the segment fit.
Definition: CSCSegment.h:58
LocalVector theLocalDirection
Definition: CSCSegment.h:94
RecSegment(DetId id)
Definition: RecSegment.h:32
CSCSegment::~CSCSegment ( )
virtual

Destructor.

Definition at line 29 of file CSCSegment.cc.

29 {}

Member Function Documentation

double CSCSegment::chi2 ( ) const
inlinevirtual

Chi2 of the segment fit.

Implements RecSegment.

Definition at line 58 of file CSCSegment.h.

References theChi2.

Referenced by CSCSegAlgoST::buildSegments(), operator<<(), CSCSegAlgoST::prune_bad_hits(), and CSCSegAlgoHitPruning::pruneBadHits().

58 { return theChi2; };
double theChi2
Definition: CSCSegment.h:96
CSCSegment* CSCSegment::clone ( void  ) const
inlinevirtual

Implements TrackingRecHit.

Definition at line 37 of file CSCSegment.h.

References CSCSegment().

37 { return new CSCSegment(*this); }
CSCSegment()
Default constructor.
Definition: CSCSegment.h:27
CSCDetId CSCSegment::cscDetId ( ) const
inline

Definition at line 70 of file CSCSegment.h.

References TrackingRecHit::geographicalId().

Referenced by FWCSCSegmentProxyBuilder::build().

70 { return geographicalId(); }
DetId geographicalId() const
virtual int CSCSegment::degreesOfFreedom ( ) const
inlinevirtual

Degrees of freedom of the segment fit.

Implements RecSegment.

Definition at line 62 of file CSCSegment.h.

References nRecHits().

Referenced by operator<<().

62 { return 2*nRecHits() - 4;}
int nRecHits() const
Definition: CSCSegment.h:68
virtual int CSCSegment::dimension ( ) const
inlinevirtual

Dimension (in parameter space)

Implements RecSegment.

Definition at line 60 of file CSCSegment.h.

60 { return 4; }
const std::vector< CSCSegment>& CSCSegment::duplicateSegments ( ) const
inline

Definition at line 76 of file CSCSegment.h.

References theDuplicateSegments.

Referenced by operator<<().

76 { return theDuplicateSegments; }
std::vector< CSCSegment > theDuplicateSegments
Definition: CSCSegment.h:98
bool CSCSegment::isME11a_duplicate ( ) const
inline

Definition at line 74 of file CSCSegment.h.

References theDuplicateSegments.

74 { return (theDuplicateSegments.size() > 0 ? true : false); }
std::vector< CSCSegment > theDuplicateSegments
Definition: CSCSegment.h:98
LocalVector CSCSegment::localDirection ( ) const
inlinevirtual
LocalError CSCSegment::localDirectionError ( ) const
virtual

Error on the local direction.

Implements RecSegment.

Definition at line 52 of file CSCSegment.cc.

References theCovMatrix.

Referenced by operator<<(), and CSCSegmentValidation::plotResolution().

52  {
53  return LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]);
54 }
AlgebraicSymMatrix theCovMatrix
Definition: CSCSegment.h:95
LocalPoint CSCSegment::localPosition ( ) const
inlinevirtual
LocalError CSCSegment::localPositionError ( ) const
virtual

Implements TrackingRecHit.

Definition at line 48 of file CSCSegment.cc.

References theCovMatrix.

Referenced by operator<<(), and CSCSegmentValidation::plotResolution().

48  {
49  return LocalError(theCovMatrix[2][2], theCovMatrix[2][3], theCovMatrix[3][3]);
50 }
AlgebraicSymMatrix theCovMatrix
Definition: CSCSegment.h:95
int CSCSegment::nRecHits ( ) const
inline

Definition at line 68 of file CSCSegment.h.

References theCSCRecHits.

Referenced by CSCSegAlgoST::buildSegments(), CSCSegAlgoDF::buildSegments(), degreesOfFreedom(), CSCSegAlgoST::prune_bad_hits(), and CSCSegAlgoHitPruning::pruneBadHits().

68 { return theCSCRecHits.size(); }
std::vector< CSCRecHit2D > theCSCRecHits
Definition: CSCSegment.h:92
AlgebraicVector CSCSegment::parameters ( void  ) const
virtual

Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )

Implements TrackingRecHit.

Definition at line 57 of file CSCSegment.cc.

References query::result, theLocalDirection, theOrigin, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by ChamberSegmentUtility::getCSCRHmap(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::inputTags(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::properties(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::recursePSetProperties(), and StateSegmentMatcher::StateSegmentMatcher().

57  {
58  // For consistency with DT and what we require for the TrackingRecHit interface,
59  // the order of the parameters in the returned vector should be (dx/dz, dy/dz, x, z)
60 
62 
65  result[2] = theOrigin.x();
66  result[3] = theOrigin.y();
67 
68  return result;
69 }
T y() const
Definition: PV3DBase.h:57
T z() const
Definition: PV3DBase.h:58
tuple result
Definition: query.py:137
LocalPoint theOrigin
Definition: CSCSegment.h:93
CLHEP::HepVector AlgebraicVector
LocalVector theLocalDirection
Definition: CSCSegment.h:94
T x() const
Definition: PV3DBase.h:56
AlgebraicSymMatrix CSCSegment::parametersError ( ) const
inlinevirtual

Covariance matrix of parameters()

Implements TrackingRecHit.

Definition at line 49 of file CSCSegment.h.

References theCovMatrix.

Referenced by StateSegmentMatcher::StateSegmentMatcher().

49 { return theCovMatrix; }
AlgebraicSymMatrix theCovMatrix
Definition: CSCSegment.h:95
void CSCSegment::print ( void  ) const

Definition at line 148 of file CSCSegment.cc.

References gather_cfg::cout.

148  {
149  std::cout << *this << std::endl;
150 }
tuple cout
Definition: gather_cfg.py:41
AlgebraicMatrix CSCSegment::projectionMatrix ( ) const
virtual

The projection matrix relates the trajectory state parameters to the segment parameters().

Implements TrackingRecHit.

Definition at line 72 of file CSCSegment.cc.

72  {
73  static AlgebraicMatrix theProjectionMatrix( 4, 5, 0);
74  static bool isInitialized = false;
75  if (!isInitialized) {
76  theProjectionMatrix[0][1] = 1;
77  theProjectionMatrix[1][2] = 1;
78  theProjectionMatrix[2][3] = 1;
79  theProjectionMatrix[3][4] = 1;
80  isInitialized=true;
81  }
82  return theProjectionMatrix;
83 }
CLHEP::HepMatrix AlgebraicMatrix
std::vector< const TrackingRecHit * > CSCSegment::recHits ( ) const
virtual

Access to component RecHits (if any)

Implements TrackingRecHit.

Definition at line 31 of file CSCSegment.cc.

References theCSCRecHits.

Referenced by MuonAssociatorByHits::getMatchedIds(), TrackerMuonHitExtractor::getMuonHits(), and MuonTrackProducer::produce().

31  {
32  std::vector<const TrackingRecHit*> pointersOfRecHits;
33  for (std::vector<CSCRecHit2D>::const_iterator irh = theCSCRecHits.begin(); irh!=theCSCRecHits.end(); ++irh) {
34  pointersOfRecHits.push_back(&(*irh));
35  }
36  return pointersOfRecHits;
37 }
std::vector< CSCRecHit2D > theCSCRecHits
Definition: CSCSegment.h:92
std::vector< TrackingRecHit * > CSCSegment::recHits ( )
virtual

Non-const access to component RecHits (if any)

Implements TrackingRecHit.

Definition at line 39 of file CSCSegment.cc.

References theCSCRecHits.

39  {
40 
41  std::vector<TrackingRecHit*> pointersOfRecHits;
42  for (std::vector<CSCRecHit2D>::iterator irh = theCSCRecHits.begin(); irh!=theCSCRecHits.end(); ++irh) {
43  pointersOfRecHits.push_back(&(*irh));
44  }
45  return pointersOfRecHits;
46 }
std::vector< CSCRecHit2D > theCSCRecHits
Definition: CSCSegment.h:92
void CSCSegment::setDuplicateSegments ( std::vector< CSCSegment * > &  duplicates)

Definition at line 85 of file CSCSegment.cc.

References i, and theDuplicateSegments.

85  {
86  theDuplicateSegments.clear();
87  for(unsigned int i=0; i<duplicates.size(); ++i){
88  theDuplicateSegments.push_back(*duplicates[i]);
89  //avoid copying duplicates of duplicates of duplicates...
90  theDuplicateSegments.back().theDuplicateSegments.resize(0);
91  }
92 }
int i
Definition: DBlmapReader.cc:9
std::vector< CSCSegment > theDuplicateSegments
Definition: CSCSegment.h:98
bool CSCSegment::sharesRecHits ( const CSCSegment anotherSegment,
CSCRecHit2D::SharedInputType  sharesInput 
) const

Definition at line 132 of file CSCSegment.cc.

References TrackingRecHit::sharesInput(), specificRecHits(), testSharesAllInSpecificRecHits(), and theCSCRecHits.

132  {
134 }
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
bool testSharesAllInSpecificRecHits(const std::vector< CSCRecHit2D > &specificRecHits_1, const std::vector< CSCRecHit2D > &specificRecHits_2, CSCRecHit2D::SharedInputType) const
Definition: CSCSegment.cc:94
const std::vector< CSCRecHit2D > & specificRecHits() const
Definition: CSCSegment.h:66
std::vector< CSCRecHit2D > theCSCRecHits
Definition: CSCSegment.h:92
bool CSCSegment::sharesRecHits ( const CSCSegment anotherSegment) const

Definition at line 137 of file CSCSegment.cc.

References CSCRecHit2D::someStrips, CSCRecHit2D::someWires, specificRecHits(), testSharesAllInSpecificRecHits(), and theCSCRecHits.

137  {
140  return true;
141  }
142  else{
143  return false;
144  }
145 }
bool testSharesAllInSpecificRecHits(const std::vector< CSCRecHit2D > &specificRecHits_1, const std::vector< CSCRecHit2D > &specificRecHits_2, CSCRecHit2D::SharedInputType) const
Definition: CSCSegment.cc:94
const std::vector< CSCRecHit2D > & specificRecHits() const
Definition: CSCSegment.h:66
std::vector< CSCRecHit2D > theCSCRecHits
Definition: CSCSegment.h:92
const std::vector<CSCRecHit2D>& CSCSegment::specificRecHits ( ) const
inline

Definition at line 66 of file CSCSegment.h.

References theCSCRecHits.

Referenced by operator<<(), and sharesRecHits().

66 { return theCSCRecHits; }
std::vector< CSCRecHit2D > theCSCRecHits
Definition: CSCSegment.h:92
bool CSCSegment::testSharesAllInSpecificRecHits ( const std::vector< CSCRecHit2D > &  specificRecHits_1,
const std::vector< CSCRecHit2D > &  specificRecHits_2,
CSCRecHit2D::SharedInputType  sharesInput 
) const

Definition at line 94 of file CSCSegment.cc.

Referenced by sharesRecHits().

96  {
97  const std::vector<CSCRecHit2D> * rhContainer_1 = &specificRecHits_1;
98  const std::vector<CSCRecHit2D> * rhContainer_2 = &specificRecHits_2;
99  if(specificRecHits_1.size()>specificRecHits_2.size()){
100  rhContainer_2 = &specificRecHits_1;
101  rhContainer_1 = &specificRecHits_2;
102  }
103  //
104  bool shareConditionPassed = true;
105  for ( std::vector<CSCRecHit2D>::const_iterator itRH = rhContainer_1->begin();
106  itRH != rhContainer_1->end(); ++itRH) {
107  const CSCRecHit2D *firstRecHit = &(*itRH);
108  bool sharedHit = false;
109  for ( std::vector<CSCRecHit2D>::const_iterator itRH2 = rhContainer_2->begin();
110  itRH2 != rhContainer_2->end(); ++itRH2) {
111  if(itRH2->sharesInput(firstRecHit,sharesInput)){
112  sharedHit = true;
113  break;
114  }
115  }
116  if(!sharedHit){
117  shareConditionPassed = false;
118  break;
119  }
120  }
121  return shareConditionPassed;
122 }
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const

Member Data Documentation

bool CSCSegment::aME11a_duplicate
private

Definition at line 97 of file CSCSegment.h.

double CSCSegment::theChi2
private

Definition at line 96 of file CSCSegment.h.

Referenced by chi2().

AlgebraicSymMatrix CSCSegment::theCovMatrix
private

Definition at line 95 of file CSCSegment.h.

Referenced by localDirectionError(), localPositionError(), and parametersError().

std::vector<CSCRecHit2D> CSCSegment::theCSCRecHits
private

Definition at line 92 of file CSCSegment.h.

Referenced by CSCSegment(), nRecHits(), recHits(), sharesRecHits(), and specificRecHits().

std::vector<CSCSegment> CSCSegment::theDuplicateSegments
private

Definition at line 98 of file CSCSegment.h.

Referenced by duplicateSegments(), isME11a_duplicate(), and setDuplicateSegments().

LocalVector CSCSegment::theLocalDirection
private

Definition at line 94 of file CSCSegment.h.

Referenced by localDirection(), and parameters().

LocalPoint CSCSegment::theOrigin
private

Definition at line 93 of file CSCSegment.h.

Referenced by localPosition(), and parameters().