 |
ATLAS Offline Software
|
Go to the documentation of this file.
21 #include "Identifier/Identifier.h"
31 ATH_MSG_INFO (
" in CaloCellNeighborsAverageCorr::initialize() " );
38 ATH_MSG_WARNING (
"Please, don't set skipDeadDrawer and skipDeadTile to True at the same time" );
52 ATH_MSG_INFO (
"CaloCellNeighborsAverageCorr initialize() end" );
54 return StatusCode::SUCCESS;
61 const EventContext& )
const
65 std::vector<IdentifierHash> theNeighbors;
66 theNeighbors.reserve(22);
68 std::map<const CaloCell*,float> cannedUncorrectedEnergies;
71 for (; itrCell_test!=theCont->
end();++itrCell_test){
72 const CaloCell* pointerToCell=*itrCell_test;
73 cannedUncorrectedEnergies[pointerToCell] = pointerToCell->
energy();
77 int nGoodCellsPerDrawer[4][64];
80 memset(nGoodCellsPerDrawer,0,
sizeof(nGoodCellsPerDrawer));
85 for (; cellItr <= lastCell; ++cellItr) {
86 const CaloCell* CCell = (*theCont)[cellItr];
87 if (CCell && ! CCell->
badcell() ) {
96 const char *
name[4] = {
"LBC",
"EBC",
"LBA",
"EBA"};
103 if ( nGoodCellsPerDrawer[
part][
module] < 2 ) {
112 for (; itrCell!=theCont->
end();++itrCell){
118 if (!caloDDE)
continue;
133 if ( nGoodCellsPerDrawer[
part][
module] < 2 ) {
152 const float oldE=aCell->
energy();
161 float volumeOfTheCell=0;
162 if (caloDDE) volumeOfTheCell = caloDDE->
volume();
164 if (volumeOfTheCell==0)
continue;
174 float goodNeighborEnergyDensitySum=0;
175 unsigned goodNeighbors=0;
177 float betterNeighborEnergyDensitySum=0;
178 unsigned betterNeighbors=0;
181 for (
unsigned int iN=0;iN<theNeighbors.size();iN++) {
184 if (!thisNeighbor)
continue;
186 float thisEnergy = thisNeighbor->
energy();
188 thisEnergy = cannedUncorrectedEnergies[thisNeighbor];
200 float thisVolume = thisNeighborDDE->
volume();
201 if (thisVolume <= 0)
continue;
205 float thisEnergyDensity= thisEnergy / thisVolume;
206 goodNeighborEnergyDensitySum += thisEnergyDensity;
211 if (thisNeighborRegion==theCellRegion) {
214 betterNeighborEnergyDensitySum+=thisEnergyDensity;
219 unsigned nNeighbors=0;
220 float neighborEnergyDensitySum=0;
222 if (betterNeighbors>=2) {
223 nNeighbors=betterNeighbors;
224 neighborEnergyDensitySum=betterNeighborEnergyDensitySum;
228 nNeighbors=goodNeighbors;
229 neighborEnergyDensitySum=goodNeighborEnergyDensitySum;
232 if(nNeighbors <= 0) {
237 const float averageEnergyDensity = neighborEnergyDensitySum/nNeighbors;
240 const float predictedEnergy = averageEnergyDensity * volumeOfTheCell;
244 <<oldE <<
"Enew=" << predictedEnergy <<
", used " << nNeighbors <<
" neighbors" );
247 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
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...
Const iterator class for DataVector/DataList.
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Identifier region_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy) const
Make a region ID from constituting fields and subCalo index; for (Mini)FCAL and Tiles,...
int side(const Identifier &id) const
Gaudi::Property< bool > m_testMode
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Gaudi::Property< bool > m_skipDeadLAr
Gaudi::Property< bool > m_skipDeadDrawer
#define ATH_MSG_VERBOSE(x)
uint16_t provenance() const
get provenance (data member)
virtual void setEnergy(float energy)
set energy
value_type get_compact() const
Get the compact id.
double energy() const
get energy (data member)
CaloCell_ID::SUBCALO getSubCalo() const
cell subcalo
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
int module(const Identifier &id) const
(Non-const) Iterator class for DataVector/DataList.
::StatusCode StatusCode
StatusCode definition for legacy code.
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
virtual bool badcell() const
check is cell is dead
virtual StatusCode initialize() override
initialize method
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
bool is_tile() const
cell belongs to Tile
float volume() const
cell volume
bool test(const uint16_t prov, const LArProvenance check)
int get_neighbours(const IdentifierHash caloHash, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Container class for CaloCell.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_skipDeadFeb
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
process calo cell collection to apply corrections
Gaudi::Property< bool > m_skipDeadTile
int section(const Identifier &id) const
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
const CaloCell_ID * m_calo_id
const TileID * tile_idHelper() const
access to Tile idHelper
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.