ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CaloCellList Class Reference

#include <CaloCellList.h>

Collaboration diagram for CaloCellList:

Public Types

typedef std::vector< const CaloCell * > vector_type
 
typedef vector_type::const_iterator list_iterator
 

Public Member Functions

 CaloCellList ()=delete
 
 CaloCellList (const CaloDetDescrManager *mgr, const CaloCellContainer *cell_container)
 
 CaloCellList (const CaloDetDescrManager *mgr, const CaloCellContainer *cell_container, const CaloCell_ID::SUBCALO caloNum)
 
 CaloCellList (const CaloDetDescrManager *mgr, const CaloCellContainer *cell_container, const std::vector< CaloCell_ID::SUBCALO > &caloNums)
 
 ~CaloCellList ()=default
 
void select (double eta, double phi, double deta, double dphi)
 
void select (double eta, double phi, double deta, double dphi, int sam)
 
void select (double eta, double phi, double dR)
 
void select (double eta, double phi, double dR, int sam)
 
list_iterator begin () const
 
list_iterator end () const
 
double energy () const
 
double et () const
 
int ncells () const
 
unsigned short nBadT (int i) const
 

Private Member Functions

void doSelect (double eta, double phi, double deta, double dphi, double dR, CaloCell_ID::CaloSample sam=CaloCell_ID::Unknown)
 

Private Attributes

const CaloCellContainerm_cellcont
 
const CaloDetDescrManagerm_mgr
 
std::vector< CaloCell_ID::SUBCALOm_caloNums
 
vector_type m_theCellVector
 
double m_energy
 
double m_et
 
unsigned short m_nBadT0 = 0U
 
unsigned short m_nBadT12 = 0U
 

Detailed Description

Definition at line 39 of file CaloCellList.h.

Member Typedef Documentation

◆ list_iterator

typedef vector_type::const_iterator CaloCellList::list_iterator

Definition at line 44 of file CaloCellList.h.

◆ vector_type

typedef std::vector<const CaloCell*> CaloCellList::vector_type

Definition at line 43 of file CaloCellList.h.

Constructor & Destructor Documentation

◆ CaloCellList() [1/4]

CaloCellList::CaloCellList ( )
delete

◆ CaloCellList() [2/4]

CaloCellList::CaloCellList ( const CaloDetDescrManager mgr,
const CaloCellContainer cell_container 
)

Definition at line 29 of file CaloCellList.cxx.

30  : m_cellcont(cell_container)
31  , m_mgr(mgr)
32  , m_energy(0)
33  , m_et(0)
34 {
35  m_caloNums.clear();
36  // NSUBCALO indicate take them all
38 }

◆ CaloCellList() [3/4]

CaloCellList::CaloCellList ( const CaloDetDescrManager mgr,
const CaloCellContainer cell_container,
const CaloCell_ID::SUBCALO  caloNum 
)

Definition at line 41 of file CaloCellList.cxx.

42  : m_cellcont(cell_container)
43  , m_mgr(mgr)
44  , m_energy(0)
45  , m_et(0)
46 {
47  m_caloNums.clear();
48  m_caloNums.push_back(caloNum);
49 }

◆ CaloCellList() [4/4]

CaloCellList::CaloCellList ( const CaloDetDescrManager mgr,
const CaloCellContainer cell_container,
const std::vector< CaloCell_ID::SUBCALO > &  caloNums 
)

Definition at line 53 of file CaloCellList.cxx.

55  : m_cellcont(cell_container)
56  , m_mgr(mgr)
57  , m_energy(0)
58  , m_et(0)
59 
60 {
61  m_caloNums.clear();
62  std::copy(caloNums.begin(), caloNums.end(), back_inserter(m_caloNums));
63 }

◆ ~CaloCellList()

CaloCellList::~CaloCellList ( )
default

Member Function Documentation

◆ begin()

CaloCellList::list_iterator CaloCellList::begin ( ) const
inline

Definition at line 87 of file CaloCellList.h.

