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
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
HoughGrouping::~HoughGrouping
~HoughGrouping() override
Definition: HoughGrouping.cc:84
DTGeometry
Definition: DTGeometry.h:28
HoughGrouping::maxdeltaPos_
double maxdeltaPos_
Definition: HoughGrouping.h:81
HoughGrouping::obtainGeometricalBorders
void obtainGeometricalBorders(const DTLayer *lay)
Definition: HoughGrouping.cc:308
PointTuple
std::tuple< double, double, unsigned short int > PointTuple
Definition: HoughGrouping.h:31
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
HoughGrouping::getMaximaVector
PointsInPlane getMaximaVector()
Definition: HoughGrouping.cc:391
HoughGrouping::anglebinwidth_
double anglebinwidth_
Definition: HoughGrouping.h:81
dqmiodumpindices.firstindex
firstindex
Definition: dqmiodumpindices.py:25
HoughGrouping::minNLayerHits_
unsigned short int minNLayerHits_
Definition: HoughGrouping.h:79
HoughGrouping::allowUncorrelatedPatterns_
bool allowUncorrelatedPatterns_
Definition: HoughGrouping.h:78
HoughGrouping::anglebins_
unsigned short int anglebins_
Definition: HoughGrouping.h:91
DTChamber
Definition: DTChamber.h:24
HoughGrouping::nhits_
unsigned short int nhits_
Definition: HoughGrouping.h:92
HoughGrouping
Definition: HoughGrouping.h:35
HoughGrouping::finish
void finish() override
Definition: HoughGrouping.cc:262
HoughGrouping::minSingleSLHitsMin_
unsigned short int minSingleSLHitsMin_
Definition: HoughGrouping.h:79
HoughGrouping::halfanglebins_
unsigned short int halfanglebins_
Definition: HoughGrouping.h:91
HoughGrouping::resetAttributes
void resetAttributes()
Definition: HoughGrouping.cc:271
HoughGrouping::doHoughTransform
void doHoughTransform()
Definition: HoughGrouping.cc:345
HoughGrouping::oneanglebin_
double oneanglebin_
Definition: HoughGrouping.h:87
HoughGrouping::thewheel_
short int thewheel_
Definition: HoughGrouping.h:94
HoughGrouping::zhighlim_
double zhighlim_
Definition: HoughGrouping.h:88
HoughGrouping::transformPair
PointInPlane transformPair(const PointInPlane &inputpair)
Definition: HoughGrouping.cc:427
HoughGrouping::areThereEnoughHits
bool areThereEnoughHits(const ProtoCand &tupl)
Definition: HoughGrouping.cc:875
MuonPathPtrs
std::vector< MuonPathPtr > MuonPathPtrs
Definition: MuonPath.h:128
ProtoCand::xDistToPattern_
std::vector< double > xDistToPattern_
Definition: HoughGrouping.h:25
DTprimitive.h
HoughGrouping::digimap_
std::map< unsigned short int, DTPrimitive > digimap_[8]
Definition: HoughGrouping.h:100
HoughGrouping::zlowlim_
double zlowlim_
Definition: HoughGrouping.h:88
HoughGrouping::minUncorrelatedHits_
unsigned short int minUncorrelatedHits_
Definition: HoughGrouping.h:79
HoughGrouping::getTwoDelta
PointInPlane getTwoDelta(const PointTuple &pair1, const PointTuple &pair2)
Definition: HoughGrouping.cc:527
HoughGrouping::initialise
void initialise(const edm::EventSetup &iEventSetup) override
Definition: HoughGrouping.cc:92
HoughGrouping::angletan_
double angletan_
Definition: HoughGrouping.h:81
HoughGrouping::dtGeo_
DTGeometry const * dtGeo_
Definition: HoughGrouping.h:83
HoughGrouping::maxrads_
double maxrads_
Definition: HoughGrouping.h:87
HoughGrouping::associateHits
ProtoCand associateHits(const DTChamber *thechamb, double m, double n)
Definition: HoughGrouping.cc:552
HoughGrouping::maxdeltaAngDeg_
double maxdeltaAngDeg_
Definition: HoughGrouping.h:81
ProtoCand::nLayersWithHits_
unsigned short int nLayersWithHits_
Definition: HoughGrouping.h:20
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
HoughGrouping::posbinwidth_
double posbinwidth_
Definition: HoughGrouping.h:81
HoughGrouping::thesector_
unsigned short int thesector_
Definition: HoughGrouping.h:93
ProtoCand
Definition: HoughGrouping.h:19
HoughGrouping::run
void run(edm::Event &iEvent, const edm::EventSetup &iEventSetup, const DTDigiCollection &digis, MuonPathPtrs &outMpath) override
Definition: HoughGrouping.cc:136
HoughGrouping::lowerNumber_
unsigned short int lowerNumber_
Definition: HoughGrouping.h:79
HoughGrouping::linespace_
std::vector< std::vector< unsigned short int > > linespace_
Definition: HoughGrouping.h:96
HoughGrouping::HoughGrouping
HoughGrouping(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
Definition: HoughGrouping.cc:54
HoughGrouping::TheChambId
DTChamberId TheChambId
Definition: HoughGrouping.h:85
ProtoCand::dtHits_
DTPrimitives dtHits_
Definition: HoughGrouping.h:26
MotherGrouping
Definition: MotherGrouping.h:29
HoughGrouping::idigi_
unsigned short int idigi_
Definition: HoughGrouping.h:92
HoughGrouping::hitvec_
PointsInPlane hitvec_
Definition: HoughGrouping.h:103
HoughGrouping::thestation_
unsigned short int thestation_
Definition: HoughGrouping.h:93
HoughGrouping::debug_
bool debug_
Definition: HoughGrouping.h:78
edm::ParameterSet
Definition: ParameterSet.h:47
HoughGrouping::dtGeomH
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH
Definition: HoughGrouping.h:84
HoughGrouping::maxDistanceToWire_
double maxDistanceToWire_
Definition: HoughGrouping.h:81
ProtoCand::isThereHitInLayer_
std::vector< bool > isThereHitInLayer_
Definition: HoughGrouping.h:21
DTDigiCollection
HoughGrouping::minSingleSLHitsMax_
unsigned short int minSingleSLHitsMax_
Definition: HoughGrouping.h:79
iEvent
int iEvent
Definition: GenABIO.cc:224
PointsInPlane
std::vector< PointInPlane > PointsInPlane
Definition: HoughGrouping.h:30
HoughGrouping::maxdeltaAng_
double maxdeltaAng_
Definition: HoughGrouping.h:89
HoughGrouping::orderAndFilter
void orderAndFilter(std::vector< ProtoCand > &invector, MuonPathPtrs &outMuonPath)
Definition: HoughGrouping.cc:750
PointInPlane
std::pair< double, double > PointInPlane
Definition: HoughGrouping.h:29
edm::EventSetup
Definition: EventSetup.h:58
HoughGrouping::findTheMaxima
PointsInPlane findTheMaxima(PointTuples &inputvec)
Definition: HoughGrouping.cc:437
PointTuples
std::vector< PointTuple > PointTuples
Definition: HoughGrouping.h:32
HoughGrouping::anglemap_
PointMap anglemap_
Definition: HoughGrouping.h:98
edm::ESGetToken< DTGeometry, MuonGeometryRecord >
DTLayer
Definition: DTLayer.h:25
ProtoCand::isThereNeighBourHitInLayer_
std::vector< bool > isThereNeighBourHitInLayer_
Definition: HoughGrouping.h:23
HoughGrouping::upperNumber_
unsigned short int upperNumber_
Definition: HoughGrouping.h:79
HoughGrouping::posmap_
PointMap posmap_
Definition: HoughGrouping.h:99
DTPrimitives
std::vector< DTPrimitive > DTPrimitives
Definition: DTprimitive.h:53
HoughGrouping::getAveragePoint
PointInPlane getAveragePoint(const PointTuples &inputvec, unsigned short int firstindex, const std::vector< unsigned short int > &indexlist)
Definition: HoughGrouping.cc:533
MuonPath.h
HoughGrouping::maxima_
PointsInPlane maxima_
Definition: HoughGrouping.h:102
PointMap
std::map< unsigned short int, double > PointMap
Definition: HoughGrouping.h:33
HoughGrouping::setDifferenceBetweenSL
void setDifferenceBetweenSL(ProtoCand &tupl)
Definition: HoughGrouping.cc:731
DTChamberId
Definition: DTChamberId.h:14
HoughGrouping::minangle_
double minangle_
Definition: HoughGrouping.h:87
HoughGrouping::xhighlim_
double xhighlim_
Definition: HoughGrouping.h:88
HoughGrouping::resetPosElementsOfLinespace
void resetPosElementsOfLinespace()
Definition: HoughGrouping.cc:299
edm::Event
Definition: Event.h:73
MotherGrouping.h
HoughGrouping::spacebins_
unsigned short int spacebins_
Definition: HoughGrouping.h:91
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
ProtoCand::nHitsDiff_
unsigned short int nHitsDiff_
Definition: HoughGrouping.h:24
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
HoughGrouping::xlowlim_
double xlowlim_
Definition: HoughGrouping.h:88