CMS 3D CMS Logo

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
TTUInput.h
TTUTrackingAlg::Track::Track
Track()
Definition: TTUTrackingAlg.h:63
TTUTrackingAlg::Seed::m_stationId
int m_stationId
Definition: TTUTrackingAlg.h:57
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TTUTrackingAlg::Track::add
void add(Seed *sd)
Definition: TTUTrackingAlg.h:70
TTUTrackingAlg::Seed::m_tkLength
int m_tkLength
Definition: TTUTrackingAlg.h:58
TTUTrackingAlg::setMinTrkLength
void setMinTrkLength(int val)
Definition: TTUTrackingAlg.h:96
TTUTrackingAlg::cleanUp
void cleanUp()
Definition: TTUTrackingAlg.cc:256
TTUTrackingAlg::Seed::Seed
Seed()
Definition: TTUTrackingAlg.h:43
TTUTrackingAlg::m_mintrklength
int m_mintrklength
Definition: TTUTrackingAlg.h:123
TTUTrackingAlg::filter
void filter(Track *, std::vector< Seed * > &)
Definition: TTUTrackingAlg.cc:207
TTUTrackingAlg::Seed::operator==
bool operator==(const Seed &rhs)
Definition: TTUTrackingAlg.h:54
TTUTrackingAlg::Seed
Definition: TTUTrackingAlg.h:41
TTUTrackingAlg::setBoardSpecs
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &) override
Definition: TTUTrackingAlg.cc:38
TTUTrackingAlg::Track::addnone
void addnone()
Definition: TTUTrackingAlg.h:75
TTUInput
Definition: TTUInput.h:18
TTUTrackingAlg::CompareMechanism
Definition: TTUTrackingAlg.h:99
TTUTrackingAlg::runSeedBuster
void runSeedBuster(const TTUInput &)
Definition: TTUTrackingAlg.cc:119
TTUTrackingAlg::executeTracker
int executeTracker(Track *, std::vector< Seed * > &)
Definition: TTUTrackingAlg.cc:145
b
double b
Definition: hdecay.h:118
TTUTrackingAlg::m_SEscanorder
int m_SEscanorder[12]
Definition: TTUTrackingAlg.h:121
TTULogic.h
TTUTrackingAlg::Seed::Seed
Seed(int _seId, int _stId, int _tl)
Definition: TTUTrackingAlg.h:48
TTUBoardSpecs::TTUBoardConfig
Definition: TTUBoardSpecs.h:25
TTUTrackingAlg::Track::operator=
Track & operator=(Track const &)=delete
a
double a
Definition: hdecay.h:119
TTUTrackingAlg::CompareMechanism::operator()
bool operator()(T const &a, T const &b)
Definition: TTUTrackingAlg.h:100
TTUTrackingAlg::Track::m_seeds
std::vector< Seed * > m_seeds
Definition: TTUTrackingAlg.h:87
TTUTrackingAlg::ghostBuster
void ghostBuster(Track *)
Definition: TTUTrackingAlg.cc:222
TTUTrackingAlg::Track::m_tracklength
int m_tracklength
Definition: TTUTrackingAlg.h:93
TTUTrackingAlg::Track::updateTrkLength
void updateTrkLength()
Definition: TTUTrackingAlg.h:83
TTUTrackingAlg::Track::length
int length()
Definition: TTUTrackingAlg.h:87
TTUTrackingAlg::Track
Definition: TTUTrackingAlg.h:61
TTULogic
Definition: TTULogic.h:18
TTUTrackingAlg::m_STscanorder
int m_STscanorder[6]
Definition: TTUTrackingAlg.h:119
heppy_batch.val
val
Definition: heppy_batch.py:351
TTUTrackingAlg::Track::m_none
std::unique_ptr< Seed > m_none
Definition: TTUTrackingAlg.h:92
DetachedQuadStep_cff.seeds
seeds
Definition: DetachedQuadStep_cff.py:195
TTUTrackingAlg
Definition: TTUTrackingAlg.h:26
TTUTrackingAlg::findNeighbors
void findNeighbors(Seed *, std::vector< Seed * > &)
Definition: TTUTrackingAlg.cc:175
T
long double T
Definition: Basic3DVectorLD.h:48
TTUTrackingAlg::Track::operator<
bool operator<(const Track &rhs)
Definition: TTUTrackingAlg.h:85
TTUTrackingAlg::~TTUTrackingAlg
~TTUTrackingAlg() override
Destructor.
Definition: TTUTrackingAlg.cc:35
TTUTrackingAlg::print
void print(const std::vector< Seed * > &seeds)
Definition: TTUTrackingAlg.h:129
TTUTrackingAlg::m_tracks
std::vector< std::unique_ptr< Track > > m_tracks
Definition: TTUTrackingAlg.h:125
sd
double sd
Definition: CascadeWrapper.h:113
TTUTrackingAlg::m_initialseeds
std::vector< std::unique_ptr< Seed > > m_initialseeds
Definition: TTUTrackingAlg.h:127
TTUTrackingAlg::alignTracks
void alignTracks()
Definition: TTUTrackingAlg.cc:243
TTUTrackingAlg::process
bool process(const TTUInput &) override
Definition: TTUTrackingAlg.cc:42
TTUTrackingAlg::m_debug
bool m_debug
Definition: TTUTrackingAlg.h:134
TTUTrackingAlg::TTUTrackingAlg
TTUTrackingAlg()
Standard constructor.
Definition: TTUTrackingAlg.cc:16
trklet::Seed
Seed
Definition: Settings.h:49
TTUTrackingAlg::Seed::m_sectorId
int m_sectorId
Definition: TTUTrackingAlg.h:54