FairShip
Loading...
Searching...
No Matches
Tracklet Class Reference

#include <Tracklet.h>

Inheritance diagram for Tracklet:
Collaboration diagram for Tracklet:

Public Member Functions

 Tracklet ()
 
 Tracklet (Int_t f, const std::vector< unsigned int > &indices)
 
 Tracklet (Int_t f, const std::vector< strawtubesHit > &hits, const std::vector< strawtubesHit > &container)
 
 ~Tracklet () override
 
std::vector< unsigned int > * getList ()
 
const std::vector< unsigned int > & getIndices () const
 
Int_t getType () const
 
void setType (Int_t f)
 
Int_t link2MCTrack (std::vector< strawtubesPoint > *strawPoints, Float_t min)
 
void Print (const Option_t *opt="") const override
 

Protected Member Functions

 ClassDefOverride (Tracklet, 2)
 

Protected Attributes

std::vector< unsigned int > aTracklet
 list of indices
 
Int_t flag
 

Detailed Description

Author
Thomas Ruf

Simple class to describe a tracklet list of indices pointing to strawtubesHit objects in the digiStraw container

Definition at line 23 of file Tracklet.h.

Constructor & Destructor Documentation

◆ Tracklet() [1/3]

Tracklet::Tracklet ( )

Default constructor

Definition at line 13 of file Tracklet.cxx.

13: flag(0) {}
Int_t flag
Definition: Tracklet.h:51

◆ Tracklet() [2/3]

Tracklet::Tracklet ( Int_t  f,
const std::vector< unsigned int > &  indices 
)

Constructor with hit indices

Definition at line 16 of file Tracklet.cxx.

17 : aTracklet(indices), flag(fl) {}
std::vector< unsigned int > aTracklet
list of indices
Definition: Tracklet.h:50

◆ Tracklet() [3/3]

Tracklet::Tracklet ( Int_t  f,
const std::vector< strawtubesHit > &  hits,
const std::vector< strawtubesHit > &  container 
)

Constructor with hits (extracts indices from container)

Definition at line 20 of file Tracklet.cxx.

22 : flag(fl) {
23 aTracklet.reserve(hits.size());
24 for (const auto& hit : hits) {
25 // Find index of hit in container by comparing addresses
26 for (size_t i = 0; i < container.size(); ++i) {
27 if (&container[i] == &hit) {
28 aTracklet.push_back(static_cast<unsigned int>(i));
29 break;
30 }
31 }
32 }
33}
int i
Definition: ShipAna.py:97
getattr container

◆ ~Tracklet()

Tracklet::~Tracklet ( )
override

Destructor

Definition at line 36 of file Tracklet.cxx.

36{}

Member Function Documentation

◆ ClassDefOverride()

Tracklet::ClassDefOverride ( Tracklet  ,
 
)
protected

◆ getIndices()

const std::vector< unsigned int > & Tracklet::getIndices ( ) const
inline

Definition at line 39 of file Tracklet.h.

39{ return aTracklet; }

◆ getList()

std::vector< unsigned int > * Tracklet::getList ( )
inline

Definition at line 38 of file Tracklet.h.

38{ return &aTracklet; }

◆ getType()

Int_t Tracklet::getType ( ) const
inline

Definition at line 40 of file Tracklet.h.

40{ return flag; }

◆ link2MCTrack()

Int_t Tracklet::link2MCTrack ( std::vector< strawtubesPoint > *  strawPoints,
Float_t  min 
)

Definition at line 39 of file Tracklet.cxx.

40 {
41 Int_t nTot = aTracklet.size();
42 std::unordered_map<int, int> MC;
43 Int_t trackID = -1;
44 for (std::vector<int>::size_type i = 0; i != aTracklet.size(); i++) {
45 trackID = (*strawPoints)[aTracklet[i]].GetTrackID();
46 MC[trackID] += 1. / nTot;
47 if (MC[trackID] > min) {
48 break;
49 }
50 }
51 return trackID;
52}

◆ Print()

void Tracklet::Print ( const Option_t *  opt = "") const
inlineoverride

Definition at line 47 of file Tracklet.h.

47{ ; }

◆ setType()

void Tracklet::setType ( Int_t  f)
inline

Definition at line 41 of file Tracklet.h.

41{ flag = f; }

Member Data Documentation

◆ aTracklet

std::vector<unsigned int> Tracklet::aTracklet
protected

list of indices

Definition at line 50 of file Tracklet.h.

◆ flag

Int_t Tracklet::flag
protected

Definition at line 51 of file Tracklet.h.


The documentation for this class was generated from the following files: