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