88 {
89  return m_theCellVector.begin();
90 }

◆ doSelect()

void CaloCellList::doSelect ( double  eta,
double  phi,
double  deta,
double  dphi,
double  dR,
CaloCell_ID::CaloSample  sam = CaloCell_ID::Unknown 
)
private

Definition at line 91 of file CaloCellList.cxx.

97 {
98 
99  m_theCellVector.clear();
100  m_energy = 0;
101  m_et = 0;
102  m_nBadT0 = 0;
103  m_nBadT12 = 0;
104  if (m_cellcont->empty()){
105  return;
106  }
107  std::vector<IdentifierHash> calo_mgr_vect;
108  std::vector<CaloCell_ID::SUBCALO>::const_iterator itrCaloNum = m_caloNums.begin();
109  std::vector<CaloCell_ID::SUBCALO>::const_iterator itrEndCaloNum = m_caloNums.end();
110 
111  double dR2 = dR*dR;
112 
113  for (; itrCaloNum != itrEndCaloNum; ++itrCaloNum) {
114  CaloCell_ID::SUBCALO caloNum = *itrCaloNum;
115  if (sam != CaloCell_ID::Unknown) {
116  m_mgr->cellsInZone(eta - deta, eta + deta, phi - dphi, phi + dphi, sam, calo_mgr_vect);
117  itrCaloNum = itrEndCaloNum - 1;
118  } else if (caloNum == CaloCell_ID::NSUBCALO) {
119  m_mgr->cellsInZone(eta - deta, eta + deta, phi - dphi, phi + dphi, calo_mgr_vect);
120  } else if (caloNum != CaloCell_ID::NOT_VALID) {
121  m_mgr->cellsInZone(eta - deta, eta + deta, phi - dphi, phi + dphi, caloNum, calo_mgr_vect);
122  } else {
123  continue;
124  }
125  m_theCellVector.reserve(m_theCellVector.size() + calo_mgr_vect.size());
126 
127  for (unsigned int i = 0; i < calo_mgr_vect.size(); i++) {
128  const CaloCell* cell = m_cellcont->findCell(calo_mgr_vect[i]);
129  if (cell) {
130  double pphi = proxim(cell->phi(), phi);
131  if ( (dR > 0 && square(eta - cell->eta()) + square(pphi - phi) < dR2) ||
132  (dR < 0 && std::fabs(eta - cell->eta()) < deta && std::fabs(phi - pphi) < dphi) ) {
133  m_theCellVector.push_back(cell);
134  m_energy += cell->energy();
135  m_et += cell->et();
136  if (cell->badcell()) {
137  if (sam == CaloCell_ID::TileBar0 || sam == CaloCell_ID::TileExt0)
138  m_nBadT0++;
139  else if (sam == CaloCell_ID::TileBar1 || sam == CaloCell_ID::TileExt1 ||
140  sam == CaloCell_ID::TileBar2 || sam == CaloCell_ID::TileExt2 ||
142  m_nBadT12++;
143  }
144  }
145  }
146  }
147  } // end loop on calorimeters
148 }

◆ end()

CaloCellList::list_iterator CaloCellList::end ( ) const
inline

Definition at line 93 of file CaloCellList.h.

94 {
95  return m_theCellVector.end();
96 }

◆ energy()

double CaloCellList::energy ( ) const
inline

Definition at line 99 of file CaloCellList.h.

100 {
101  return m_energy;
102 }

◆ et()

double CaloCellList::et ( ) const
inline

Definition at line 105 of file CaloCellList.h.

106 {
107  return m_et;
108 }

◆ nBadT()

unsigned short CaloCellList::nBadT ( int  i) const
inline

Definition at line 117 of file CaloCellList.h.

118 {
119  return (i == 0 ? m_nBadT0 : m_nBadT12);
120 }

◆ ncells()

int CaloCellList::ncells ( ) const
inline

Definition at line 111 of file CaloCellList.h.

112 {
113  return m_theCellVector.size();
114 }

◆ select() [1/4]

void CaloCellList::select ( double  eta,
double  phi,
double  deta,
double  dphi 
)

Definition at line 67 of file CaloCellList.cxx.

68 {
69  doSelect(eta, phi, deta, dphi, -1);
70 }

◆ select() [2/4]

void CaloCellList::select ( double  eta,
double  phi,
double  deta,
double  dphi,
int  sam 
)

Definition at line 73 of file CaloCellList.cxx.

74 {
75  doSelect(eta, phi, deta, dphi, -1, static_cast<CaloCell_ID::CaloSample>(sam));
76 }

◆ select() [3/4]

void CaloCellList::select ( double  eta,
double  phi,
double  dR 
)

Definition at line 79 of file CaloCellList.cxx.

80 {
81  doSelect(eta, phi, dR, dR, dR);
82 }

◆ select() [4/4]

void CaloCellList::select ( double  eta,
double  phi,
double  dR,
int  sam 
)

Definition at line 85 of file CaloCellList.cxx.

86 {
87  doSelect(eta, phi, dR, dR, dR, static_cast<CaloCell_ID::CaloSample>(sam));
88 }

Member Data Documentation

◆ m_caloNums

std::vector<CaloCell_ID::SUBCALO> CaloCellList::m_caloNums
private

Definition at line 79 of file CaloCellList.h.

◆ m_cellcont

const CaloCellContainer* CaloCellList::m_cellcont
private

Definition at line 77 of file CaloCellList.h.

◆ m_energy

double CaloCellList::m_energy
private

Definition at line 81 of file CaloCellList.h.

◆ m_et

double CaloCellList::m_et
private

Definition at line 82 of file CaloCellList.h.

◆ m_mgr

const CaloDetDescrManager* CaloCellList::m_mgr
private

Definition at line 78 of file CaloCellList.h.

◆ m_nBadT0

unsigned short CaloCellList::m_nBadT0 = 0U
private

Definition at line 83 of file CaloCellList.h.

◆ m_nBadT12

unsigned short CaloCellList::m_nBadT12 = 0U
private

Definition at line 83 of file CaloCellList.h.

◆ m_theCellVector

vector_type CaloCellList::m_theCellVector
private

Definition at line 80 of file CaloCellList.h.


The documentation for this class was generated from the following files:
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloCellList::m_theCellVector
vector_type m_theCellVector
Definition: CaloCellList.h:80
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloCellList::m_mgr
const CaloDetDescrManager * m_mgr
Definition: CaloCellList.h:78
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
proxim
double proxim(double b, double a)
Definition: proxim.h:17
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
CaloCellList::m_nBadT12
unsigned short m_nBadT12
Definition: CaloCellList.h:83
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
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
CaloDetDescrManager_Base::cellsInZone
void cellsInZone(double eta_min, double eta_max, double phi_min, double phi_max, std::vector< IdentifierHash > &cell_list) const
the only client is CaloCellList class
Definition: CaloDetDescrManager.cxx:793
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
CaloCellList::m_caloNums
std::vector< CaloCell_ID::SUBCALO > m_caloNums
Definition: CaloCellList.h:79
CaloCellContainer::findCell
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
Definition: CaloCellContainer.cxx:345
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCellList::m_nBadT0
unsigned short m_nBadT0
Definition: CaloCellList.h:83
CaloCellList::m_energy
double m_energy
Definition: CaloCellList.h:81
CaloCellList::m_et
double m_et
Definition: CaloCellList.h:82
CaloCell_Base_ID::NSUBCALO
@ NSUBCALO
Definition: CaloCell_Base_ID.h:46
calibdata.copy
bool copy
Definition: calibdata.py:27
CaloCellList::m_cellcont
const CaloCellContainer * m_cellcont
Definition: CaloCellList.h:77
CaloCell_Base_ID::NOT_VALID
@ NOT_VALID
Definition: CaloCell_Base_ID.h:46
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.