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 66 of file T2TrackManager.cxx.

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

◆ orderedSplit()

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

Definition at line 74 of file T2TrackManager.cxx.

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

◆ split()

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

Definition at line 34 of file T2TrackManager.cxx.

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

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:74
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:66
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