ATLAS Offline Software
CaloCellList.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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 
34 class CaloCellContainer;
35 class CaloCell;
38 
40 {
41 
42 public:
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, const CaloCell_ID::SUBCALO caloNum);
48  CaloCellList(const CaloDetDescrManager* mgr, const CaloCellContainer* cell_container, const std::vector<CaloCell_ID::SUBCALO>& caloNums);
49 
50  ~CaloCellList() = default;
51 
52  // deta/dphi are the half-widths of the window.
53  // That is, we select cells within eta-deta .. eta+deta and similarly for
54  // phi.
55 
56  void select(double eta, double phi, double deta, double dphi); //
57  void select(double eta, double phi, double deta, double dphi, int sam);//
58  void select(double eta, double phi, double dR);//
59  void select(double eta, double phi, double dR, int sam);
60 
61  list_iterator begin() const;
62  list_iterator end() const;
63 
64  double energy() const; // returns the energy of the selected cells
65  double et() const; // returns the et of the selected cells
66  int ncells() const; // returns the number of cells
67  unsigned short nBadT(int i) const; // returns the number of bad timed cell in Tile (0, 1 for sampling 0 and 1+2)
68 
69 private:
70  void doSelect(double eta,
71  double phi,
72  double deta,
73  double dphi,
74  double dR,
76 
79  std::vector<CaloCell_ID::SUBCALO> m_caloNums;
81  double m_energy;
82  double m_et;
83  unsigned short m_nBadT0 = 0U, m_nBadT12 = 0U;
84 };
85 
88 {
89  return m_theCellVector.begin();
90 }
91 
94 {
95  return m_theCellVector.end();
96 }
97 
98 inline double
100 {
101  return m_energy;
102 }
103 
104 inline double
106 {
107  return m_et;
108 }
109 
110 inline int
112 {
113  return m_theCellVector.size();
114 }
115 
116 inline unsigned short
118 {
119  return (i == 0 ? m_nBadT0 : m_nBadT12);
120 }
121 
122 #endif
123 
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloCellList::CaloCellList
CaloCellList()=delete
CaloCellList::m_theCellVector
vector_type m_theCellVector
Definition: CaloCellList.h:80
CaloCellList::begin
list_iterator begin() const
Definition: CaloCellList.h:87
CaloCellList
Definition: CaloCellList.h:40
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloCellList::select
void select(double eta, double phi, double deta, double dphi)
Definition: CaloCellList.cxx:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloCellList::m_mgr
const CaloDetDescrManager * m_mgr
Definition: CaloCellList.h:78
CaloCellList::vector_type
std::vector< const CaloCell * > vector_type
Definition: CaloCellList.h:43
CaloCellList::et
double et() const
Definition: CaloCellList.h:105
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloCellList::list_iterator
vector_type::const_iterator list_iterator
Definition: CaloCellList.h:44
CaloCell_ID.h
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
CaloCellList::end
list_iterator end() const
Definition: CaloCellList.h:93
CaloCellList::nBadT
unsigned short nBadT(int i) const
Definition: CaloCellList.h:117
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloCellList::m_nBadT12
unsigned short m_nBadT12
Definition: CaloCellList.h:83
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
CaloCellList::energy
double energy() const
Definition: CaloCellList.h:99
CaloCellList::doSelect
void doSelect(double eta, double phi, double deta, double dphi, double dR, CaloCell_ID::CaloSample sam=CaloCell_ID::Unknown)
Definition: CaloCellList.cxx:91
CaloCellList::m_caloNums
std::vector< CaloCell_ID::SUBCALO > m_caloNums
Definition: CaloCellList.h:79
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCellList::m_nBadT0
unsigned short m_nBadT0
Definition: CaloCellList.h:83
CaloCellList::ncells
int ncells() const
Definition: CaloCellList.h:111
CaloCellList::m_energy
double m_energy
Definition: CaloCellList.h:81
CaloCellList::m_et
double m_et
Definition: CaloCellList.h:82
CaloCellList::m_cellcont
const CaloCellContainer * m_cellcont
Definition: CaloCellList.h:77
CaloCellList::~CaloCellList
~CaloCellList()=default