ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellList.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef CaloCellList_H
6#define CaloCellList_H
7
8/* Selecting Cells from a Container of CaloCells
9 H. Ma Sept 2000
10 The constructor takes a pointer to ObjectVector<CaloCell>
11 Two selection implemented:
12 delta_eta, delta_phi around a fix eta,phi, and
13 a cone of size dR around a fixed eta,phi
14 An optional sampling layer requirement.
15 Using the templated method, Tselect, user can write a
16 function object with the operator()(CaloCell*) to select
17 the wanted cells.
18 Each select call clears previous selection.
19 methods et() and energy() return et and energy.
20 list of cells can also be accessed through iterators.
21
22 Mod 17 Jun 2004 David Rousseau: work off big CaloCellContainer
23
24 Mod 21 Sep 2004 Damir Lelas: -speeding up using "CaloDetDescr/CaloDetDescrManager" class.
25 -vector of cells added to an exsisting list of cells
26
27 Mod 11 Oct 2004 Damir Lelas: -new method "select_nstrips" added; possibility to get number
28 of strips around given (eta,phi) direction for
29 (ncell_eta,ncell_phi) specified. The List of cells replaced
30 by the Vector of cells.
31
32*/
33
35class CaloCell;
38
40{
41
42public:
43 typedef std::vector<const CaloCell*> vector_type;
44 typedef vector_type::const_iterator list_iterator;
45 CaloCellList() = delete;
46 CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container);
47 CaloCellList(const CaloDetDescrManager& mgr, const CaloCellContainer& cell_container);
48 CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container, const CaloCell_ID::SUBCALO caloNum);
49 CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container, const std::vector<CaloCell_ID::SUBCALO>& caloNums);
50 CaloCellList(const CaloSuperCellDetDescrManager* mgr, const CaloCellContainer* cell_container);
51
52 ~CaloCellList() = default;
53
54 // deta/dphi are the half-widths of the window.
55 // That is, we select cells within eta-deta .. eta+deta and similarly for
56 // phi.
57
58 void select(double eta, double phi, double deta, double dphi); //
59 void select(double eta, double phi, double deta, double dphi, int sam);//
60 void select(double eta, double phi, double dR);//
61 void select(double eta, double phi, double dR, int sam);
62
63 list_iterator begin() const;
64 list_iterator end() const;
65
66 double energy() const; // returns the energy of the selected cells
67 double et() const; // returns the et of the selected cells
68 int ncells() const; // returns the number of cells
69 unsigned short nBadT(int i) const; // returns the number of bad timed cell in Tile (0, 1 for sampling 0 and 1+2)
70
71private:
72 void doSelect(double eta,
73 double phi,
74 double deta,
75 double dphi,
76 double dR,
77 CaloCell_ID::CaloSample sam = CaloCell_ID::Unknown);
78
81 std::vector<CaloCell_ID::SUBCALO> m_caloNums;
83 double m_energy;
84 double m_et;
85 unsigned short m_nBadT0 = 0U, m_nBadT12 = 0U;
86};
87
90{
91 return m_theCellVector.begin();
92}
93
96{
97 return m_theCellVector.end();
98}
99
100inline double
102{
103 return m_energy;
104}
105
106inline double
108{
109 return m_et;
110}
111
112inline int
114{
115 return m_theCellVector.size();
116}
117
118inline unsigned short
120{
121 return (i == 0 ? m_nBadT0 : m_nBadT12);
122}
123
124#endif
125
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Definition of CaloDetDescrManager.
Container class for CaloCell.
void doSelect(double eta, double phi, double deta, double dphi, double dR, CaloCell_ID::CaloSample sam=CaloCell_ID::Unknown)
unsigned short nBadT(int i) const
double energy() const
vector_type m_theCellVector
unsigned short m_nBadT0
CaloCellList()=delete
~CaloCellList()=default
const CaloCellContainer & m_cellcont
const CaloDetDescrManager_Base & m_mgr
list_iterator end() const
void select(double eta, double phi, double deta, double dphi)
double et() const
unsigned short m_nBadT12
double m_energy
int ncells() const
list_iterator begin() const
std::vector< CaloCell_ID::SUBCALO > m_caloNums
vector_type::const_iterator list_iterator
std::vector< const CaloCell * > vector_type
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
This class provides the client interface for accessing the detector description information common to...