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:
36 
38  typedef std::vector<int> LayerIndex;
39  typedef std::vector<const CSCRecHit2D*> ChamberHitContainer;
40  typedef ChamberHitContainer::const_iterator ChamberHitContainerCIt;
41 
42  // We need to be able to flag a hit as 'used' and so need a container
43  // of bool's. Naively, this would be vector<bool>... but AVOID that since it's
44  // non-standard i.e. packed-bit implementation which is not a standard STL container.
45  // We don't need what it offers and it could lead to unexpected trouble in the future
46 
47  typedef std::deque<bool> BoolContainer;
48 
50  explicit CSCSegAlgoTC(const edm::ParameterSet& ps);
52  virtual ~CSCSegAlgoTC() {};
53 
58  std::vector<CSCSegment> buildSegments(const ChamberHitContainer& rechits);
59 
63  std::vector<CSCSegment> run(const CSCChamber* aChamber, const ChamberHitContainer& rechits);
64 
65  private:
66 
68 
69  bool addHit(const CSCRecHit2D* aHit, int layer);
70  bool replaceHit(const CSCRecHit2D* h, int layer);
71  void compareProtoSegment(const CSCRecHit2D* h, int layer);
72  void increaseProtoSegment(const CSCRecHit2D* h, int layer);
73 
77  bool areHitsCloseInLocalX(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
78 
82  bool areHitsCloseInGlobalPhi(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
83 
84  bool hasHitOnLayer(int layer) const;
85 
92  bool isHitNearSegment(const CSCRecHit2D* h) const;
93 
97  void dumpHits(const ChamberHitContainer& rechits) const;
98 
102  void tryAddingHitsToSegment(const ChamberHitContainer& rechits,
103  const ChamberHitContainerCIt i1,
104  const ChamberHitContainerCIt i2);
105 
111  bool isSegmentGood(std::vector<CSCSegFit*>::iterator is,
112  const ChamberHitContainer& rechitsInChamber,
113  BoolContainer& used) const;
114 
118  void flagHitsAsUsed(std::vector<CSCSegFit*>::iterator is,
119  const ChamberHitContainer& rechitsInChamber, BoolContainer& used) const;
120 
125  void pruneTheSegments(const ChamberHitContainer& rechitsInChamber);
129  void segmentSort(void);
130 
131  float phiAtZ(float z) const;
132 
133  void updateParameters(void);
134 
135  void dumpSegment( const CSCSegment& seg ) const;
136 
138  // ================
139 
141 
142  ChamberHitContainer proto_segment;
143 
144  // Pointer to most recent candidate fit
146 
147  // Store pointers to set of candidate fits
148  std::vector<CSCSegFit*> candidates;
149 
152  float chi2Max;
153 
158 
163 
167  float dPhiFineMax;
168 
172  float dRPhiMax;
173 
176  float dPhiMax;
177 
181 
189 
193  bool debugInfo;
194 
195 };
196 
197 #endif
const std::string myName
Definition: CSCSegAlgoTC.h:192
void dumpSegment(const CSCSegment &seg) const
void compareProtoSegment(const CSCRecHit2D *h, int layer)
std::deque< bool > BoolContainer
Definition: CSCSegAlgoTC.h:47
bool isSegmentGood(std::vector< CSCSegFit * >::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
float phiAtZ(float z) const
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
Definition: CSCSegAlgoTC.cc:58
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
bool isHitNearSegment(const CSCRecHit2D *h) const
void dumpHits(const ChamberHitContainer &rechits) const
void updateParameters(void)
float dRPhiFineMax
Definition: CSCSegAlgoTC.h:162
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
bool addHit(const CSCRecHit2D *aHit, int layer)
Utility functions.
void flagHitsAsUsed(std::vector< CSCSegFit * >::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
float chi2ndfProbMin
Definition: CSCSegAlgoTC.h:157
const CSCChamber * theChamber
Member variables.
Definition: CSCSegAlgoTC.h:140
std::vector< CSCSegFit * > candidates
Definition: CSCSegAlgoTC.h:148
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
Definition: CSCSegAlgoTC.cc:52
ChamberHitContainer proto_segment
Definition: CSCSegAlgoTC.h:142
std::vector< const CSCRecHit2D * > ChamberHitContainer
Definition: CSCSegAlgoTC.h:39
void tryAddingHitsToSegment(const ChamberHitContainer &rechits, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
virtual ~CSCSegAlgoTC()
Destructor.
Definition: CSCSegAlgoTC.h:52
bool hasHitOnLayer(int layer) const
std::vector< int > LayerIndex
Typedefs.
Definition: CSCSegAlgoTC.h:38
CSCSegFit * sfit_
Definition: CSCSegAlgoTC.h:145
ChamberHitContainer::const_iterator ChamberHitContainerCIt
Definition: CSCSegAlgoTC.h:40
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
void pruneTheSegments(const ChamberHitContainer &rechitsInChamber)
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:167