|
ATLAS Offline Software
|
Go to the documentation of this file.
21 #include "Identifier/Identifier.h"
29 const std::string&
type,
30 const std::string&
name,
36 declareProperty(
"testMode",
m_testMode=
false,
"test mode");
37 declareProperty(
"skipDeadFeb",
m_skipDeadFeb=
true,
"Skip dead LAr Febs (default = true)");
38 declareProperty(
"skipDeadLAr",
m_skipDeadLAr=
false,
"Skip all dead LAr cells (default = false)");
39 declareProperty(
"skipDeadDrawer",
m_skipDeadDrawer=
false,
"Skip dead Tile drawers (default = false)");
40 declareProperty(
"skipDeadTile",
m_skipDeadTile=
true,
"Skip all dead Tile cells (default = true)");
48 ATH_MSG_INFO (
" in CaloCellNeighborsAverageCorr::initialize() " );
55 ATH_MSG_WARNING (
"Please, don't set skipDeadDrawer and skipDeadTile to True at the same time" );
69 ATH_MSG_INFO (
"CaloCellNeighborsAverageCorr initialize() end" );
71 return StatusCode::SUCCESS;
78 const EventContext& )
const
82 std::vector<IdentifierHash> theNeighbors;
83 theNeighbors.reserve(22);
85 std::map<const CaloCell*,float> cannedUncorrectedEnergies;
88 for (; itrCell_test!=theCont->
end();++itrCell_test){
89 const CaloCell* pointerToCell=*itrCell_test;
90 cannedUncorrectedEnergies[pointerToCell] = pointerToCell->
energy();
95 int nGoodCellsPerDrawer[4][64];
98 memset(nGoodCellsPerDrawer,0,
sizeof(nGoodCellsPerDrawer));
103 for (; cellItr <= lastCell; ++cellItr) {
104 const CaloCell* CCell = (*theCont)[cellItr];
105 if (CCell && ! CCell->
badcell() ) {
114 const char *
name[4] = {
"LBC",
"EBC",
"LBA",
"EBA"};
121 if ( nGoodCellsPerDrawer[
part][
module] < 2 ) {
130 for (; itrCell!=theCont->
end();++itrCell){
136 if (!caloDDE)
continue;
151 if ( nGoodCellsPerDrawer[
part][
module] < 2 ) {
172 const float oldE=aCell->
energy();
181 float volumeOfTheCell=0;
182 if (caloDDE) volumeOfTheCell = caloDDE->
volume();
184 if (volumeOfTheCell==0)
continue;
196 float goodNeighborEnergyDensitySum=0;
197 unsigned goodNeighbors=0;
199 float betterNeighborEnergyDensitySum=0;
200 unsigned betterNeighbors=0;
203 for (
unsigned int iN=0;iN<theNeighbors.size();iN++) {
206 if (!thisNeighbor)
continue;
208 float thisEnergy = thisNeighbor->
energy();
210 thisEnergy = cannedUncorrectedEnergies[thisNeighbor];
223 float thisVolume = thisNeighborDDE->
volume();
224 if (thisVolume <= 0)
continue;
228 float thisEnergyDensity= thisEnergy / thisVolume;
229 goodNeighborEnergyDensitySum += thisEnergyDensity;
234 if (thisNeighborRegion==theCellRegion) {
237 betterNeighborEnergyDensitySum+=thisEnergyDensity;
246 unsigned nNeighbors=0;
247 float neighborEnergyDensitySum=0;
249 if (betterNeighbors>=2) {
250 nNeighbors=betterNeighbors;
251 neighborEnergyDensitySum=betterNeighborEnergyDensitySum;
255 nNeighbors=goodNeighbors;
256 neighborEnergyDensitySum=goodNeighborEnergyDensitySum;
259 if(nNeighbors <= 0) {
264 const float averageEnergyDensity = neighborEnergyDensitySum/nNeighbors;
267 const float predictedEnergy = averageEnergyDensity * volumeOfTheCell;
270 <<oldE <<
"Enew=" << predictedEnergy <<
", used " << nNeighbors <<
" neighbors" );
273 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
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
#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
CaloCellNeighborsAverageCorr(const std::string &type, const std::string &name, const IInterface *parent)
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.
float volume() const
cell volume
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)
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
process calo cell collection to apply corrections
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.