ATLAS Offline Software
CaloCellContainer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //--------------------------------------------------------------
6 // ivukotic@cern.ch added 3 functions for performace reasons.
7 // use them carefully
8 // 2 for updating begin and end calo iteerators
9 // and push back fast
10 // -------------------------------------------------------------
11 
13 #include "CaloEvent/CaloCell.h"
14 #include "CaloDetDescr/CaloDetDescrElement.h"
17 #include "CLHEP/Geometry/Vector3D.h"
18 #include <algorithm>
19 #include <atomic>
20 
21 
22 namespace {
23 
24 
30 int ilog2 (size_t x)
31 {
32  int l=0;
33  --x;
34  while (x >= 1) {
35  ++l;
36  x >>= 1;
37  }
38  return l;
39 }
40 
41 
42 std::atomic<int> nWarningsToBePrinted = 20;
43 
44 
45 } // anomymous namespace
46 
47 
49  DataVector<CaloCell>(ownPolicy),
50  m_hasTotalSize(false),
51  m_isOrdered(false),
52  m_isOrderedAndComplete(false)
53 {
54  //initialise with empty iterators
55  for (int iCalo=0; iCalo< static_cast<int>(CaloCell_ID::NSUBCALO); ++iCalo){
56  m_hasCalo.push_back(false);
57  m_indexFirstCellCalo.push_back(-1);
58  m_indexLastCellCalo.push_back(-2);
59  m_beginConstCalo.push_back(this->begin());
60  m_endConstCalo.push_back(this->begin());
61  m_beginCalo.push_back(this->begin());
62  m_endCalo.push_back(this->begin());
63  }
64 }
65 
66 
68  : CaloCellContainer (ownPolicy)
69 {
70  resize(n);
71 }
72 
73 
75 {
77 
78  // only allow const push_back if view cells
79  // if (ownPolicy()==SG::VIEW_ELEMENTS){
80  // std::cout << "ERROR Should not push_back non const cell in VIEW CaloCellContainer" << std::endl;
81  // }
82 
83 
84  this->setHasCalo(theCell->caloDDE()->getSubCalo()) ;
85 
87 
88 }
89 
90 void CaloCellContainer::push_back(std::unique_ptr<CaloCell> theCell)
91 {
93  this->setHasCalo(theCell->caloDDE()->getSubCalo()) ;
94 
95  DataVector<CaloCell>::push_back(std::move(theCell));
96 
97 }
98 
99 
100 
101 /* to speed up reading of compactifed data */
103 {
105 }
106 
107 void CaloCellContainer::push_back_fast(std::unique_ptr<CaloCell> theCell)
108 {
109  DataVector<CaloCell>::push_back(std::move(theCell));
110 }
111 
113  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
114  << "CaloCellContainer::print not implemented";
115 }
116 
117 
118 
120  return m_beginConstCalo[static_cast<int>(caloNum)];
121 }
122 
124 {
125  return m_beginCalo[static_cast<int>(caloNum)];
126 }
127 
129 {
130  return m_endCalo[static_cast<int>(caloNum)];
131 }
132 
134  return m_endConstCalo[static_cast<int>(caloNum)];
135 }
136 
138  return m_indexFirstCellCalo[static_cast<int>(caloNum)];
139 }
140 
142  return m_indexLastCellCalo[static_cast<int>(caloNum)];
143 }
144 
146  return this->indexLastCellCalo(caloNum)-this->indexFirstCellCalo(caloNum)+1;
147 }
148 
149 
151  //should have maximum hash size in any case
152  if (!this->hasTotalSize()) return false;
153 
154  CaloCellContainer::const_iterator itr=this->begin(),itrEnd=this->end();
155  unsigned int index=0;
156  for (;itr!=itrEnd;++itr){
157  if ( ((*itr)->caloDDE())->calo_hash()!=index) {
158  return false;
159  }
160  ++index;
161  }
162  return true;
163 }
164 
165 void CaloCellContainer::setIsOrderedAndComplete(const bool orderedAndComplete) {
166  m_isOrderedAndComplete = orderedAndComplete ;
167 }
168 
169 void CaloCellContainer::setHasTotalSize(const bool hasTotalSize){
171 }
172 
174  CaloCellContainer::const_iterator itr=this->begin(),itrEnd=this->end();
175  unsigned int hashPrev=0;
176 
177  for (;itr!=itrEnd;++itr){
178 
179  const CaloCell * theCell=*itr;
180 
181  const CaloDetDescrElement * theDDE = nullptr;
182 
183  if (theCell==nullptr){
184  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
185  << MSG::WARNING << "CaloCellContainer NULL CELL ";
186  } else {
187  theDDE=theCell->caloDDE();
188  if (theDDE==nullptr){
189  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
190  << MSG::WARNING << "CaloCellContainer WARNING NULL DDE ";
191  }
192  else{
193  unsigned int hash=theDDE->calo_hash();
194  if ( hash < hashPrev) return false ;
195  hashPrev=hash;
196  }
197 
198  }
199  }
200 
201  return true;
202 }
203 
204 void CaloCellContainer::setIsOrdered(const bool ordered) {
205  m_isOrdered = ordered;
206 }
207 
208 
210  return m_hasCalo[static_cast<int>(caloNum)];
211 }
212 
214 
215  const int iCalo=static_cast<int>(caloNum);
216 
217  m_hasCalo[iCalo] = true;
218 }
219 
220 
221 namespace {
222 
223 
224 struct is_calo
225 {
226  is_calo (int c) : m_c (c) {}
227  bool operator() (const CaloCell* cell) const
228  { return cell->caloDDE()->getSubCalo() == m_c; }
229  int m_c;
230 };
231 
232 
233 } // anonymous namespace
234 
235 
244 void
247 {
248  if (beg == end) return;
249  int beg_calo = (*beg)->caloDDE()->getSubCalo();
250  int end_calo = (*(end-1))->caloDDE()->getSubCalo();
251  if (beg_calo == end_calo) {
252  m_beginCalo[beg_calo] = beg;
253  m_endCalo[beg_calo] = end;
254  m_beginConstCalo[beg_calo] = beg;
255  m_endConstCalo[beg_calo] = end;
256  m_indexFirstCellCalo[beg_calo] = beg - this->begin();
257  m_indexLastCellCalo[beg_calo] = end - this->begin() - 1;
258  }
259  else {
261  std::partition_point (beg, end, is_calo (beg_calo));
264  }
265 }
266 
267 
269 {
270 
271  //initialise
272  for (int iCalo=0; iCalo< static_cast<int>(CaloCell_ID::NSUBCALO); ++iCalo){
273  m_indexFirstCellCalo[iCalo]=-1;
274  m_indexLastCellCalo[iCalo]=-2;
275  m_beginConstCalo[iCalo]=this->begin();
276  m_endConstCalo[iCalo]=this->begin();
277  m_beginCalo[iCalo]=this->begin();
278  m_endCalo[iCalo]=this->begin();
279  }
280 
283  return;
284  }
285 
286  CaloCellContainer::const_iterator itr=this->begin(),itrEnd=this->end();
287  CaloCellContainer::iterator itrNonConst=this->begin();
288  int previousCellCalo=-1;
289  int index=0;
290  for (;itr!=itrEnd;++itr){
291  const int iCalo= static_cast<int>( (*itr)->caloDDE()->getSubCalo());
292  if (iCalo!=previousCellCalo){
293 
294  // new calo domain
295  if (m_indexFirstCellCalo[iCalo]>=0){
296  REPORT_MESSAGE_WITH_CONTEXT (MSG::ERROR, "CaloCellContainer")
297  << " Specific calo cells are split."
298  << " Specific calo iterators will be wrong ";
299  }
301  m_beginConstCalo[iCalo]=itr;
302  m_beginCalo[iCalo]=itrNonConst;
303 
304  if (previousCellCalo>=0){
305  m_indexLastCellCalo[previousCellCalo]=index-1;
306  m_endConstCalo[previousCellCalo]=itr;
307  m_endCalo[previousCellCalo]=itrNonConst;
308 
309  }
310  }
311  previousCellCalo=iCalo;
312  ++itrNonConst;
313  ++index;
314  }
315 
316  //case the calo is the last filled
317  if (previousCellCalo>=0){
318  m_indexLastCellCalo[previousCellCalo]=index-1;
319  m_endConstCalo[previousCellCalo]=itr;
320  m_endCalo[previousCellCalo]=itrNonConst;
321  }
322 
323 }
324 
325 
327  if (ic==0) {
328  m_beginConstCalo[ic]=this->begin();
329  m_beginCalo[ic]=this->begin();
331  }else{
332  m_beginConstCalo[ic]=this->end();
333  m_beginCalo[ic]=this->end();
335  }
336 }
337 
339  m_endConstCalo[ic]=this->end();
340  m_endCalo[ic]=this->end();
341  m_indexLastCellCalo[ic]=ind-1;
342 }
343 
344 
346 {
347  int ndx = findIndex (theHash);
348  if (ndx >= 0)
349  return (*this)[ndx];
350  return nullptr;
351 }
352 
353 
355 {
356  int ndx = findIndex (theHash);
357  if (ndx >= 0)
358  return (*this)[ndx];
359  return nullptr;
360 }
361 
362 
364 {
365  //cache Identifierhash->unsigned int conversion (maybe too much)
366  const unsigned int theIndex = theHash ;
367 
368  // if container is complete and in order use directly the container
369  if (isOrderedAndComplete()) return theIndex;
370 
371  if (this->empty()) return -1;
372 
373  const CxxUtils::PackedArray& lookUpTable = getLookUpTable();
374  if (theIndex < lookUpTable.size() )
375  return (int)lookUpTable[theIndex] - 1;
376  return -1;
377 }
378 
379 
388 template <class CONT, class VECT>
389 void CaloCellContainer::findCellVectorT (CONT& cont, const std::vector<IdentifierHash> & theVectorHash, VECT& theCellVector)
390 {
391  theCellVector.reserve (theCellVector.size() + theVectorHash.size());
392  if (cont.isOrderedAndComplete()) {
393 
394  for (IdentifierHash hash : theVectorHash) {
395  theCellVector.push_back( cont[hash] );
396  }
397  return;
398  }
399 
400  if (cont.empty()) return ;
401 
402  const CxxUtils::PackedArray& lookUpTable = cont.getLookUpTable();
403 
404  //look in look up table (do not put empty cells)
405 
406  size_t tbsize = lookUpTable.size();
407  for (IdentifierHash hash : theVectorHash) {
408  // careful that the look up table might be shorter than the maximum hash
409  if (hash>=tbsize) continue ;
410  int ndx = (int)lookUpTable[ hash ] - 1;
411  if (ndx >= 0) {
412  auto theCell = cont[ndx];
413  if (theCell!=nullptr) {
414  theCellVector.push_back( theCell);
415  }
416  }
417 
418  }
419 }
420 
421 
422 void CaloCellContainer::findCellVector(const std::vector<IdentifierHash> & theVectorHash,CellVector & theCellVector) const
423 {
424  findCellVectorT (*this, theVectorHash, theCellVector);
425 #if 0
426  theCellVector.reserve (theCellVector.size() + theVectorHash.size());
427  if (isOrderedAndComplete()) {
428 
429  for (IdentifierHash hash : theVectorHash) {
430  theCellVector.push_back( (*this)[hash] );
431  }
432  return;
433  }
434 
435  if (this->empty()) return ;
436 
437  const CxxUtils::PackedArray& lookUpTable = getLookUpTable();
438 
439  //look in look up table (do not put empty cells)
440 
441  size_t tbsize = lookUpTable.size();
442  for (IdentifierHash hash : theVectorHash) {
443  // careful that the look up table might be shorter than the maximum hash
444  if (hash>=tbsize) continue ;
445  int ndx = (int)lookUpTable[ hash ] - 1;
446  if (ndx >= 0) {
447  const CaloCell * theCell = (*this)[ndx];
448  if (theCell!=0) {
449  theCellVector.push_back( theCell);
450  }
451  }
452 
453  }
454 #endif
455 }
456 
457 void CaloCellContainer::findCellVector(const std::vector<IdentifierHash> & theVectorHash, MutableCellVector & theCellVector)
458 {
459  findCellVectorT (*this, theVectorHash, theCellVector);
460 }
461 
463  {
465  }
466 
468 {
469  this->resetLookUpTable();
470  getLookUpTable();
471 }
472 
473 
475 {
476  if (this->hasTotalSize()){
477  this->orderWhenComplete();
478  }
479  else{
480  this->orderWhenIncomplete();
481  }
482 
483 }
484 
486 {
487  // If the number of cells is small compared to the maximum number
488  // of cells, best to just use the STL sort and then remove duplicates.
489  // Otherwise, sort by inserting into a table based on the hash code.
490  // Break point chosen pretty much arbitrarily. Could be further
491  // tuned, but it probably doesn't really make much difference.
492  if (size() < 500) {
493  // Small number of cells. Use STL sort.
495 
496  // Nb. Need to convert to int --- otherwise, 0-1 will wrap around
497  // to maxuint.
498  for (int i = 0; i < static_cast<int>(size())-1; ) {
499  if ((*this)[i]->caloDDE()->calo_hash() ==
500  (*this)[i+1]->caloDDE()->calo_hash())
501  {
502  REPORT_MESSAGE_WITH_CONTEXT (MSG::ERROR, "CaloCellContainer")
503  << "Duplicated cell: hash= " << (*this)[i]->caloDDE()->calo_hash();
504  erase (begin() + i);
505  }
506  else
507  ++i;
508  }
509  }
510  else {
511  // Sort for large container.
512 
513  // Find the maximum possible hash code.
514  const CaloDetDescriptor* desc = front()->caloDDE()->descriptor();
515  IdentifierHash max_hash = desc->get_calo_helper()->calo_cell_hash_max();
516 
517  // Make a temporary container that can hold all possible cells.
518  DataVector<CaloCell> tmp (max_hash+1, ownPolicy());
519 
520  // Move cells into the temporary container, according to hashes.
522  for (DataVector<CaloCell>::iterator it = begin(); it != itend; ++it) {
523  IdentifierHash hash = (*it)->caloDDE()->calo_hash();
524  assert (hash < tmp.size());
525 
526  if (tmp[hash] != nullptr) {
527  REPORT_MESSAGE_WITH_CONTEXT (MSG::ERROR, "CaloCellContainer")
528  << "Duplicated cell: hash= " << hash;
529  }
530  else {
531  using std::iter_swap;
532  iter_swap (tmp.begin() + hash, it);
533  }
534  }
535 
536  // Now, move the cells back, eliminating spaces.
537  itend = tmp.end();
539  for (DataVector<CaloCell>::iterator it = tmp.begin(); it != itend; ++it) {
540  if (*it != nullptr) {
541  using std::iter_swap;
542  iter_swap (itout, it);
543  ++itout;
544  }
545  }
546 
547  // May be less, if there were duplicates.
548  // cppcheck-suppress assertWithSideEffect
549  assert (itout <= end());
550  resize (itout - begin());
551  }
553  setIsOrdered(true);
554 }
555 
557 {
559  tmp.swap (*this);
560  reserve (tmp.size());
561 
562  DataVector<CaloCell>::iterator tmpend = tmp.end();
563  for (DataVector<CaloCell>::iterator it = tmp.begin(); it != tmpend; ++it) {
564  IdentifierHash hash = (*it)->caloDDE()->calo_hash();
565 
566  if (hash >= size())
567  resize (hash + 1);
568 
569  if ((*this)[hash] != nullptr) {
570  REPORT_MESSAGE_WITH_CONTEXT (MSG::ERROR, "CaloCellContainer")
571  << "Duplicated cell: hash= " << hash;
572  }
573  else {
574  using std::iter_swap;
575  iter_swap (begin() + hash, it);
576  }
577  }
578 
579  // set the Ordered And Complete flag
580  this->setIsOrderedAndComplete(true);
581 
582  // look up table is not necessary anymore
583  this->resetLookUpTable();
584 }
585 
587 {
588  // FIXME should have an argument about duplicates
589  // fill the look up table
590  // note that if CaloCellContainer is not completely filled, there
591  // is no guarantee it has the correct size, hence the size should
592  // be checked at every call
593  // (CaloCellContainer has no way to know the maximum size)
594  // Now (30.07.2008) have it always max number of cells (hardcoded) to speed up.
595 
596  if (!m_lookUpTable.isValid()) {
597 
598  unsigned int theSize=0;
599  size_t ncells = size();
600  CxxUtils::PackedArray lookUpTable (std::max (1, ilog2 (ncells + 1)));
601 
602  if (ncells > 0) {
603 
604  // Set the size of the lookup table.
605  // If the cells are sorted, we can look at the last cell to know
606  // the maximum hash we're dealing with. Otherwise, set it to the
607  // maximum cell hash value.
608  if (isOrdered()) {
609  // Set LUT size from the hash of the last cell.
610  theSize = back()->caloDDE()->calo_hash()+1;
611  }
612  else {
613  // Find the maximum hash.
614  const CaloDetDescriptor* desc = front()->caloDDE()->descriptor();
615  IdentifierHash max_hash = desc->get_calo_helper()->calo_cell_hash_max();
616  theSize = max_hash + 1;
617  }
618  lookUpTable.resize (theSize);
619 
620  for (size_t icell = 0; icell < ncells; icell++) {
621 
622  const CaloCell * theCell = (*this)[icell];
623  const IdentifierHash theHash=theCell->caloDDE()->calo_hash();
624 
625  assert (theHash < theSize);
626 
627  if (nWarningsToBePrinted > 0) {
628  // We may actually enter here nWarningsToBePrinted times
629  // if multiple threads race here, but it doesn't matter.
630  int nwarn = nWarningsToBePrinted--;
631  int iold = (int)(lookUpTable[theHash])-1;
632  if (iold >= 0) {
633  if ((size_t)iold == icell) {
634  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
635  << "Repeated cell. hash= " << theHash;
636  }
637  else if ((*this)[iold]->ID()==theCell->ID()) {
638  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
639  << "Duplicated cell. hash="
640  << theHash
641  << " E1=" << (*this)[iold]->e()
642  << " E2=" << theCell->e();
643  // should delete the cell?
644  } else {
645  REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "CaloCellContainer")
646  << "Should be impossible ! Repeated cell. hash= " << theHash;
647  }
648  if (nwarn==0) {
649  REPORT_MESSAGE_WITH_CONTEXT (MSG::INFO, "CaloCellContainer")
650  << "No more WARNING will be printed";
651  }
652  }
653  } // end of print out
654 
655  lookUpTable[theHash]=icell+1;
656  }
657  }
658  m_lookUpTable.set (std::move (lookUpTable));
659  }
660 
661  return *m_lookUpTable.ptr();
662 }
663 
664 
666  return a->caloDDE()->calo_hash() < b->caloDDE()->calo_hash(); }
668  return a.caloDDE()->calo_hash() < b.caloDDE()->calo_hash(); }
669 
670 
671 namespace SG {
672 
673 
674 template <>
675 bool
677  CaloCell const * const & element,
679 {
680  int ndx = data.findIndex (element->caloDDE()->calo_hash());
681  if (ndx >= 0) {
682  index = ndx;
683  return true;
684  }
685  return false;
686 }
687 
688 
689 
690 
691 } // namespace SG
DataVector< CaloCell >::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CaloCellContainer::m_lookUpTable
CxxUtils::CachedValue< CxxUtils::PackedArray > m_lookUpTable
look up table of size HashIdentifiermax.
Definition: CaloCellContainer.h:272
CaloCellContainer::updateCaloIteratorsOrdered
void updateCaloIteratorsOrdered(CaloCellContainer::iterator beg, CaloCellContainer::iterator end)
Recursively find division points between subcalos in the container.
Definition: CaloCellContainer.cxx:245
CaloCellContainer::indexLastCellCalo
int indexLastCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of last cell of given calorimeter (-2 if none) Note that it is normally more efficient to use i...
Definition: CaloCellContainer.cxx:141
CxxUtils::CachedValue::reset
void reset()
Reset the value to invalid.
CaloCellContainer::initializeLookUpTable
void initializeLookUpTable()
initialize look up table.
Definition: CaloCellContainer.cxx:467
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
CaloCellContainer::checkOrderedAndComplete
bool checkOrderedAndComplete() const
verify one by one the container is complete (i.e.
Definition: CaloCellContainer.cxx:150
CaloCellContainer::hasTotalSize
bool hasTotalSize() const
tell wether container has total hash id size
Definition: CaloCellContainer.h:289
CaloCellContainer::setHasTotalSize
void setHasTotalSize(const bool)
If @ flag is true, then the container size equals the maximum hash.
Definition: CaloCellContainer.cxx:169
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CxxUtils::PackedArray::push_back
void push_back(value_type x)
Add an element to the end of the collection.
Definition: PackedArray.cxx:423
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
WriteCellNoiseToCool.icell
icell
Definition: WriteCellNoiseToCool.py:339
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloCellContainer::findCellVector
void findCellVector(const std::vector< IdentifierHash > &theVectorHash, CellVector &theCellVector) const
fast find method given vector of identifier hash.
Definition: CaloCellContainer.cxx:422
index
Definition: index.py:1
CaloCellContainer::m_indexFirstCellCalo
std::vector< int > m_indexFirstCellCalo
index of first cell of given calo (-1 if none)
Definition: CaloCellContainer.h:289
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
CaloCellContainer::m_isOrderedAndComplete
bool m_isOrderedAndComplete
true if complete and in right order
Definition: CaloCellContainer.h:283
CaloCellContainer::m_hasTotalSize
bool m_hasTotalSize
true if size correspond to maximum hash.
Definition: CaloCellContainer.h:276
CxxUtils::CachedValue::isValid
bool isValid() const
Test to see if the value is valid.
CaloCellContainer::setIsOrdered
void setIsOrdered(const bool ordered)
indicates that the container is ordered
Definition: CaloCellContainer.cxx:204
CaloCellContainer::setHasCalo
void setHasCalo(const CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
Definition: CaloCellContainer.cxx:213
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloCellContainer::updateCaloBeginIterators
void updateCaloBeginIterators(int ic, int ind)
fills calo iterators and the index of first cell for a given subcalo
Definition: CaloCellContainer.cxx:326
CaloCellContainer::m_isOrdered
bool m_isOrdered
true if ordered
Definition: CaloCellContainer.h:280
skel.it
it
Definition: skel.GENtoEVGEN.py:396
CxxUtils::PackedArray::size
size_type size() const
Returns the number of elements in the collection.
Definition: PackedArray.cxx:209
CaloCellContainer::beginConstCalo
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
Definition: CaloCellContainer.cxx:119
CaloCellContainer::isOrdered
bool isOrdered() const
tell wether container is ordered
Definition: CaloCellContainer.h:293
CaloCell.h
CaloCellContainer::orderWithCaloHash
functor to order cells according to caloHash
Definition: CaloCellContainer.h:221
CaloCell::e
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition: CaloCell.h:317
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
CaloCellContainer::orderWithCaloHash::operator()
bool operator()(const CaloCell *a, const CaloCell *b) const
Definition: CaloCellContainer.cxx:665
CaloCellContainer::print
static void print()
dump (obsolete)
Definition: CaloCellContainer.cxx:112
CaloCellContainer::endCalo
CaloCellContainer::iterator endCalo(CaloCell_ID::SUBCALO caloNum)
Definition: CaloCellContainer.cxx:128
x
#define x
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::OwnershipPolicy
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
Definition: OwnershipPolicy.h:16
CaloDetDescrElement::getSubCalo
CaloCell_ID::SUBCALO getSubCalo() const
cell subcalo
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:433
CaloDetDescriptor.h
Definition of CaloDetDescriptor.
CxxUtils::PackedArray
An array of unsigned values of some bit size, packed tightly.
Definition: PackedArray.h:42
CaloCellContainer::indexFirstCellCalo
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
Definition: CaloCellContainer.cxx:137
CaloCellContainer::orderWhenComplete
void orderWhenComplete()
order when container is complete
Definition: CaloCellContainer.cxx:556
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
CaloCondBlobAlgs_fillNoiseFromASCII.desc
desc
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:54
CaloCellContainer::CaloCellContainer
CaloCellContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Main constructor.
Definition: CaloCellContainer.cxx:48
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
CaloCellContainer::nCellsCalo
int nCellsCalo(const CaloCell_ID::SUBCALO caloNum) const
get number of cels of given calorimeter
Definition: CaloCellContainer.cxx:145
DataVector< CaloCell >::front
const CaloCell * front() const
Access the first element in the collection as an rvalue.
CxxUtils::PackedArray::resize
void resize(size_type sz, value_type c=0)
Resizes the collection to the specified number of elements.
Definition: PackedArray.cxx:239
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
DataVector< CaloCell >::back
const CaloCell * back() const
Access the last element in the collection as an rvalue.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
CaloCellContainer::findCell
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
Definition: CaloCellContainer.cxx:345
grepfile.ic
int ic
Definition: grepfile.py:33
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:345
CaloCellContainer::push_back_fast
void push_back_fast(CaloCell *)
reimplementation of push_back to gain speed in readin
Definition: CaloCellContainer.cxx:102
DataVector< CaloCell >::resize
void resize(size_type sz)
Resizes the collection to the specified number of elements.
CaloCellContainer::MutableCellVector
std::vector< CaloCell * > MutableCellVector
Return from non-const findCellVector.
Definition: CaloCellContainer.h:86
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
CaloCellContainer::updateCaloIterators
void updateCaloIterators()
fill calo iterators and the index of first and last cell IT IS THE RESPONSABILITY OF THE PRODUCER TO ...
Definition: CaloCellContainer.cxx:268
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CaloCellContainer::checkOrdered
bool checkOrdered() const
verify one by one the container is ordered
Definition: CaloCellContainer.cxx:173
SG::findInContainer
bool findInContainer(const CaloCellContainer &data, CaloCell const *const &element, CaloCellContainer::size_type &index)
Definition: CaloCellContainer.cxx:676
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
CaloCellContainer::order
void order()
order container
Definition: CaloCellContainer.cxx:474
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
CaloCellContainer::m_beginCalo
std::vector< CaloCellContainer::iterator > m_beginCalo
non const iterators for the different calorimeters
Definition: CaloCellContainer.h:297
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloCellContainer::getLookUpTable
const CxxUtils::PackedArray & getLookUpTable() const
Retrieve an initialized lookup table.
Definition: CaloCellContainer.cxx:586
CaloCellContainer::beginCalo
CaloCellContainer::iterator beginCalo(CaloCell_ID::SUBCALO caloNum)
get non const iterators on cell of just one calo
Definition: CaloCellContainer.cxx:123
CaloCellContainer::m_beginConstCalo
std::vector< CaloCellContainer::const_iterator > m_beginConstCalo
const iterators for the different calorimeters
Definition: CaloCellContainer.h:295
CaloCellContainer::resetLookUpTable
void resetLookUpTable()
reset look up table
Definition: CaloCellContainer.cxx:462
DataVector< CaloCell >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector< CaloCell >::sort
void sort()
Sort the container.
DeMoScan.index
string index
Definition: DeMoScan.py:364
CaloCellContainer::m_hasCalo
std::vector< bool > m_hasCalo
true if given cell from given calo has been filled (even if none)
Definition: CaloCellContainer.h:286
a
TList * a
Definition: liststreamerinfos.cxx:10
CaloCellContainer::isOrderedAndComplete
bool isOrderedAndComplete() const
tell wether container is complete and in order
Definition: CaloCellContainer.h:298
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCellContainer::orderWhenIncomplete
void orderWhenIncomplete()
order when container is incomplete
Definition: CaloCellContainer.cxx:485
CaloDetDescriptor
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
Definition: CaloDetDescriptor.h:58
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
CaloCellContainer::push_back
void push_back(CaloCell *)
reimplementation of const push_back
Definition: CaloCellContainer.cxx:74
CaloCellContainer::endConstCalo
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
Definition: CaloCellContainer.cxx:133
CaloCellContainer::findIndex
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
Definition: CaloCellContainer.cxx:363
CaloDetDescrElement::descriptor
const CaloDetDescriptor * descriptor() const
cell descriptor
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:428
DataVector< CaloCell >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
CaloCellContainer::hasCalo
bool hasCalo(const CaloCell_ID::SUBCALO caloNum) const
tell wether it has been filled with cells (maybe none) of a given calo
Definition: CaloCellContainer.cxx:209
CaloCell_Base_ID::NSUBCALO
@ NSUBCALO
Definition: CaloCell_Base_ID.h:46
CaloCellContainer::m_endConstCalo
std::vector< CaloCellContainer::const_iterator > m_endConstCalo
Definition: CaloCellContainer.h:295
DataVector< CaloCell >::iter_swap
static void iter_swap(iterator a, iterator b)
Swap the referents of two DataVector iterators.
CaloCellContainer::m_endCalo
std::vector< CaloCellContainer::iterator > m_endCalo
Definition: CaloCellContainer.h:297
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
DataVector< CaloCell >::size_type
BASE::size_type size_type
Definition: DataVector.h:813
DataVector< CaloCell >::erase
iterator erase(iterator position)
Remove element at a given position.
CaloCellContainer::findCellVectorT
static void findCellVectorT(CONT &cont, const std::vector< IdentifierHash > &theVectorHash, VECT &theCellVector)
Look up a group of cells by IdentifierHash.
Definition: CaloCellContainer.cxx:389
python.compressB64.c
def c
Definition: compressB64.py:93
DataVector< CaloCell >::size
size_type size() const noexcept
Returns the number of elements in the collection.
CaloCellContainer::setIsOrderedAndComplete
void setIsOrderedAndComplete(const bool ordered)
indicate that the container is complete and in order
Definition: CaloCellContainer.cxx:165
DataVector< CaloCell >::empty
bool empty() const noexcept
Returns true if the collection is empty.
CaloCellContainer::CellVector
std::vector< const CaloCell * > CellVector
type to be used for the internal lookup table, and to return list of cells
Definition: CaloCellContainer.h:83
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
DataVector< CaloCell >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
CaloCellContainer::updateCaloEndIterators
void updateCaloEndIterators(int ic, int ind)
fills calo iterators and the index of last cell for a given subcalo
Definition: CaloCellContainer.cxx:338
CaloCellContainer::m_indexLastCellCalo
std::vector< int > m_indexLastCellCalo
index of first cell of given calo (-2 if none)
Definition: CaloCellContainer.h:292