CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TTUTrackingAlg.h
Go to the documentation of this file.
1 #ifndef TTUTRACKINGALG_H
2 #define TTUTRACKINGALG_H 1
3 
4 // Include files
5 #include <memory>
8 
9 #include <iostream>
10 #include <vector>
11 
26 class TTUTrackingAlg : public TTULogic {
27 public:
30 
31  ~TTUTrackingAlg() override;
32 
33  //... from TTULogic interface:
34 
35  bool process(const TTUInput&) override;
36 
37  void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig&) override;
38 
39  //...
40 
41  class Seed {
42  public:
43  Seed() {
44  m_sectorId = -9;
45  m_stationId = -1;
46  m_tkLength = 0;
47  };
48  Seed(int _seId, int _stId, int _tl) {
49  m_sectorId = _seId;
50  m_stationId = _stId;
51  m_tkLength = _tl;
52  };
53 
54  bool operator==(const Seed& rhs) { return (m_sectorId == rhs.m_sectorId) && (m_stationId == rhs.m_stationId); };
55 
56  int m_sectorId;
59  };
60 
61  class Track {
62  public:
63  Track() { m_tracklength = 0; };
64 
65  Track(const Track&) = delete;
66  Track(Track&&) = delete;
67  Track& operator=(Track const&) = delete;
68  Track& operator=(Track&&) = delete;
69 
70  void add(Seed* sd) {
71  m_seeds.push_back(sd);
72  ++m_tracklength;
73  };
74 
75  void addnone() {
76  if (not m_none) {
77  m_none = std::make_unique<Seed>(0, 0, 0);
78  }
79  m_seeds.push_back(m_none.get());
80  m_tracklength = -1;
81  };
82 
83  void updateTrkLength() { m_tracklength = m_seeds.size(); };
84 
85  bool operator<(const Track& rhs) { return m_tracklength < rhs.m_tracklength; };
86 
87  int length() { return m_tracklength; };
88 
89  std::vector<Seed*> m_seeds;
90 
91  private:
92  std::unique_ptr<Seed> m_none;
94  };
95 
97 
98  template <class T>
100  bool operator()(T const& a, T const& b) { return (*a) < (*b); }
101  };
102 
103 protected:
104 private:
105  void runSeedBuster(const TTUInput&);
106 
107  void findNeighbors(Seed*, std::vector<Seed*>&);
108 
109  int executeTracker(Track*, std::vector<Seed*>&);
110 
111  void filter(Track*, std::vector<Seed*>&);
112 
113  void ghostBuster(Track*);
114 
115  void alignTracks();
116 
117  void cleanUp();
118 
120 
121  int m_SEscanorder[12];
122 
124 
125  std::vector<std::unique_ptr<Track>> m_tracks;
126 
127  std::vector<std::unique_ptr<Seed>> m_initialseeds;
128 
129  inline void print(const std::vector<Seed*>& seeds) {
130  std::vector<Seed*>::const_iterator itr;
131  for (itr = seeds.begin(); itr != seeds.end(); ++itr)
132  std::cout << (*itr) << '\t';
133  std::cout << '\n';
134  };
135 
136  bool m_debug;
137 };
138 #endif // TTUTRACKINGALG_H
std::vector< std::unique_ptr< Seed > > m_initialseeds
int m_SEscanorder[12]
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &) override
void findNeighbors(Seed *, std::vector< Seed * > &)
void print(const std::vector< Seed * > &seeds)
void ghostBuster(Track *)
TTUTrackingAlg()
Standard constructor.
void setMinTrkLength(int val)
std::vector< std::unique_ptr< Track > > m_tracks
bool operator==(const Seed &rhs)
void filter(Track *, std::vector< Seed * > &)
Track & operator=(Track const &)=delete
Seed(int _seId, int _stId, int _tl)
std::vector< Seed * > m_seeds
std::unique_ptr< Seed > m_none
int executeTracker(Track *, std::vector< Seed * > &)
~TTUTrackingAlg() override
Destructor.
bool process(const TTUInput &) override
bool operator()(T const &a, T const &b)
void runSeedBuster(const TTUInput &)
double sd
double b
Definition: hdecay.h:118
bool operator<(const Track &rhs)
double a
Definition: hdecay.h:119
tuple cout
Definition: gather_cfg.py:144
long double T
void add(Seed *sd)