20 int StOrder[6]={6,5,4,3,2,1};
21 int SeOrder[12]={4,5,3,6,2,7,1,8,12,9,11,10};
23 for(
int i=0;
i < 6; ++
i)
58 auto initTrk =std::make_unique<Track>();
67 if(
m_debug)
std::cout <<
"TTUTrackingAlg>process() ends: no initialseeds" << std::endl;
75 std::vector<Seed*> neighbors;
87 auto initTrk = std::make_unique<Track>();
88 initTrk->add((*_seed).get());
98 std::cout <<
"length: " << tr->length() <<
'\t';
109 if ( itr !=
m_tracks.end() ) tracklen = (*itr)->length();
116 << tracklen <<
'\t' <<
"triggered: " 138 for(
int i=0;
i < 12; ++
i)
143 if ( ! station.any() )
continue;
145 for(
int k=0;
k < 6; ++
k ) {
148 bool _hit = station[idy];
151 m_initialseeds.emplace_back(std::make_unique<Seed>(idx, idy, 0) );
164 if (
m_debug )
std::cout <<
"executeTracker: " << neighbors.size() << std::endl;
168 auto _itr = neighbors.begin();
170 while( _itr != neighbors.end() ) {
172 _trk->
add( (*_itr) );
174 std::vector<Seed*> _nextneighbors;
178 filter( _trk, _nextneighbors );
180 if ( _nextneighbors.size() == 1 )
211 int _difx =
std::abs( _xo - (*_itr)->m_sectorId );
212 int _dify =
std::abs( _yo - (*_itr)->m_stationId );
214 if (
m_debug)
std::cout <<
"difference (x,y): " << _difx <<
"," << _dify <<
"\t";
216 if ( _difx == 11 ) _difx = 1;
218 if ( ((_difx == 1) && (_dify == 1)) ||
219 ((_difx == 1) && (_dify == 0)) ||
220 ((_difx == 0) && (_dify == 1)) )
222 neighbors.push_back( (*_itr).get() );
232 std::vector<Seed*> & _nbrs )
238 for(
auto _itr = _trk->
m_seeds.begin();_itr != _trk->
m_seeds.end(); ++_itr)
240 auto _isalready =
std::find( _nbrs.begin(),_nbrs.end(), (*_itr) );
242 if( _isalready != _nbrs.end() ) {
243 _nbrs.erase( _isalready );
257 std::vector<Seed*>::iterator seedItr;
264 currentTrk->
m_seeds.resize(seedItr - currentTrk->
m_seeds.begin());
280 std::cout <<
"Align tracks> trk len: " << tr->length() <<
" ";
bool compare(const P &i, const P &j)
std::vector< std::unique_ptr< Seed > > m_initialseeds
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &) override
void findNeighbors(Seed *, std::vector< Seed * > &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void ghostBuster(Track *)
TTUTrackingAlg()
Standard constructor.
std::vector< std::unique_ptr< Track > > m_tracks
void filter(Track *, std::vector< Seed * > &)
def unique(seq, keepstr=True)
std::vector< Seed * > m_seeds
Abs< T >::type abs(const T &t)
int executeTracker(Track *, std::vector< Seed * > &)
~TTUTrackingAlg() override
Destructor.
bool process(const TTUInput &) override
void runSeedBuster(const TTUInput &)