![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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 74 of file CaloTowerStore.cxx.
90 IMessageSvc* theMsgSvc;
91 StatusCode sc = Gaudi::svcLocator()->service(
"MessageSvc",theMsgSvc);
93 std::cout <<
"Cannot locate MessageSvc" << std::endl;
95 MsgStream
msg(theMsgSvc,
"CaloTowerStore");
99 msg << MSG::ERROR<<
"CaloDetDescrManager is not initialized, module unusable!"<<
endmsg;
105 size_t sizeCalos = theCalos.size();
107 unsigned int ntowers = theTowerSeg.
neta() * theTowerSeg.
nphi();
109 std::vector< std::vector<Entry> > ttcmatrix;
110 ttcmatrix.resize (ntowers);
114 for (
unsigned int iCalo=0; iCalo<sizeCalos; iCalo++ ){
122 for(
size_t cellIndex = firstIndex; cellIndex < lastIndex; cellIndex++){
127 if(theDDE==
nullptr) {
128 msg << MSG::ERROR<<
" CellIndex = "<< cellIndex<<
" has a DDE pointer NULL " <<
endmsg;
133 double cellDeta = theDDE->
deta();
134 double cellDphi = theDDE->
dphi();
135 double etaRaw = theDDE->
eta_raw();
144 size_t ke = (size_t) (cellDeta/theTowerSeg.
deta()+0.5);
145 ke = (ke==0) ? 1 : ke;
146 size_t kp = (size_t) (cellDphi/theTowerSeg.
dphi()+0.5);
147 kp = (kp==0) ? 1 : kp;
149 double theWeight = 1. / ( (
double) ke * kp );
151 double cellDdeta = cellDeta / (
double) ke;
152 double cellDdphi = cellDphi / (
double) kp;
153 double etaMin = etaRaw - cellDeta / 2.;
154 double phiMin = phiRaw - cellDphi / 2.;
161 for (
size_t ie=1;
ie<=ke;
ie++ ){
163 for (
size_t ip=1;
ip<=kp;
ip++ ){
164 double cellPhi = phiMin + ((
double)
ip - 0.5) * cellDdphi;
180 if (towerIndex < ntowers) {
181 ttcmatrix[towerIndex].emplace_back(cellIndex,iw);
194 m_towers.reserve (ttcmatrix.size()+1);
196 for (
size_t i = 0;
i < ttcmatrix.size();
i++) {
198 const std::vector<Entry>&
v = ttcmatrix[
i];
203 unsigned int stride = 0;
204 for (
size_t j = 1; j <
v.size(); j++) {
215 if ((
int)(
v[j].
hash -
v[j-1].
hash) == (
int)stride &&
216 v[j].windex == ent.windex &&
234 printf (
"zzztowers calos: ");
235 for (
size_t z = 0;
z < theCalos.size();
z++) printf (
"%d ", theCalos[
z]);
236 printf (
"ntower: %d nent: %d nentraw: %d weights: ",
241 static FILE* flog = 0;
242 if (!flog) flog = fopen (
"towstore.dump",
"w");
243 fprintf (flog,
"========================================\n");
245 bool backref =
false;
247 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 271 of file CaloTowerStore.cxx.
274 std::vector<unsigned short>
entries;
278 for (
size_t i = 0;
i <
sz;
i++) {
◆ pushTower()
void CaloTowerStore::pushTower |
( |
unsigned int |
nentries, |
|
|
unsigned int |
ncells |
|
) |
| |
|
private |
Definition at line 289 of file CaloTowerStore.cxx.
295 unsigned int phase = 0;
297 unsigned int offs1 = 0;
298 unsigned int offs2 = 0;
302 if (ent1.windex != ent2.windex ||
303 ent1.ncells != ent2.ncells ||
304 ent1.stride != ent2.stride)
309 unsigned int offs = ent2.hash - ent1.hash;
315 else if (
phase == 1) {
323 else if (
phase == 2) {
341 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 67 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)
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
::StatusCode StatusCode
StatusCode definition for legacy code.
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
index_t etaIndex(double etaVal) const
Returns index for a given value.
float phi_raw() const
cell phi_raw