CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ticl::Node Class Reference

#include <TICLGraph.h>

Public Member Functions

void addInnerNeighbour (unsigned int trackster_id)
 
void addOuterNeighbour (unsigned int trackster_id)
 
void findSubComponents (std::vector< Node > &graph, std::vector< unsigned int > &subComponent, std::string tabs)
 
const unsigned int getId () const
 
const std::vector< unsigned int > & getInnerNeighbours () const
 
const std::vector< unsigned int > & getOuterNeighbours () const
 
bool isInnerNeighbour (const unsigned int tid)
 
 Node ()=default
 
 Node (unsigned index, bool isTrackster=true)
 
 ~Node ()=default
 

Private Attributes

bool alreadyVisited_
 
unsigned index_
 
std::vector< unsigned int > innerNeighboursId_
 
bool isTrackster_
 
std::vector< unsigned int > outerNeighboursId_
 

Detailed Description

Definition at line 10 of file TICLGraph.h.

Constructor & Destructor Documentation

◆ Node() [1/2]

ticl::Node::Node ( )
default

◆ Node() [2/2]

ticl::Node::Node ( unsigned  index,
bool  isTrackster = true 
)
inline

Definition at line 13 of file TICLGraph.h.

13 : index_(index), isTrackster_(isTrackster), alreadyVisited_{false} {};
unsigned index_
Definition: TICLGraph.h:31
bool isTrackster_
Definition: TICLGraph.h:32
bool alreadyVisited_
Definition: TICLGraph.h:36

◆ ~Node()

ticl::Node::~Node ( )
default

Member Function Documentation

◆ addInnerNeighbour()

void ticl::Node::addInnerNeighbour ( unsigned int  trackster_id)
inline

Definition at line 16 of file TICLGraph.h.

References innerNeighboursId_.

16 { innerNeighboursId_.push_back(trackster_id); }
std::vector< unsigned int > innerNeighboursId_
Definition: TICLGraph.h:35

◆ addOuterNeighbour()

void ticl::Node::addOuterNeighbour ( unsigned int  trackster_id)
inline

Definition at line 15 of file TICLGraph.h.

References outerNeighboursId_.

15 { outerNeighboursId_.push_back(trackster_id); }
std::vector< unsigned int > outerNeighboursId_
Definition: TICLGraph.h:34

◆ findSubComponents()

void ticl::Node::findSubComponents ( std::vector< Node > &  graph,
std::vector< unsigned int > &  subComponent,
std::string  tabs 
)

Definition at line 6 of file TICLGraph.cc.

References alreadyVisited_, index_, LogDebug, and outerNeighboursId_.

6  {
7  tabs += "\t";
8  if (!alreadyVisited_) {
9  LogDebug("TICLGraph") << tabs << " Visiting node " << index_ << std::endl;
10  alreadyVisited_ = true;
11  subComponent.push_back(index_);
12  for (auto const& neighbour : outerNeighboursId_) {
13  LogDebug("TICLGraph") << tabs << " Trying to visit " << neighbour << std::endl;
14  graph[neighbour].findSubComponents(graph, subComponent, tabs);
15  }
16  }
17  }
unsigned index_
Definition: TICLGraph.h:31
std::vector< unsigned int > outerNeighboursId_
Definition: TICLGraph.h:34
bool alreadyVisited_
Definition: TICLGraph.h:36
#define LogDebug(id)

◆ getId()

const unsigned int ticl::Node::getId ( void  ) const
inline

Definition at line 18 of file TICLGraph.h.

References index_.

18 { return index_; }
unsigned index_
Definition: TICLGraph.h:31

◆ getInnerNeighbours()

const std::vector<unsigned int>& ticl::Node::getInnerNeighbours ( ) const
inline

Definition at line 20 of file TICLGraph.h.

References innerNeighboursId_.

20 { return innerNeighboursId_; }
std::vector< unsigned int > innerNeighboursId_
Definition: TICLGraph.h:35

◆ getOuterNeighbours()

const std::vector<unsigned int>& ticl::Node::getOuterNeighbours ( ) const
inline

Definition at line 19 of file TICLGraph.h.

References outerNeighboursId_.

19 { return outerNeighboursId_; }
std::vector< unsigned int > outerNeighboursId_
Definition: TICLGraph.h:34

◆ isInnerNeighbour()

bool ticl::Node::isInnerNeighbour ( const unsigned int  tid)
inline

Definition at line 23 of file TICLGraph.h.

References spr::find(), and innerNeighboursId_.

23  {
24  auto findInner = std::find(innerNeighboursId_.begin(), innerNeighboursId_.end(), tid);
25  return findInner != innerNeighboursId_.end();
26  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< unsigned int > innerNeighboursId_
Definition: TICLGraph.h:35

Member Data Documentation

◆ alreadyVisited_

bool ticl::Node::alreadyVisited_
private

Definition at line 36 of file TICLGraph.h.

Referenced by findSubComponents().

◆ index_

unsigned ticl::Node::index_
private

Definition at line 31 of file TICLGraph.h.

Referenced by findSubComponents(), and getId().

◆ innerNeighboursId_

std::vector<unsigned int> ticl::Node::innerNeighboursId_
private

Definition at line 35 of file TICLGraph.h.

Referenced by addInnerNeighbour(), getInnerNeighbours(), and isInnerNeighbour().

◆ isTrackster_

bool ticl::Node::isTrackster_
private

Definition at line 32 of file TICLGraph.h.

◆ outerNeighboursId_

std::vector<unsigned int> ticl::Node::outerNeighboursId_
private

Definition at line 34 of file TICLGraph.h.

Referenced by addOuterNeighbour(), findSubComponents(), and getOuterNeighbours().