2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
6 CaloCompositeCellBase<NAV>::CaloCompositeCellBase() : NAV()
10 CaloCompositeCellBase<NAV>::~CaloCompositeCellBase()
15 CaloCompositeCellBase<NAV>::addCell(const CaloCellContainer* pContainer,
16 const CaloCell* pCell,
18 size_t iCell /*= -1*/)
20 // cell already in collection
21 if ( this->contains(pCell) )
24 double newWeight = weight + this->getCellWeight(pCell);
26 this->reweightCell(pCell,newWeight);
30 // from Navigable base
31 // Insert by index if available; else by pointer.
32 if (iCell != static_cast<size_t> (-1))
33 this->insertElement(pContainer,iCell,weight);
35 this->insertElement(pContainer,pCell,weight);
37 this->updateKine(pCell,weight);
43 CaloCompositeCellBase<NAV>::addCell(const CaloCellContainer* pContainer,
47 // forward to cell pointer method
48 if ( iCell < pContainer->size() )
49 this->addCell(pContainer,((pContainer->operator[])(iCell)),weight, iCell);
54 CaloCompositeCellBase<NAV>::addUniqueCell(const CaloCellContainer* pContainer,
57 size_t size_hint /*= 0*/)
59 if ( iCell < pContainer->size() ) {
60 this->insertElement(pContainer,iCell,weight,size_hint);
61 this->updateKine((*pContainer)[iCell],weight);
67 CaloCompositeCellBase<NAV>::addUniqueCellNoKine(const CaloCellContainer* pContainer,
70 size_t size_hint /*= 0*/)
72 if ( iCell < pContainer->size() ) {
73 this->insertElement(pContainer,iCell,weight,size_hint);
79 CaloCompositeCellBase<NAV>::reweightCell(const CaloCell* pCell,double weight)
81 double adjWeight = weight - this->getCellWeight(pCell);
82 this->reweight(pCell,weight);
83 this->updateKine(pCell,adjWeight);
88 CaloCompositeCellBase<NAV>::reweightCell(const CaloCellContainer* pContainer,
92 if ( iCell < pContainer->size() )
93 this->reweightCell((pContainer->operator[])(iCell),weight);
98 CaloCompositeCellBase<NAV>::reweightCell(cell_iterator& cellIter,
101 // keep this implementation separated (faster!)
102 double adjWeight = weight - this->getCellWeight(cellIter);
103 this->reweight(cellIter,weight);
104 this->updateKine(*cellIter,adjWeight);
109 CaloCompositeCellBase<NAV>::removeCell(const CaloCell* pCell)
111 if ( this->contains(pCell) )
114 this->updateKine(pCell,-(this->getCellWeight(pCell)));
115 // from Navigable base
122 CaloCompositeCellBase<NAV>::removeCell(const CaloCellContainer* pContainer,
125 this->removeCell((pContainer->operator[])(iCell));
130 CaloCompositeCellBase<NAV>::removeCells()
137 CaloCompositeCellBase<NAV>::getCellWeight(const CaloCell* pCell) const
140 return this->getParameter(pCell);
145 CaloCompositeCellBase<NAV>::getCellWeight(const CaloCellContainer* pContainer,
149 return this->getParameter(pContainer,iCell);
154 CaloCompositeCellBase<NAV>::getCellWeight(cell_iterator& cellIter) const
156 return this->getParameter(cellIter);
160 const CaloCellContainer*
161 CaloCompositeCellBase<NAV>::getCellContainer(const CaloCell* pCell) const
163 return this->getContainer(pCell);
167 const CaloCellContainer*
168 CaloCompositeCellBase<NAV>::getCellContainer(cell_iterator& cellIter) const
170 return this->getContainer(cellIter);
174 bool CaloCompositeCellBase<NAV>::getCellIndex(const CaloCell* pCell,
177 return this->getIndex(pCell,iCell);
181 bool CaloCompositeCellBase<NAV>::getCellIndex(cell_iterator& cellIter,
184 return this->getIndex(cellIter,iCell);
188 typename CaloCompositeCellBase<NAV>::cell_iterator
189 CaloCompositeCellBase<NAV>::cell_begin() const
191 return this->begin();
195 typename CaloCompositeCellBase<NAV>::cell_iterator
196 CaloCompositeCellBase<NAV>::cell_end() const
202 unsigned int CaloCompositeCellBase<NAV>::getNumberOfCells() const
204 return this->nCells();