CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCSegAlgoSK.h
Go to the documentation of this file.
1 #ifndef CSCSegment_CSCSegAlgoSK_h
2 #define CSCSegment_CSCSegAlgoSK_h
3 
31 
32 //#include <DataFormats/GeometryVector/interface/GlobalPoint.h>
33 
34 #include <deque>
35 #include <vector>
36 
38 
39 public:
40 
41  // Tim tried using map as basic container of all (space-point) RecHit's in a chamber:
42  // The 'key' is a pseudo-layer number (1-6 but with 1 always closest to IP).
43  // The 'value' is a vector of the RecHit's on that layer.
44  // Using the layer number like this removes the need to sort in global z.
45  // Instead we just have to ensure the layer index is correctly adjusted
46  // to enforce the requirement that 'layer 1' is closest in the chamber
47  // to the IP.
48 
50 
51  typedef std::vector<int> LayerIndex;
52  typedef std::vector<const CSCRecHit2D*> ChamberHitContainer;
53  typedef std::vector<const CSCRecHit2D*>::const_iterator ChamberHitContainerCIt;
54 
55  // We need to be able to flag a hit as 'used' and so need a container
56  // of bool's. Naively, this would be vector<bool>... but AVOID that since it's
57  // non-standard i.e. packed-bit implementation which is not a standard STL container.
58  // We don't need what it offers and it could lead to unexpected trouble in the future.
59 
60  typedef std::deque<bool> BoolContainer;
61 
63  explicit CSCSegAlgoSK(const edm::ParameterSet& ps);
65  virtual ~CSCSegAlgoSK() {};
66 
71  std::vector<CSCSegment> buildSegments(ChamberHitContainer rechits);
72 
76  std::vector<CSCSegment> run(const CSCChamber* aChamber, ChamberHitContainer rechits);
77 
78 private:
79 
81  // Could be static at the moment, but in principle one
82  // might like CSCSegmentizer-specific behaviour?
83  bool areHitsCloseInLocalX(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
84  bool areHitsCloseInGlobalPhi(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
85  bool isHitNearSegment(const CSCRecHit2D* h) const;
86 
90  void dumpHits(const ChamberHitContainer& rechits) const;
91 
95  void tryAddingHitsToSegment(const ChamberHitContainer& rechitsInChamber,
96  BoolContainer used, LayerIndex layerIndex,
98 
103  bool isSegmentGood(const ChamberHitContainer& rechitsInChamber) const;
104 
108  void flagHitsAsUsed(const ChamberHitContainer& rechitsInChamber, BoolContainer& used) const;
109 
111  bool addHit(const CSCRecHit2D* hit, int layer);
112  void updateParameters(void);
113  void fitSlopes(void);
114  void fillChiSquared(void);
119  void fillLocalDirection(void);
120  float phiAtZ(float z) const;
121  bool hasHitOnLayer(int layer) const;
122  bool replaceHit(const CSCRecHit2D* h, int layer);
123  void compareProtoSegment(const CSCRecHit2D* h, int layer);
124  void increaseProtoSegment(const CSCRecHit2D* h, int layer);
125  CLHEP::HepMatrix derivativeMatrix(void) const;
126  AlgebraicSymMatrix weightMatrix(void) const;
128  void flipErrors(AlgebraicSymMatrix&) const;
129 
130  // Member variables
131  // ================
132 
135  const std::string myName;
136 
137  double theChi2;
140  float uz, vz;
141  float windowScale;
142  float dRPhiMax ;
143  float dPhiMax;
145  float dPhiFineMax;
146  float chi2Max;
147  float wideSeg;
149  bool debugInfo;
150 };
151 
152 #endif
void dumpHits(const ChamberHitContainer &rechits) const
float dPhiFineMax
Definition: CSCSegAlgoSK.h:145
AlgebraicSymMatrix weightMatrix(void) const
void fillChiSquared(void)
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Utility functions.
ChamberHitContainer proto_segment
Definition: CSCSegAlgoSK.h:134
void flagHitsAsUsed(const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
std::vector< const CSCRecHit2D * >::const_iterator ChamberHitContainerCIt
Definition: CSCSegAlgoSK.h:53
bool replaceHit(const CSCRecHit2D *h, int layer)
LocalPoint theOrigin
Definition: CSCSegAlgoSK.h:138
std::vector< CSCSegment > buildSegments(ChamberHitContainer rechits)
Definition: CSCSegAlgoSK.cc:52
bool addHit(const CSCRecHit2D *hit, int layer)
Utility functions.
double double double z
void fitSlopes(void)
bool isHitNearSegment(const CSCRecHit2D *h) const
float windowScale
Definition: CSCSegAlgoSK.h:141
AlgebraicSymMatrix calculateError(void) const
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
void flipErrors(AlgebraicSymMatrix &) const
float phiAtZ(float z) const
void updateParameters(void)
LocalVector theDirection
Definition: CSCSegAlgoSK.h:139
virtual ~CSCSegAlgoSK()
Destructor.
Definition: CSCSegAlgoSK.h:65
CSCSegAlgoSK(const edm::ParameterSet &ps)
Constructor.
Definition: CSCSegAlgoSK.cc:23
bool hasHitOnLayer(int layer) const
void tryAddingHitsToSegment(const ChamberHitContainer &rechitsInChamber, BoolContainer used, LayerIndex layerIndex, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
const std::string myName
Definition: CSCSegAlgoSK.h:135
std::vector< int > LayerIndex
Typedefs.
Definition: CSCSegAlgoSK.h:51
float dRPhiFineMax
Definition: CSCSegAlgoSK.h:144
CLHEP::HepSymMatrix AlgebraicSymMatrix
bool isSegmentGood(const ChamberHitContainer &rechitsInChamber) const
double theChi2
Definition: CSCSegAlgoSK.h:137
std::vector< const CSCRecHit2D * > ChamberHitContainer
Definition: CSCSegAlgoSK.h:52
std::vector< CSCSegment > run(const CSCChamber *aChamber, ChamberHitContainer rechits)
Definition: CSCSegAlgoSK.cc:47
CLHEP::HepMatrix derivativeMatrix(void) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
std::deque< bool > BoolContainer
Definition: CSCSegAlgoSK.h:60
void compareProtoSegment(const CSCRecHit2D *h, int layer)
const CSCChamber * theChamber
Definition: CSCSegAlgoSK.h:133
void fillLocalDirection(void)