ATLAS Offline Software
Loading...
Searching...
No Matches
eflowCellList Class Reference

Concrete class derived class from pure virtual eflowAbstractCellList. More...

#include <eflowCellList.h>

Inheritance diagram for eflowCellList:
Collaboration diagram for eflowCellList:

Public Member Functions

 eflowCellList ()
virtual ~eflowCellList ()
void setNewExtrapolatedTrack (const eflowTrackCaloPoints *trackCalo)
void setNewExtrapolatedTrack (const eflowTrackCaloPoints &trackCalo)
void addCell (std::pair< const CaloCell *, int > cell)
void reorderWithoutLayers ()
CellIt begin ()
CellIt end ()
CellIt getLowerBound (eflowCaloENUM layer, double r)
CellIt find (eflowCaloENUM layer, double r)
int mapSize ()
void deleteFromList (CellIt &start, CellIt &end)
void deleteFromList (CellIt &it)
void eraseList ()
double etaFF (eflowCaloENUM layer) const
double phiFF (eflowCaloENUM layer) const
double dR2 (double eta, double phi, eflowCaloENUM layer) const
double dR (double eta, double phi, eflowCaloENUM layer) const

Private Attributes

std::vector< double > m_etaFF
std::vector< double > m_phiFF
std::map< eflowCellPosition, std::vector< std::pair< const CaloCell *, int > > > m_cellPositionToCellMap

Detailed Description

Concrete class derived class from pure virtual eflowAbstractCellList.

This stores information about the calorimeter cells - the main data type is a map between an eflowCellPosition and a pair linking the CaloCell pointer and the index of its xAOD::CaloCluster in the calorimeter cluster container. A DR2 function is provided to calculate the distance between an eflowCellPosition and the track impact point in a given calorimeter layer (eflowCellList also stores a list of track eta,phi impact points for each calorimeter later).

Definition at line 41 of file eflowCellList.h.

Constructor & Destructor Documentation

◆ eflowCellList()

eflowCellList::eflowCellList ( )

Definition at line 29 of file eflowCellList.cxx.

32{}
static const int nRegions
std::vector< double > m_etaFF
std::vector< double > m_phiFF

◆ ~eflowCellList()

virtual eflowCellList::~eflowCellList ( )
inlinevirtual

Definition at line 46 of file eflowCellList.h.

46{}

Member Function Documentation

◆ addCell()

void eflowCellList::addCell ( std::pair< const CaloCell *, int > cell)
virtual

Implements eflowAbstractCellList.

Definition at line 53 of file eflowCellList.cxx.

54{
55 eflowCellPosition myPos(this, cell.first);
56
57 CellIt inmap = m_cellPositionToCellMap.find(myPos);
58
59 if (inmap != m_cellPositionToCellMap.end())
60 inmap->second.push_back(cell);
61 else {
62 std::vector<std::pair<const CaloCell*, int>> myVec;
63 myVec.push_back(cell);
65 std::map<eflowCellPosition,
66 std::vector<std::pair<const CaloCell*, int>>>::value_type(myPos,
67 myVec));
68 }
69}
std::map< eflowCellPosition, std::vector< std::pair< const CaloCell *, int > > > m_cellPositionToCellMap
std::map< eflowCellPosition, std::vector< std::pair< constCaloCell *, int > > >::iterator CellIt

◆ begin()

CellIt eflowCellList::begin ( )
inlinevirtual

Implements eflowAbstractCellList.

Definition at line 56 of file eflowCellList.h.

56{ return m_cellPositionToCellMap.begin(); }

◆ deleteFromList() [1/2]

void eflowCellList::deleteFromList ( CellIt & it)
inlinevirtual

Implements eflowAbstractCellList.

Definition at line 75 of file eflowCellList.h.

75{ m_cellPositionToCellMap.erase(it); }

◆ deleteFromList() [2/2]

void eflowCellList::deleteFromList ( CellIt & start,
CellIt & end )
inlinevirtual

Implements eflowAbstractCellList.

Definition at line 71 of file eflowCellList.h.

72 {
73 m_cellPositionToCellMap.erase(start, end);
74 }

◆ dR()

double eflowCellList::dR ( double eta,
double phi,
eflowCaloENUM layer ) const
virtual

Implements eflowAbstractCellList.

Definition at line 118 of file eflowCellList.cxx.

119{
120 return (eflowCalo::Unknown != layer) ? sqrt(dR2(eta, phi, layer)) : -999.0;
121}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
double dR2(double eta, double phi, eflowCaloENUM layer) const

◆ dR2()

double eflowCellList::dR2 ( double eta,
double phi,
eflowCaloENUM layer ) const
virtual

Implements eflowAbstractCellList.

Definition at line 106 of file eflowCellList.cxx.

