CMS 3D CMS Logo

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,
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
CSCSegAlgoSK::sfit_
CSCSegFit * sfit_
Definition: CSCSegAlgoSK.h:134
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
CSCSegmentAlgorithm
Definition: CSCSegmentAlgorithm.h:23
CSCSegAlgoSK
Definition: CSCSegAlgoSK.h:35
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
CSCSegAlgoSK::addHit
bool addHit(const CSCRecHit2D *hit, int layer)
Utility functions.
Definition: CSCSegAlgoSK.cc:358
CSCSegAlgoSK::flagHitsAsUsed
void flagHitsAsUsed(const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
Definition: CSCSegAlgoSK.cc:345
CSCSegFit
Definition: CSCSegFit.h:30
CSCSegAlgoSK::chi2Max
float chi2Max
Definition: CSCSegAlgoSK.h:129
CSCSegAlgoSK::ChamberHitContainer
std::vector< const CSCRecHit2D * > ChamberHitContainer
Definition: CSCSegAlgoSK.h:48
CSCSegAlgoSK::isHitNearSegment
bool isHitNearSegment(const CSCRecHit2D *h) const
Definition: CSCSegAlgoSK.cc:263
CSCSegAlgoSK::ChamberHitContainerCIt
std::vector< const CSCRecHit2D * >::const_iterator ChamberHitContainerCIt
Definition: CSCSegAlgoSK.h:49
CSCSegAlgoSK::dRPhiFineMax
float dRPhiFineMax
Definition: CSCSegAlgoSK.h:127
CSCSegAlgoSK::theChamber
const CSCChamber * theChamber
Definition: CSCSegAlgoSK.h:120
DDAxes::z
CSCSegAlgoSK::dumpHits
void dumpHits(const ChamberHitContainer &rechits) const
Definition: CSCSegAlgoSK.cc:313
CSCChamber
Definition: CSCChamber.h:22
CSCSegAlgoSK::debugInfo
bool debugInfo
Definition: CSCSegAlgoSK.h:132
CSCSegAlgoSK::CSCSegAlgoSK
CSCSegAlgoSK(const edm::ParameterSet &ps)
Constructor.
Definition: CSCSegAlgoSK.cc:19
CSCSegAlgoSK::dumpSegment
void dumpSegment(const CSCSegment &seg) const
Definition: CSCSegAlgoSK.cc:453
HI_PhotonSkim_cff.rechits
rechits
Definition: HI_PhotonSkim_cff.py:76
h
CSCSegAlgoSK::isSegmentGood
bool isSegmentGood(const ChamberHitContainer &rechitsInChamber) const
Definition: CSCSegAlgoSK.cc:328
CSCSegAlgoSK::dRPhiMax
float dRPhiMax
Definition: CSCSegAlgoSK.h:125
CSCSegment
Definition: CSCSegment.h:21
CSCSegAlgoSK::compareProtoSegment
void compareProtoSegment(const CSCRecHit2D *h, int layer)
Definition: CSCSegAlgoSK.cc:407
CSCSegAlgoSK::BoolContainer
std::deque< bool > BoolContainer
Definition: CSCSegAlgoSK.h:56
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCSegAlgoSK::myName
const std::string myName
Definition: CSCSegAlgoSK.h:122
CSCSegAlgoSK::LayerIndex
std::vector< int > LayerIndex
Typedefs.
Definition: CSCSegAlgoSK.h:47
CSCSegAlgoSK::~CSCSegAlgoSK
~CSCSegAlgoSK() override
Destructor.
Definition: CSCSegAlgoSK.h:61
CSCSegAlgoSK::wideSeg
float wideSeg
Definition: CSCSegAlgoSK.h:130
edm::ParameterSet
Definition: ParameterSet.h:47
CSCRecHit2D
Definition: CSCRecHit2D.h:18
CSCSegAlgoSK::run
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits) override
Definition: CSCSegAlgoSK.cc:42
CSCSegAlgoSK::updateParameters
void updateParameters(void)
Definition: CSCSegAlgoSK.cc:376
CSCSegAlgoSK::areHitsCloseInGlobalPhi
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Definition: CSCSegAlgoSK.cc:244
CSCSegAlgoSK::tryAddingHitsToSegment
void tryAddingHitsToSegment(const ChamberHitContainer &rechitsInChamber, const BoolContainer &used, const LayerIndex &layerIndex, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
Definition: CSCSegAlgoSK.cc:196
CSCSegAlgoSK::replaceHit
bool replaceHit(const CSCRecHit2D *h, int layer)
Definition: CSCSegAlgoSK.cc:394
CSCSegAlgoSK::windowScale
float windowScale
Definition: CSCSegAlgoSK.h:124
CSCSegAlgoSK::buildSegments
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
Definition: CSCSegAlgoSK.cc:47
CSCSegAlgoSK::minLayersApart
int minLayersApart
Definition: CSCSegAlgoSK.h:131
CSCSegmentAlgorithm.h
CSCSegAlgoSK::dPhiFineMax
float dPhiFineMax
Definition: CSCSegAlgoSK.h:128
CSCRecHit2D.h
CSCSegAlgoSK::increaseProtoSegment
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
Definition: CSCSegAlgoSK.cc:429
CSCSegAlgoSK::proto_segment
ChamberHitContainer proto_segment
Definition: CSCSegAlgoSK.h:121
CSCSegAlgoSK::areHitsCloseInLocalX
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Utility functions.
Definition: CSCSegAlgoSK.cc:237
CSCSegAlgoSK::dPhiMax
float dPhiMax
Definition: CSCSegAlgoSK.h:126
CSCSegAlgoSK::phiAtZ
float phiAtZ(float z) const
Definition: CSCSegAlgoSK.cc:291
CSCSegAlgoSK::hasHitOnLayer
bool hasHitOnLayer(int layer) const
Definition: CSCSegAlgoSK.cc:383
hit
Definition: SiStripHitEffFromCalibTree.cc:88