ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
const int m_alg = Alternating
 

Detailed Description

Definition at line 33 of file T2TrackManager.h.

Member Typedef Documentation

◆ TrackVector

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) {}

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 }

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:
SGout2dot.alg
alg
Definition: SGout2dot.py:243
PESA::T2TrackManager::orderedSplit
int orderedSplit(int &key, int nEntries) const
Definition: T2TrackManager.cxx:75
PESA::T2TrackManager::Alternating
@ Alternating
Definition: T2TrackManager.h:42
PESA::T2TrackManager::Pt
@ Pt
Definition: T2TrackManager.h:42
PESA::T2TrackManager::alternatingSplit
int alternatingSplit(int &key) const
Definition: T2TrackManager.cxx:67
PESA::T2TrackManager::m_alg
const int m_alg
Definition: T2TrackManager.h:57
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
dqBeamSpot.nEntries
int nEntries
Definition: dqBeamSpot.py:73
PESA::T2TrackManager::m_nSplit
const int m_nSplit
Data members.
Definition: T2TrackManager.h:56
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37