CMS 3D CMS Logo

CSCSegAlgoTC.h
Go to the documentation of this file.
1 #ifndef CSCSegment_CSCSegAlgoTC_h
2 #define CSCSegment_CSCSegAlgoTC_h
3 
26 
28 
29 #include <deque>
30 #include <vector>
31 
32 class CSCSegFit;
33 
35 public:
37  typedef std::vector<int> LayerIndex;
38  typedef std::vector<const CSCRecHit2D*> ChamberHitContainer;
39  typedef ChamberHitContainer::const_iterator ChamberHitContainerCIt;
40 
41  // We need to be able to flag a hit as 'used' and so need a container
42  // of bool's. Naively, this would be vector<bool>... but AVOID that since it's
43  // non-standard i.e. packed-bit implementation which is not a standard STL container.
44  // We don't need what it offers and it could lead to unexpected trouble in the future
45 
46  typedef std::deque<bool> BoolContainer;
47 
49  explicit CSCSegAlgoTC(const edm::ParameterSet& ps);
51  ~CSCSegAlgoTC() override{};
52 
57  std::vector<CSCSegment> buildSegments(const ChamberHitContainer& rechits);
58 
62  std::vector<CSCSegment> run(const CSCChamber* aChamber, const ChamberHitContainer& rechits) override;
63 
64 private:
66 
67  bool addHit(const CSCRecHit2D* aHit, int layer);
68  bool replaceHit(const CSCRecHit2D* h, int layer);
69  void compareProtoSegment(const CSCRecHit2D* h, int layer);
70  void increaseProtoSegment(const CSCRecHit2D* h, int layer);
71 
75  bool areHitsCloseInLocalX(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
76 
80  bool areHitsCloseInGlobalPhi(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
81 
82  bool hasHitOnLayer(int layer) const;
83 
90  bool isHitNearSegment(const CSCRecHit2D* h) const;
91 
95  void dumpHits(const ChamberHitContainer& rechits) const;
96 
102  const ChamberHitContainerCIt i2);
103 
109  bool isSegmentGood(std::vector<CSCSegFit*>::iterator is,
110  const ChamberHitContainer& rechitsInChamber,
111  BoolContainer& used) const;
112 
116  void flagHitsAsUsed(std::vector<CSCSegFit*>::iterator is,
117  const ChamberHitContainer& rechitsInChamber,
118  BoolContainer& used) const;
119 
124  void pruneTheSegments(const ChamberHitContainer& rechitsInChamber);
128  void segmentSort(void);
129 
130  float phiAtZ(float z) const;
131 
132  void updateParameters(void);
133 
134  void dumpSegment(const CSCSegment& seg) const;
135 
137  // ================
138 
140 
142 
143  // Pointer to most recent candidate fit
145 
146  // Store pointers to set of candidate fits
147  std::vector<CSCSegFit*> candidates;
148 
151  float chi2Max;
152 
157 
162 
166  float dPhiFineMax;
167 
171  float dRPhiMax;
172 
175  float dPhiMax;
176 
180 
188 
192  bool debugInfo;
193 };
194 
195 #endif
const std::string myName
Definition: CSCSegAlgoTC.h:191
bool hasHitOnLayer(int layer) const
void compareProtoSegment(const CSCRecHit2D *h, int layer)
std::deque< bool > BoolContainer
Definition: CSCSegAlgoTC.h:46
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
Definition: CSCSegAlgoTC.cc:57
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits) override
Definition: CSCSegAlgoTC.cc:51
~CSCSegAlgoTC() override
Destructor.
Definition: CSCSegAlgoTC.h:51
void updateParameters(void)
bool isHitNearSegment(const CSCRecHit2D *h) const
void dumpSegment(const CSCSegment &seg) const
float dRPhiFineMax
Definition: CSCSegAlgoTC.h:161
void flagHitsAsUsed(std::vector< CSCSegFit *>::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
bool addHit(const CSCRecHit2D *aHit, int layer)
Utility functions.
float chi2ndfProbMin
Definition: CSCSegAlgoTC.h:156
const CSCChamber * theChamber
Member variables.
Definition: CSCSegAlgoTC.h:139
std::vector< CSCSegFit * > candidates
Definition: CSCSegAlgoTC.h:147
ChamberHitContainer proto_segment
Definition: CSCSegAlgoTC.h:141
std::vector< const CSCRecHit2D * > ChamberHitContainer
Definition: CSCSegAlgoTC.h:38
void tryAddingHitsToSegment(const ChamberHitContainer &rechits, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
std::vector< int > LayerIndex
Typedefs.
Definition: CSCSegAlgoTC.h:37
void dumpHits(const ChamberHitContainer &rechits) const
float phiAtZ(float z) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
CSCSegFit * sfit_
Definition: CSCSegAlgoTC.h:144
ChamberHitContainer::const_iterator ChamberHitContainerCIt
Definition: CSCSegAlgoTC.h:39
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
void pruneTheSegments(const ChamberHitContainer &rechitsInChamber)
bool isSegmentGood(std::vector< CSCSegFit *>::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
bool replaceHit(const CSCRecHit2D *h, int layer)
CSCSegAlgoTC(const edm::ParameterSet &ps)
Constructor.
Definition: CSCSegAlgoTC.cc:26
void segmentSort(void)
float dPhiFineMax
Definition: CSCSegAlgoTC.h:166