CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
82 
86 
89  double maxdeltaAng_;
90 
91  unsigned short int anglebins_, halfanglebins_, spacebins_;
92  unsigned short int idigi_, nhits_;
93  unsigned short int thestation_, thesector_;
94  short int thewheel_;
95 
96  std::vector<std::vector<unsigned short int>> linespace_;
97 
100  std::map<unsigned short int, DTPrimitive> digimap_[8];
101 
104 };
105 
106 #endif
std::tuple< double, double, unsigned short int > PointTuple
Definition: HoughGrouping.h:31
unsigned short int lowerNumber_
Definition: HoughGrouping.h:79
unsigned short int anglebins_
Definition: HoughGrouping.h:91
void doHoughTransform()
unsigned short int minNLayerHits_
Definition: HoughGrouping.h:79
double xhighlim_
Definition: HoughGrouping.h:88
unsigned short int nLayersWithHits_
Definition: HoughGrouping.h:20
double maxdeltaAngDeg_
Definition: HoughGrouping.h:81
PointInPlane getTwoDelta(const PointTuple &pair1, const PointTuple &pair2)
void setDifferenceBetweenSL(ProtoCand &tupl)
unsigned short int thestation_
Definition: HoughGrouping.h:93
PointsInPlane maxima_
void run(edm::Event &iEvent, const edm::EventSetup &iEventSetup, const DTDigiCollection &digis, MuonPathPtrs &outMpath) override
DTGeometry const * dtGeo_
Definition: HoughGrouping.h:83
double maxDistanceToWire_
Definition: HoughGrouping.h:81
unsigned short int upperNumber_
Definition: HoughGrouping.h:79
ProtoCand associateHits(const DTChamber *thechamb, double m, double n)
std::vector< MuonPathPtr > MuonPathPtrs
Definition: MuonPath.h:128
unsigned short int minUncorrelatedHits_
Definition: HoughGrouping.h:79
DTPrimitives dtHits_
Definition: HoughGrouping.h:26
bool allowUncorrelatedPatterns_
Definition: HoughGrouping.h:78
double zhighlim_
Definition: HoughGrouping.h:88
void orderAndFilter(std::vector< ProtoCand > &invector, MuonPathPtrs &outMuonPath)
PointsInPlane getMaximaVector()
unsigned short int minSingleSLHitsMin_
Definition: HoughGrouping.h:79
unsigned short int thesector_
Definition: HoughGrouping.h:93
void initialise(const edm::EventSetup &iEventSetup) override
unsigned short int spacebins_
Definition: HoughGrouping.h:91
double maxdeltaPos_
Definition: HoughGrouping.h:81
unsigned short int idigi_
Definition: HoughGrouping.h:92
PointsInPlane findTheMaxima(PointTuples &inputvec)
unsigned short int nhits_
Definition: HoughGrouping.h:92
HoughGrouping(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
int iEvent
Definition: GenABIO.cc:224
PointsInPlane hitvec_
double posbinwidth_
Definition: HoughGrouping.h:81
PointInPlane getAveragePoint(const PointTuples &inputvec, unsigned short int firstindex, const std::vector< unsigned short int > &indexlist)
double minangle_
Definition: HoughGrouping.h:87
PointInPlane transformPair(const PointInPlane &inputpair)
double maxdeltaAng_
Definition: HoughGrouping.h:89
PointMap anglemap_
Definition: HoughGrouping.h:98
void obtainGeometricalBorders(const DTLayer *lay)
double angletan_
Definition: HoughGrouping.h:81
unsigned short int minSingleSLHitsMax_
Definition: HoughGrouping.h:79
std::vector< PointInPlane > PointsInPlane
Definition: HoughGrouping.h:30
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH
Definition: HoughGrouping.h:84
void resetPosElementsOfLinespace()
std::pair< double, double > PointInPlane
Definition: HoughGrouping.h:29
double anglebinwidth_
Definition: HoughGrouping.h:81
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:96
double oneanglebin_
Definition: HoughGrouping.h:87
void finish() override
DTChamberId TheChambId
Definition: HoughGrouping.h:85
unsigned short int nHitsDiff_
Definition: HoughGrouping.h:24
~HoughGrouping() override
PointMap posmap_
Definition: HoughGrouping.h:99
unsigned short int halfanglebins_
Definition: HoughGrouping.h:91
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:94
std::vector< bool > isThereNeighBourHitInLayer_
Definition: HoughGrouping.h:23