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
7 
8 #include <iostream>
9 #include <vector>
10 
25 class TTUTrackingAlg : public TTULogic {
26 public:
29 
30  ~TTUTrackingAlg() override;
31 
32  //... from TTULogic interface:
33 
34  bool process(const TTUInput&) override;
35 
36  void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig&) override;
37 
38  //...
39 
40  class Seed {
41  public:
42  Seed() {
43  m_sectorId = -9;
44  m_stationId = -1;
45  m_tkLength = 0;
46  };
47  Seed(int _seId, int _stId, int _tl) {
48  m_sectorId = _seId;
49  m_stationId = _stId;
50  m_tkLength = _tl;
51  };
52 
53  bool operator==(const Seed& rhs) { return (m_sectorId == rhs.m_sectorId) && (m_stationId == rhs.m_stationId); };
54 
55  int m_sectorId;
58  };
59 
60  class Track {
61  public:
62  Track() { m_tracklength = 0; };
63 
64  Track(const Track&) = delete;
65  Track(Track&&) = delete;
66  Track& operator=(Track const&) = delete;
67  Track& operator=(Track&&) = delete;
68 
69  void add(Seed* sd) {
70  m_seeds.push_back(sd);
71  ++m_tracklength;
72  };
73 
74  void addnone() {
75  if (not m_none) {
76  m_none = std::make_unique<Seed>(0, 0, 0);
77  }
78  m_seeds.push_back(m_none.get());
79  m_tracklength = -1;
80  };
81 
82  void updateTrkLength() { m_tracklength = m_seeds.size(); };
83 
84  bool operator<(const Track& rhs) { return m_tracklength < rhs.m_tracklength; };
85 
86  int length() { return m_tracklength; };
87 
88  std::vector<Seed*> m_seeds;
89 
90  private:
91  std::unique_ptr<Seed> m_none;
93  };
94 
96 
97  template <class T>
99  bool operator()(T const& a, T const& b) { return (*a) < (*b); }
100  };
101 
102 protected:
103 private:
104  void runSeedBuster(const TTUInput&);
105 
106  void findNeighbors(Seed*, std::vector<Seed*>&);
107 
108  int executeTracker(Track*, std::vector<Seed*>&);
109 
110  void filter(Track*, std::vector<Seed*>&);
111 
112  void ghostBuster(Track*);
113 
114  void alignTracks();
115 
116  void cleanUp();
117 
119 
120  int m_SEscanorder[12];
121 
123 
124  std::vector<std::unique_ptr<Track>> m_tracks;
125 
126  std::vector<std::unique_ptr<Seed>> m_initialseeds;
127 
128  inline void print(const std::vector<Seed*>& seeds) {
129  std::vector<Seed*>::const_iterator itr;
130  for (itr = seeds.begin(); itr != seeds.end(); ++itr)
131  std::cout << (*itr) << '\t';
132  std::cout << '\n';
133  };
134 
135  bool m_debug;
136 };
137 #endif // TTUTRACKINGALG_H
TTUInput.h
TTUTrackingAlg::Track::Track
Track()
Definition: TTUTrackingAlg.h:62
TTUTrackingAlg::Seed::m_stationId
int m_stationId
Definition: TTUTrackingAlg.h:56
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TTUTrackingAlg::Track::add
void add(Seed *sd)
Definition: TTUTrackingAlg.h:69
TTUTrackingAlg::Seed::m_tkLength
int m_tkLength
Definition: TTUTrackingAlg.h:57
TTUTrackingAlg::setMinTrkLength
void setMinTrkLength(int val)
Definition: TTUTrackingAlg.h:95
TTUTrackingAlg::cleanUp
void cleanUp()
Definition: TTUTrackingAlg.cc:256
TTUTrackingAlg::Seed::Seed
Seed()
Definition: TTUTrackingAlg.h:42
TTUTrackingAlg::m_mintrklength
int m_mintrklength
Definition: TTUTrackingAlg.h:122
TTUTrackingAlg::filter
void filter(Track *, std::vector< Seed * > &)
Definition: TTUTrackingAlg.cc:207
TTUTrackingAlg::Seed::operator==
bool operator==(const Seed &rhs)
Definition: TTUTrackingAlg.h:53
TTUTrackingAlg::Seed
Definition: TTUTrackingAlg.h:40
TTUTrackingAlg::setBoardSpecs
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &) override
Definition: TTUTrackingAlg.cc:38
TTUTrackingAlg::Track::addnone
void addnone()
Definition: TTUTrackingAlg.h:74
TTUInput
Definition: TTUInput.h:18
TTUTrackingAlg::CompareMechanism
Definition: TTUTrackingAlg.h:98
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:120
TTULogic.h
TTUTrackingAlg::Seed::Seed
Seed(int _seId, int _stId, int _tl)
Definition: TTUTrackingAlg.h:47
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:232
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:99
TTUTrackingAlg::Track::m_seeds
std::vector< Seed * > m_seeds
Definition: TTUTrackingAlg.h:86
TTUTrackingAlg::ghostBuster
void ghostBuster(Track *)
Definition: TTUTrackingAlg.cc:222
TTUTrackingAlg::Track::m_tracklength
int m_tracklength
Definition: TTUTrackingAlg.h:92
TTUTrackingAlg::Track::updateTrkLength
void updateTrkLength()
Definition: TTUTrackingAlg.h:82
TTUTrackingAlg::Track::length
int length()
Definition: TTUTrackingAlg.h:86
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
TTUTrackingAlg::Track
Definition: TTUTrackingAlg.h:60
TTULogic
Definition: TTULogic.h:18
TTUTrackingAlg::m_STscanorder
int m_STscanorder[6]
Definition: TTUTrackingAlg.h:118
heppy_batch.val
val
Definition: heppy_batch.py:351
TTUTrackingAlg::Track::m_none
std::unique_ptr< Seed > m_none
Definition: TTUTrackingAlg.h:91
TTUTrackingAlg
Definition: TTUTrackingAlg.h:25
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:84
TTUTrackingAlg::~TTUTrackingAlg
~TTUTrackingAlg() override
Destructor.
Definition: TTUTrackingAlg.cc:35
TTUTrackingAlg::print
void print(const std::vector< Seed * > &seeds)
Definition: TTUTrackingAlg.h:128
TTUTrackingAlg::m_tracks
std::vector< std::unique_ptr< Track > > m_tracks
Definition: TTUTrackingAlg.h:124
sd
double sd
Definition: CascadeWrapper.h:113
TTUTrackingAlg::m_initialseeds
std::vector< std::unique_ptr< Seed > > m_initialseeds
Definition: TTUTrackingAlg.h:126
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:133
TTUTrackingAlg::TTUTrackingAlg
TTUTrackingAlg()
Standard constructor.
Definition: TTUTrackingAlg.cc:16
TTUTrackingAlg::Seed::m_sectorId
int m_sectorId
Definition: TTUTrackingAlg.h:53