|
ATLAS Offline Software
|
#include <CaloTowerStore.h>
Definition at line 156 of file CaloTowerStore.h.
◆ tower_subseg_iterator
◆ CaloTowerStore()
CaloTowerStore::CaloTowerStore |
( |
| ) |
|
|
default |
◆ ~CaloTowerStore()
CaloTowerStore::~CaloTowerStore |
( |
| ) |
|
|
default |
◆ buildLookUp()
setup trigger
Definition at line 75 of file CaloTowerStore.cxx.
95 msg << MSG::ERROR<<
"CaloDetDescrManager is not initialized, module unusable!"<<
endmsg;
101 size_t sizeCalos = theCalos.size();
103 unsigned int ntowers = theTowerSeg.
neta() * theTowerSeg.
nphi();
105 std::vector< std::vector<Entry> > ttcmatrix;
106 ttcmatrix.resize (ntowers);
110 for (
unsigned int iCalo=0; iCalo<sizeCalos; iCalo++ ){
118 for(
size_t cellIndex = firstIndex; cellIndex < lastIndex; cellIndex++){
123 if(theDDE==
nullptr) {
124 msg << MSG::ERROR<<
" CellIndex = "<< cellIndex<<
" has a DDE pointer NULL " <<
endmsg;
129 double cellDeta = theDDE->
deta();
130 double cellDphi = theDDE->
dphi();
131 double etaRaw = theDDE->
eta_raw();
140 size_t ke = (size_t) (cellDeta/theTowerSeg.
deta()+0.5);
141 ke = (ke==0) ? 1 : ke;
142 size_t kp = (size_t) (cellDphi/theTowerSeg.
dphi()+0.5);
143 kp = (kp==0) ? 1 : kp;
145 double theWeight = 1. / ( (
double) ke * kp );
147 double cellDdeta = cellDeta / (
double) ke;
148 double cellDdphi = cellDphi / (
double) kp;
149 double etaMin = etaRaw - cellDeta / 2.;
150 double phiMin = phiRaw - cellDphi / 2.;
157 for (
size_t ie=1;
ie<=ke;
ie++ ){
159 for (
size_t ip=1;
ip<=kp;
ip++ ){
160 double cellPhi = phiMin + ((
double)
ip - 0.5) * cellDdphi;
176 if (towerIndex < ntowers) {
177 ttcmatrix[towerIndex].emplace_back(cellIndex,iw);
190 m_towers.reserve (ttcmatrix.size()+1);
192 for (
size_t i = 0;
i < ttcmatrix.size();
i++) {
194 const std::vector<Entry>&
v = ttcmatrix[
i];
199 unsigned int stride = 0;
200 for (
size_t j = 1; j <
v.size(); j++) {
211 if ((
int)(
v[j].
hash -
v[j-1].
hash) == (
int)stride &&
212 v[j].windex == ent.windex &&
230 printf (
"zzztowers calos: ");
231 for (
size_t z = 0;
z < theCalos.size();
z++) printf (
"%d ", theCalos[
z]);
232 printf (
"ntower: %d nent: %d nentraw: %d weights: ",
237 static FILE* flog = 0;
238 if (!flog) flog = fopen (
"towstore.dump",
"w");
239 fprintf (flog,
"========================================\n");
241 bool backref =
false;
243 fprintf (flog,
"tow %d %d %d %d %d %d\n",
it,
m_towers[
it].ncells,
◆ checkEntryIndex()
void CaloTowerStore::checkEntryIndex |
( |
| ) |
const |
|
private |
Check m_entry_index and fill it in if we haven't done so yet.
Definition at line 267 of file CaloTowerStore.cxx.
270 std::vector<unsigned short>
entries;
274 for (
size_t i = 0;
i <
sz;
i++) {
◆ pushTower()
void CaloTowerStore::pushTower |
( |
unsigned int |
nentries, |
|
|
unsigned int |
ncells |
|
) |
| |
|
private |
Definition at line 285 of file CaloTowerStore.cxx.
291 unsigned int phase = 0;
293 unsigned int offs1 = 0;
294 unsigned int offs2 = 0;
298 if (ent1.windex != ent2.windex ||
299 ent1.ncells != ent2.ncells ||
300 ent1.stride != ent2.stride)
305 unsigned int offs = ent2.hash - ent1.hash;
311 else if (
phase == 1) {
319 else if (
phase == 2) {
337 m_towers.back().backref_next =
true;
◆ size()
size_t CaloTowerStore::size |
( |
| ) |
const |
|
inline |
◆ towers() [1/2]
◆ towers() [2/2]
Return an iterator for looping over all towers defined by the window subseg
.
No end iterator is defined; use subseg.size() to tell when to stop the iteration.
The iteration may not be in tower index order. Use the itower()
method of the iterator to find the current tower index.
Definition at line 68 of file CaloTowerStore.cxx.
◆ tower_iterator
◆ m_entries
std::vector<Entry> CaloTowerStore::m_entries |
|
private |
◆ m_entry_index
One of these for each entry in m_towers, giving the index of the corresponding entry in m_entries.
This is only needed for the case of iterating over a window; it is otherwise not filled in. Use a CachedValue for thread-safety.
Definition at line 382 of file CaloTowerStore.h.
◆ m_seg
◆ m_towers
std::vector<Tower> CaloTowerStore::m_towers |
|
private |
◆ m_weights
std::vector<double> CaloTowerStore::m_weights |
|
private |
The documentation for this class was generated from the following files:
float deta() const
cell deta
void reset()
Reset the value to invalid.
static const unsigned int ncells_max
static SubSegIterator make(TOWER_ITERATOR beg, const SubSeg &subseg)
Construct a new iterator for iterating over a window.
static const unsigned int offs1_max
bool isValid() const
Test to see if the value is valid.
static const unsigned int offs2_max
CxxUtils::CachedValue< std::vector< unsigned short > > m_entry_index
One of these for each entry in m_towers, giving the index of the corresponding entry in m_entries.
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
friend class tower_iterator
index_t neta() const
Retrieve number of bins.
std::vector< Tower > m_towers
double deta() const
Retrieve bin size .
void store(const T &val)
Store a new value.
void pushTower(unsigned int nentries, unsigned int ncells)
IMessageSvc * getMessageSvc(bool quiet=false)
index_t nphi() const
Retrieve number of bins.
float eta_raw() const
cell eta_raw
bool isInitialized() const
for backwards compatibility only
std::vector< Entry > m_entries
void checkEntryIndex() const
Check m_entry_index and fill it in if we haven't done so yet.
double dphi() const
Retrieve bin size .
void calo_cell_hash_range(const Identifier id, IdentifierHash &caloCellMin, IdentifierHash &caloCellMax) const
to loop on 'global' cell hashes of one sub-calorimeter alone
std::vector< double > m_weights
size_t index_t
Type for eta, phi indices.
Helper class for offline cell identifiers.
static double fix(double phi)
index_t phiIndex(double phiVal) const
Returns index for a given value.
index_t etaphi(index_t etaInd, index_t phiInd) const
Returns combined continous index from , indices.
void set(const T &val) const
Set the value, assuming it is currently invalid.
static const unsigned int n1_max
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
float dphi() const
cell dphi
static const index_t outOfRange
Used to flag out-of-range indices.
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
tower_iterator towers() const
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
index_t etaIndex(double etaVal) const
Returns index for a given value.
float phi_raw() const
cell phi_raw