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
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
CSCSegAlgoTC::isHitNearSegment
bool isHitNearSegment(const CSCRecHit2D *h) const
Definition: CSCSegAlgoTC.cc:369
CSCSegAlgoTC::LayerIndex
std::vector< int > LayerIndex
Typedefs.
Definition: CSCSegAlgoTC.h:37
CSCSegmentAlgorithm
Definition: CSCSegmentAlgorithm.h:23
CSCSegAlgoTC::CSCSegAlgoTC
CSCSegAlgoTC(const edm::ParameterSet &ps)
Constructor.
Definition: CSCSegAlgoTC.cc:26
CSCSegAlgoTC::dPhiFineMax
float dPhiFineMax
Definition: CSCSegAlgoTC.h:166
CSCSegAlgoTC::addHit
bool addHit(const CSCRecHit2D *aHit, int layer)
Utility functions.
Definition: CSCSegAlgoTC.cc:248
CSCSegAlgoTC::increaseProtoSegment
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
Definition: CSCSegAlgoTC.cc:322
CSCSegAlgoTC::dPhiMax
float dPhiMax
Definition: CSCSegAlgoTC.h:175
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
CSCSegAlgoTC::proto_segment
ChamberHitContainer proto_segment
Definition: CSCSegAlgoTC.h:141
CSCSegAlgoTC::buildSegments
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
Definition: CSCSegAlgoTC.cc:57
CSCSegAlgoTC::chi2Max
float chi2Max
Definition: CSCSegAlgoTC.h:151
CSCSegFit
Definition: CSCSegFit.h:30
CSCSegAlgoTC::SegmentSorting
int SegmentSorting
Definition: CSCSegAlgoTC.h:187
CSCSegAlgoTC::~CSCSegAlgoTC
~CSCSegAlgoTC() override
Destructor.
Definition: CSCSegAlgoTC.h:51
CSCSegAlgoTC::ChamberHitContainer
std::vector< const CSCRecHit2D * > ChamberHitContainer
Definition: CSCSegAlgoTC.h:38
CSCSegAlgoTC::theChamber
const CSCChamber * theChamber
Member variables.
Definition: CSCSegAlgoTC.h:139
CSCSegAlgoTC::compareProtoSegment
void compareProtoSegment(const CSCRecHit2D *h, int layer)
Definition: CSCSegAlgoTC.cc:302
CSCSegAlgoTC::phiAtZ
float phiAtZ(float z) const
Definition: CSCSegAlgoTC.cc:287
CSCSegAlgoTC::pruneTheSegments
void pruneTheSegments(const ChamberHitContainer &rechitsInChamber)
Definition: CSCSegAlgoTC.cc:486
CSCSegAlgoTC::sfit_
CSCSegFit * sfit_
Definition: CSCSegAlgoTC.h:144
CSCSegAlgoTC::dRPhiFineMax
float dRPhiFineMax
Definition: CSCSegAlgoTC.h:161
DDAxes::z
CSCSegAlgoTC::BoolContainer
std::deque< bool > BoolContainer
Definition: CSCSegAlgoTC.h:46
CSCSegAlgoTC::dumpHits
void dumpHits(const ChamberHitContainer &rechits) const
Definition: CSCSegAlgoTC.cc:408
CSCChamber
Definition: CSCChamber.h:22
CSCSegAlgoTC::ChamberHitContainerCIt
ChamberHitContainer::const_iterator ChamberHitContainerCIt
Definition: CSCSegAlgoTC.h:39
HI_PhotonSkim_cff.rechits
rechits
Definition: HI_PhotonSkim_cff.py:76
h
CSCSegment
Definition: CSCSegment.h:21
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CSCSegAlgoTC::replaceHit
bool replaceHit(const CSCRecHit2D *h, int layer)
Definition: CSCSegAlgoTC.cc:267
CSCSegAlgoTC::chi2ndfProbMin
float chi2ndfProbMin
Definition: CSCSegAlgoTC.h:156
CSCSegAlgoTC::segmentSort
void segmentSort(void)
Definition: CSCSegAlgoTC.cc:520
CSCSegAlgoTC::isSegmentGood
bool isSegmentGood(std::vector< CSCSegFit * >::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
Definition: CSCSegAlgoTC.cc:422
edm::ParameterSet
Definition: ParameterSet.h:47
CSCRecHit2D
Definition: CSCRecHit2D.h:18
CSCSegAlgoTC::hasHitOnLayer
bool hasHitOnLayer(int layer) const
Definition: CSCSegAlgoTC.cc:397
CSCSegAlgoTC::areHitsCloseInGlobalPhi
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Definition: CSCSegAlgoTC.cc:350
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCSegAlgoTC::minLayersApart
int minLayersApart
Definition: CSCSegAlgoTC.h:179
CSCSegAlgoTC::dumpSegment
void dumpSegment(const CSCSegment &seg) const
Definition: CSCSegAlgoTC.cc:558
CSCSegAlgoTC::debugInfo
bool debugInfo
Definition: CSCSegAlgoTC.h:192
CSCSegAlgoTC::candidates
std::vector< CSCSegFit * > candidates
Definition: CSCSegAlgoTC.h:147
CSCSegmentAlgorithm.h
CSCSegAlgoTC::run
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits) override
Definition: CSCSegAlgoTC.cc:51
CSCSegAlgoTC::tryAddingHitsToSegment
void tryAddingHitsToSegment(const ChamberHitContainer &rechits, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
Definition: CSCSegAlgoTC.cc:207
CSCRecHit2D.h
CSCSegAlgoTC::updateParameters
void updateParameters(void)
Definition: CSCSegAlgoTC.cc:280
CSCSegAlgoTC::myName
const std::string myName
Definition: CSCSegAlgoTC.h:191
CSCSegAlgoTC::flagHitsAsUsed
void flagHitsAsUsed(std::vector< CSCSegFit * >::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
Definition: CSCSegAlgoTC.cc:471
CSCSegAlgoTC
Definition: CSCSegAlgoTC.h:34
CSCSegAlgoTC::dRPhiMax
float dRPhiMax
Definition: CSCSegAlgoTC.h:171
CSCSegAlgoTC::areHitsCloseInLocalX
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Definition: CSCSegAlgoTC.cc:343