CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 public:
37  // Tim tried using map as basic container of all (space-point) RecHit's in a chamber:
38  // The 'key' is a pseudo-layer number (1-6 but with 1 always closest to IP).
39  // The 'value' is a vector of the RecHit's on that layer.
40  // Using the layer number like this removes the need to sort in global z.
41  // Instead we just have to ensure the layer index is correctly adjusted
42  // to enforce the requirement that 'layer 1' is closest in the chamber
43  // to the IP.
44 
46 
47  typedef std::vector<int> LayerIndex;
48  typedef std::vector<const CSCRecHit2D*> ChamberHitContainer;
49  typedef std::vector<const CSCRecHit2D*>::const_iterator ChamberHitContainerCIt;
50 
51  // We need to be able to flag a hit as 'used' and so need a container
52  // of bool's. Naively, this would be vector<bool>... but AVOID that since it's
53  // non-standard i.e. packed-bit implementation which is not a standard STL container.
54  // We don't need what it offers and it could lead to unexpected trouble in the future.
55 
56  typedef std::deque<bool> BoolContainer;
57 
59  explicit CSCSegAlgoSK(const edm::ParameterSet& ps);
61  ~CSCSegAlgoSK() override{};
62 
67  std::vector<CSCSegment> buildSegments(const ChamberHitContainer& rechits);
68 
72  std::vector<CSCSegment> run(const CSCChamber* aChamber, const ChamberHitContainer& rechits) override;
73 
74 private:
76  // Could be static at the moment, but in principle one
77  // might like CSCSegmentizer-specific behaviour?
78  bool areHitsCloseInLocalX(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
79  bool areHitsCloseInGlobalPhi(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
80  bool isHitNearSegment(const CSCRecHit2D* h) const;
81 
85  void dumpHits(const ChamberHitContainer& rechits) const;
86 
90  void tryAddingHitsToSegment(const ChamberHitContainer& rechitsInChamber,
91  const BoolContainer& used,
92  const LayerIndex& layerIndex,
93  const ChamberHitContainerCIt i1,
94  const ChamberHitContainerCIt i2);
95 
100  bool isSegmentGood(const ChamberHitContainer& rechitsInChamber) const;
101 
105  void flagHitsAsUsed(const ChamberHitContainer& rechitsInChamber, BoolContainer& used) const;
106 
108  bool addHit(const CSCRecHit2D* hit, int layer);
109  void updateParameters(void);
110  float phiAtZ(float z) const;
111  bool hasHitOnLayer(int layer) const;
112  bool replaceHit(const CSCRecHit2D* h, int layer);
113  void compareProtoSegment(const CSCRecHit2D* h, int layer);
114  void increaseProtoSegment(const CSCRecHit2D* h, int layer);
115  void dumpSegment(const CSCSegment& seg) const;
116 
117  // Member variables
118  // ================
119 
123 
124  float windowScale;
125  float dRPhiMax;
126  float dPhiMax;
128  float dPhiFineMax;
129  float chi2Max;
130  float wideSeg;
132  bool debugInfo;
133 
135 };
136 
137 #endif
void dumpHits(const ChamberHitContainer &rechits) const
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits) override
Definition: CSCSegAlgoSK.cc:42
float dPhiFineMax
Definition: CSCSegAlgoSK.h:128
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Utility functions.
ChamberHitContainer proto_segment
Definition: CSCSegAlgoSK.h:121
void flagHitsAsUsed(const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
std::vector< const CSCRecHit2D * >::const_iterator ChamberHitContainerCIt
Definition: CSCSegAlgoSK.h:49
bool replaceHit(const CSCRecHit2D *h, int layer)
bool addHit(const CSCRecHit2D *hit, int layer)
Utility functions.
constexpr std::array< uint8_t, layerIndexSize > layer
void dumpSegment(const CSCSegment &seg) const
bool isHitNearSegment(const CSCRecHit2D *h) const
float windowScale
Definition: CSCSegAlgoSK.h:124
CSCSegFit * sfit_
Definition: CSCSegAlgoSK.h:134
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
float phiAtZ(float z) const
void updateParameters(void)
CSCSegAlgoSK(const edm::ParameterSet &ps)
Constructor.
Definition: CSCSegAlgoSK.cc:19
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
Definition: CSCSegAlgoSK.cc:47
~CSCSegAlgoSK() override
Destructor.
Definition: CSCSegAlgoSK.h:61
bool hasHitOnLayer(int layer) const
const std::string myName
Definition: CSCSegAlgoSK.h:122
std::vector< int > LayerIndex
Typedefs.
Definition: CSCSegAlgoSK.h:47
float dRPhiFineMax
Definition: CSCSegAlgoSK.h:127
bool isSegmentGood(const ChamberHitContainer &rechitsInChamber) const
std::vector< const CSCRecHit2D * > ChamberHitContainer
Definition: CSCSegAlgoSK.h:48
void tryAddingHitsToSegment(const ChamberHitContainer &rechitsInChamber, const BoolContainer &used, const LayerIndex &layerIndex, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
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:56
void compareProtoSegment(const CSCRecHit2D *h, int layer)
const CSCChamber * theChamber
Definition: CSCSegAlgoSK.h:120