CMS 3D CMS Logo

HoughGrouping.h
Go to the documentation of this file.
1 #ifndef L1Trigger_DTTriggerPhase2_HoughGrouping_h
2 #define L1Trigger_DTTriggerPhase2_HoughGrouping_h
3 
4 // System / std headers
5 #include <memory>
6 #include <cstdlib>
7 #include <stdexcept>
8 #include <iostream>
9 #include <vector>
10 
11 // Other headers
15 
16 // ===============================================================================
17 // Class declarations
18 // ===============================================================================
19 struct ProtoCand {
20  unsigned short int nLayersWithHits_; // 0: # of layers with hits.
21  std::vector<bool> isThereHitInLayer_; // 1: # of hits of high quality (the expected line crosses the cell).
22  std::vector<bool>
23  isThereNeighBourHitInLayer_; // 2: # of hits of low quality (the expected line is in a neighbouring cell).
24  unsigned short int nHitsDiff_; // 3: absolute diff. between the number of hits in SL1 and SL3.
25  std::vector<double> xDistToPattern_; // 4: absolute distance to all hits of the segment.
26  DTPrimitives dtHits_; // 5: DTPrimitive of the candidate.
27 };
28 
29 typedef std::pair<double, double> PointInPlane;
30 typedef std::vector<PointInPlane> PointsInPlane;
31 typedef std::tuple<double, double, unsigned short int> PointTuple;
32 typedef std::vector<PointTuple> PointTuples;
33 typedef std::map<unsigned short int, double> PointMap;
34 
35 class HoughGrouping : public MotherGrouping {
36 public:
37  // Constructors and destructor
39  ~HoughGrouping() override;
40 
41  // Main methods
42  void initialise(const edm::EventSetup& iEventSetup) override;
43  void run(edm::Event& iEvent,
44  const edm::EventSetup& iEventSetup,
45  const DTDigiCollection& digis,
46  MuonPathPtrs& outMpath) override;
47  void finish() override;
48 
49  // Other public methods
50  // Public attributes
51 
52 private:
53  // Private methods
54  void resetAttributes();
56 
57  void obtainGeometricalBorders(const DTLayer* lay);
58 
59  void doHoughTransform();
60 
63 
64  PointInPlane getTwoDelta(const PointTuple& pair1, const PointTuple& pair2);
66  unsigned short int firstindex,
67  const std::vector<unsigned short int>& indexlist);
68  PointInPlane transformPair(const PointInPlane& inputpair);
69 
70  ProtoCand associateHits(const DTChamber* thechamb, double m, double n);
71 
72  void orderAndFilter(std::vector<ProtoCand>& invector, MuonPathPtrs& outMuonPath);
73 
75  bool areThereEnoughHits(const ProtoCand& tupl);
76 
77  // Private attributes
78  const bool debug_;
83 
87 
90  double maxdeltaAng_;
91 
92  unsigned short int anglebins_, halfanglebins_, spacebins_;
93  unsigned short int idigi_, nhits_;
94  unsigned short int thestation_, thesector_;
95  short int thewheel_;
96 
97  std::vector<std::vector<unsigned short int>> linespace_;
98 
101  std::map<unsigned short int, DTPrimitive> digimap_[8];
102 
105 };
106 
107 #endif
std::tuple< double, double, unsigned short int > PointTuple
Definition: HoughGrouping.h:31
unsigned short int lowerNumber_
Definition: HoughGrouping.h:80
unsigned short int anglebins_
Definition: HoughGrouping.h:92
void doHoughTransform()
unsigned short int minNLayerHits_
Definition: HoughGrouping.h:80
double xhighlim_
Definition: HoughGrouping.h:89
unsigned short int nLayersWithHits_
Definition: HoughGrouping.h:20
double maxdeltaAngDeg_
Definition: HoughGrouping.h:82
PointInPlane getTwoDelta(const PointTuple &pair1, const PointTuple &pair2)
void setDifferenceBetweenSL(ProtoCand &tupl)
unsigned short int thestation_
Definition: HoughGrouping.h:94
PointsInPlane maxima_
void run(edm::Event &iEvent, const edm::EventSetup &iEventSetup, const DTDigiCollection &digis, MuonPathPtrs &outMpath) override
DTGeometry const * dtGeo_
Definition: HoughGrouping.h:84
double maxDistanceToWire_
Definition: HoughGrouping.h:82
unsigned short int upperNumber_
Definition: HoughGrouping.h:80
ProtoCand associateHits(const DTChamber *thechamb, double m, double n)
std::vector< MuonPathPtr > MuonPathPtrs
Definition: MuonPath.h:128
unsigned short int minUncorrelatedHits_
Definition: HoughGrouping.h:80
DTPrimitives dtHits_
Definition: HoughGrouping.h:26
bool allowUncorrelatedPatterns_
Definition: HoughGrouping.h:79
double zhighlim_
Definition: HoughGrouping.h:89
void orderAndFilter(std::vector< ProtoCand > &invector, MuonPathPtrs &outMuonPath)
PointsInPlane getMaximaVector()
unsigned short int minSingleSLHitsMin_
Definition: HoughGrouping.h:80
unsigned short int thesector_
Definition: HoughGrouping.h:94
void initialise(const edm::EventSetup &iEventSetup) override
unsigned short int spacebins_
Definition: HoughGrouping.h:92
double maxdeltaPos_
Definition: HoughGrouping.h:82
unsigned short int idigi_
Definition: HoughGrouping.h:93
PointsInPlane findTheMaxima(PointTuples &inputvec)
unsigned short int nhits_
Definition: HoughGrouping.h:93
HoughGrouping(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
int iEvent
Definition: GenABIO.cc:224
const bool debug_
Definition: HoughGrouping.h:78
PointsInPlane hitvec_
double posbinwidth_
Definition: HoughGrouping.h:82
PointInPlane getAveragePoint(const PointTuples &inputvec, unsigned short int firstindex, const std::vector< unsigned short int > &indexlist)
double minangle_
Definition: HoughGrouping.h:88
PointInPlane transformPair(const PointInPlane &inputpair)
double maxdeltaAng_
Definition: HoughGrouping.h:90
PointMap anglemap_
Definition: HoughGrouping.h:99
void obtainGeometricalBorders(const DTLayer *lay)
double angletan_
Definition: HoughGrouping.h:82
unsigned short int minSingleSLHitsMax_
Definition: HoughGrouping.h:80
std::vector< PointInPlane > PointsInPlane
Definition: HoughGrouping.h:30
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH
Definition: HoughGrouping.h:85
void resetPosElementsOfLinespace()
std::pair< double, double > PointInPlane
Definition: HoughGrouping.h:29
double anglebinwidth_
Definition: HoughGrouping.h:82
std::vector< PointTuple > PointTuples
Definition: HoughGrouping.h:32
std::vector< double > xDistToPattern_
Definition: HoughGrouping.h:25
std::vector< std::vector< unsigned short int > > linespace_
Definition: HoughGrouping.h:97
double oneanglebin_
Definition: HoughGrouping.h:88
void finish() override
DTChamberId TheChambId
Definition: HoughGrouping.h:86
unsigned short int nHitsDiff_
Definition: HoughGrouping.h:24
~HoughGrouping() override
PointMap posmap_
unsigned short int halfanglebins_
Definition: HoughGrouping.h:92
void resetAttributes()
std::map< unsigned short int, double > PointMap
Definition: HoughGrouping.h:33
bool areThereEnoughHits(const ProtoCand &tupl)
std::map< unsigned short int, DTPrimitive > digimap_[8]
std::vector< DTPrimitive > DTPrimitives
Definition: DTprimitive.h:53
std::vector< bool > isThereHitInLayer_
Definition: HoughGrouping.h:21
short int thewheel_
Definition: HoughGrouping.h:95
std::vector< bool > isThereNeighBourHitInLayer_
Definition: HoughGrouping.h:23