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 <deque>
31 #include <vector>
32 
33 class CSCSegFit;
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  float phiAtZ(float z) const;
112  bool hasHitOnLayer(int layer) const;
113  bool replaceHit(const CSCRecHit2D* h, int layer);
114  void compareProtoSegment(const CSCRecHit2D* h, int layer);
115  void increaseProtoSegment(const CSCRecHit2D* h, int layer);
116  void dumpSegment( const CSCSegment& seg ) const;
117 
118  // Member variables
119  // ================
120 
124 
125  float windowScale;
126  float dRPhiMax ;
127  float dPhiMax;
129  float dPhiFineMax;
130  float chi2Max;
131  float wideSeg;
133  bool debugInfo;
134 
136 };
137 
138 #endif
void dumpHits(const ChamberHitContainer &rechits) const
float dPhiFineMax
Definition: CSCSegAlgoSK.h:129
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Utility functions.
ChamberHitContainer proto_segment
Definition: CSCSegAlgoSK.h:122
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)
bool addHit(const CSCRecHit2D *hit, int layer)
Utility functions.
void dumpSegment(const CSCSegment &seg) const
bool isHitNearSegment(const CSCRecHit2D *h) const
float windowScale
Definition: CSCSegAlgoSK.h:125
CSCSegFit * sfit_
Definition: CSCSegAlgoSK.h:135
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
float phiAtZ(float z) const
void updateParameters(void)
virtual ~CSCSegAlgoSK()
Destructor.
Definition: CSCSegAlgoSK.h:63
CSCSegAlgoSK(const edm::ParameterSet &ps)
Constructor.
Definition: CSCSegAlgoSK.cc:19
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
Definition: CSCSegAlgoSK.cc:48
bool hasHitOnLayer(int layer) const
const std::string myName
Definition: CSCSegAlgoSK.h:123
std::vector< int > LayerIndex
Typedefs.
Definition: CSCSegAlgoSK.h:49
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
Definition: CSCSegAlgoSK.cc:43
float dRPhiFineMax
Definition: CSCSegAlgoSK.h:128
bool isSegmentGood(const ChamberHitContainer &rechitsInChamber) const
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)
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:121