ATLAS Offline Software
Loading...
Searching...
No Matches
PESA::T2TrackManager Class Reference

#include <T2TrackManager.h>

Collaboration diagram for PESA::T2TrackManager:

Public Types

enum  Algorithm { Alternating , Pt }
using TrackVector = std::vector<const Trk::Track*>

Public Member Functions

 T2TrackManager (int nSplit=2, Algorithm alg=Alternating)
std::vector< TrackVectorsplit (const TrackVector &cluster, const EventContext &ctx) const

Private Member Functions

int alternatingSplit (int &key) const
int orderedSplit (int &key, int nEntries) const

Private Attributes

const int m_nSplit = 2
 Data members.
const int m_alg = Alternating

Detailed Description

Definition at line 33 of file T2TrackManager.h.

Member Typedef Documentation

◆ TrackVector

using PESA::T2TrackManager::TrackVector = std::vector<const Trk::Track*>

Definition at line 37 of file T2TrackManager.h.

Member Enumeration Documentation

◆ Algorithm

Enumerator
Alternating 
Pt 

Definition at line 42 of file T2TrackManager.h.

42{ Alternating, Pt /*, Phi, NorthSouth, Charge */ };

Constructor & Destructor Documentation

◆ T2TrackManager()

PESA::T2TrackManager::T2TrackManager ( int nSplit = 2,
Algorithm alg = Alternating )
inlineexplicit

Definition at line 44 of file T2TrackManager.h.

44: m_nSplit(nSplit), m_alg(alg) {}
const int m_nSplit
Data members.

Member Function Documentation

◆ alternatingSplit()

int T2TrackManager::alternatingSplit ( int & key) const
private

Definition at line 67 of file T2TrackManager.cxx.

68{
69 ++key;
70 key %= m_nSplit;
71 return key;
72}

◆ orderedSplit()

int T2TrackManager::orderedSplit ( int & key,
int nEntries ) const
private

Definition at line 75 of file T2TrackManager.cxx.

76{
77 ++key;
78 return key * m_nSplit / nEntries;
79}

◆ split()

std::vector< T2TrackManager::TrackVector > T2TrackManager::split ( const TrackVector & cluster,
const EventContext & ctx ) const

Definition at line 35 of file T2TrackManager.cxx.

36{
37 int key = ctx.eventID().event_number() %2 -1;
38 const int nEntries = cluster.size();
39
40 //std::cout << "Reserve space" << std::endl;
41
42 // Set up the output, reserve space, init collections
43 std::vector<TrackVector> trackCollections(m_nSplit);
44
45 //if (m_alg == Pt)
46 //sort(holder.begin(), holder.end(), ptSort);
47
48 // Iterate over all the tracks in the cluster
49 for (auto&& track: cluster) {
50 // By default (if the splitting algorithm doesn't exist) store
51 // tracks in the 1st collection
52 int nPos = 0;
53 if (m_alg == Alternating)
54 nPos = alternatingSplit(key);
55 else if (m_alg == Pt)
56 nPos = orderedSplit(key, nEntries);
57
58 // Add the track to the appropriate collection
59 trackCollections[nPos].push_back(track);
60 }
61
62 // if (!m_doCluster) {
63 return trackCollections;
64}
int alternatingSplit(int &key) const
int orderedSplit(int &key, int nEntries) const

Member Data Documentation

◆ m_alg

const int PESA::T2TrackManager::m_alg = Alternating
private

Definition at line 57 of file T2TrackManager.h.

◆ m_nSplit

const int PESA::T2TrackManager::m_nSplit = 2
private

Data members.

Definition at line 56 of file T2TrackManager.h.


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