107{
108 if (eflowCalo::Unknown != layer) {
109 double dEta = eta - m_etaFF[layer];
110 double dPhi = xAOD::P4Helpers::deltaPhi(phi, m_phiFF[layer]);
111 return dEta * dEta + dPhi * dPhi;
112 } else {
113 return -999.0;
114 }
115}
@ layer
Definition HitInfo.h:79
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[

◆ end()

CellIt eflowCellList::end ( )
inlinevirtual

Implements eflowAbstractCellList.

Definition at line 57 of file eflowCellList.h.

57{ return m_cellPositionToCellMap.end(); }

◆ eraseList()

void eflowCellList::eraseList ( )
inline

Definition at line 76 of file eflowCellList.h.

76{ m_cellPositionToCellMap.clear(); }

◆ etaFF()

double eflowCellList::etaFF ( eflowCaloENUM layer) const
inlinevirtual

Implements eflowAbstractCellList.

Definition at line 78 of file eflowCellList.h.

78{ return m_etaFF[layer]; }

◆ find()

CellIt eflowCellList::find ( eflowCaloENUM layer,
double r )
inline

Definition at line 65 of file eflowCellList.h.

66 {
67 return m_cellPositionToCellMap.find(eflowCellPosition(this, layer, r));
68 }
int r
Definition globals.cxx:22

◆ getLowerBound()

CellIt eflowCellList::getLowerBound ( eflowCaloENUM layer,
double r )
inlinevirtual

Implements eflowAbstractCellList.

Definition at line 59 of file eflowCellList.h.

60 {
61 return m_cellPositionToCellMap.lower_bound(
62 eflowCellPosition(this, layer, r));
63 }

◆ mapSize()

int eflowCellList::mapSize ( )
inline

Definition at line 70 of file eflowCellList.h.

70{ return m_cellPositionToCellMap.size(); }

◆ phiFF()

double eflowCellList::phiFF ( eflowCaloENUM layer) const
inlinevirtual

Implements eflowAbstractCellList.

Definition at line 79 of file eflowCellList.h.

79{ return m_phiFF[layer]; }

◆ reorderWithoutLayers()

void eflowCellList::reorderWithoutLayers ( )
virtual

Implements eflowAbstractCellList.

Definition at line 72 of file eflowCellList.cxx.

73{
74 /* Collect all cells in layer EMB2 and higher, i.e. start with dR = 0 to the
75 * track in EMB2 */
76 CellIt it = m_cellPositionToCellMap.lower_bound(
77 eflowCellPosition(this, eflowCalo::EMB2, 0.0));
79 while (it != end) {
80 /* Create a CellPosition in EMB1 that has the same dR to the track as in its
81 * original layer */
82 eflowCellPosition tempPos(this, eflowCalo::EMB1, it->first.dR());
83
84 /* (Try to) insert the new CellPosition into the map. The resulting iterator
85 * either points to the inserted or to the already existing element (but we
86 * don't care). */
87 std::map<eflowCellPosition,
88 std::vector<std::pair<const CaloCell*, int>>>::iterator itInserted =
90 .insert(
91 std::make_pair(tempPos, std::vector<std::pair<const CaloCell*, int>>(0)))
92 .first;
93
94 /* Append the cell/index pairs of the original CellPosition to the (either
95 * newly inserted or already existing) element */
96 std::vector<std::pair<const CaloCell*, int>>& pairVector(it->second);
97 itInserted->second.insert(
98 itInserted->second.end(), pairVector.begin(), pairVector.end());
99
100 /* Remove the original CellPosition from the map */
101 m_cellPositionToCellMap.erase(it++);
102 }
103}

◆ setNewExtrapolatedTrack() [1/2]

void eflowCellList::setNewExtrapolatedTrack ( const eflowTrackCaloPoints & trackCalo)

Definition at line 41 of file eflowCellList.cxx.

42{
43 for (int i = 0; i < eflowCalo::nRegions; i++) {
45 m_etaFF[layer] = trackCalo.getEta(layer);
46 m_phiFF[layer] = trackCalo.getPhi(layer);
47 }
48
50}
double getPhi(eflowCalo::LAYER layer) const
double getEta(eflowCalo::LAYER layer) const
eflowCalo::LAYER eflowCaloENUM

◆ setNewExtrapolatedTrack() [2/2]

void eflowCellList::setNewExtrapolatedTrack ( const eflowTrackCaloPoints * trackCalo)
virtual

Implements eflowAbstractCellList.

Definition at line 35 of file eflowCellList.cxx.

36{
37 setNewExtrapolatedTrack(*trackCalo);
38}
void setNewExtrapolatedTrack(const eflowTrackCaloPoints *trackCalo)

Member Data Documentation

◆ m_cellPositionToCellMap

std::map<eflowCellPosition, std::vector<std::pair<const CaloCell*, int> > > eflowCellList::m_cellPositionToCellMap
private

Definition at line 88 of file eflowCellList.h.

◆ m_etaFF

std::vector<double> eflowCellList::m_etaFF
private

Definition at line 85 of file eflowCellList.h.

◆ m_phiFF

std::vector<double> eflowCellList::m_phiFF
private

Definition at line 86 of file eflowCellList.h.


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