|
ATLAS Offline Software
|
#include <CaloCellsHandlerTool.h>
|
| CaloCellsHandlerTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~CaloCellsHandlerTool () |
|
StatusCode | initialize () |
|
StatusCode | getGepCellMap (const CaloCellContainer &cells, pGepCellMap &, const EventContext &ctx) const |
|
StatusCode | setNumberOfEnergyBits (int value) |
|
StatusCode | setLeastSignificantBit (int value) |
|
StatusCode | setG (int value) |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
int | m_nEnergyBits = -1 |
| Key of the CaloNoise Conditions data object. More...
|
|
int | m_valLeastSigBit = -1 |
|
int | m_valG = -1 |
|
int | m_readoutRanges [5] = {-1,-1,-1,-1,-1} |
|
int | m_stepsPerRange = -1 |
|
unsigned | m_maxCellsPerFEB = -1 |
|
std::map< unsigned int, Gep::GepCaloCell > | m_gepCellsBase = {} |
|
Gaudi::Property< std::string > | m_GepEnergyEncodingScheme {this, "GEPEnergyEncodingScheme", "", "String defining the GEP readout scheme according to number of readout bits + '-' + value of LSB in MeV + '-' + gain value"} |
|
Gaudi::Property< bool > | m_doGepHardwareStyleEnergyEncoding {this, "HardwareStyleEnergyEncoding", false, "Enabling or disabling the hardware-style energy encoding for the GEP"} |
|
Gaudi::Property< bool > | m_doTruncationOfOverflowingFEBs {this, "TruncationOfOverflowingFEBs", false, "Enabling or disabling the truncation of cells from FEBs with more than the maximum number of cells which can be send"} |
|
Gaudi::Property< std::string > | m_LArCellMap {this, "LArCellMapFile", "UpgradePerformanceFunctions/LAr_Cell_Map_offlineID_0.csv", "File associating LAr cells with readout FEBs and connection technology"} |
|
SG::ReadCondHandleKey< CaloNoise > | m_electronicNoiseKey |
|
SG::ReadCondHandleKey< CaloNoise > | m_totalNoiseKey |
|
const CaloCell_ID * | m_CaloCell_ID {nullptr} |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 26 of file CaloCellsHandlerTool.h.
◆ StoreGateSvc_t
◆ CaloCellsHandlerTool()
CaloCellsHandlerTool::CaloCellsHandlerTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~CaloCellsHandlerTool()
CaloCellsHandlerTool::~CaloCellsHandlerTool |
( |
| ) |
|
|
virtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ getGepCellMap()
Definition at line 117 of file CaloCellsHandlerTool.cxx.
130 if (!electronicNoiseHdl.isValid()) {
return StatusCode::FAILURE;}
131 const CaloNoise* electronicNoiseCDO = *electronicNoiseHdl;
134 if (!totalNoiseHdl.isValid()) {
return StatusCode::FAILURE;}
135 const CaloNoise* totalNoiseCDO = *totalNoiseHdl;
138 std::map<std::string,std::vector<Gep::GepCaloCell>> gepCellsPerFEB;
145 caloCell.
id = (
cell->ID().get_identifier32()).get_compact();
147 if (base_cell_itr !=
m_gepCellsBase.end()) caloCell = base_cell_itr->second;
151 caloCell.
FEB =
"Tile";
154 float electronicNoise = electronicNoiseCDO->
getNoise(
cell->ID(),
cell->gain());
158 if ((
cell->energy() / totalNoise) < 2.0)
continue;
163 caloCell.
e = caloCell.
et * TMath::CosH(
cell->eta());
166 caloCell.
e =
cell->energy();
167 caloCell.
et = caloCell.
e / TMath::CosH(
cell->eta());
175 caloCell.
sigma =
cell->energy() / totalNoise;
185 caloCell.
x =
cell->x();
186 caloCell.
y =
cell->y();
187 caloCell.
z =
cell->z();
192 bool IsEM_Barrel=
false;
193 bool IsEM_EndCap=
false;
194 bool IsEM_BarrelPos=
false;
195 bool IsEM_BarrelNeg=
false;
217 caloCell.
id = (
cell->ID().get_identifier32()).get_compact();
220 caloCell.
layer =
cell->caloDDE()->getLayer();
222 float deta = elt->
deta();
223 float dphi = elt->
dphi();
225 float etamin = caloCell.
eta - (0.5*deta);
226 float etamax = caloCell.
eta + (0.5*deta);
228 float phimin = caloCell.
phi - (0.5*dphi);
229 float phimax = caloCell.
phi + (0.5*dphi);
241 auto feb_itr = gepCellsPerFEB.find(caloCell.
FEB);
242 if (feb_itr != gepCellsPerFEB.end()) feb_itr->second.push_back(caloCell);
244 std::vector<Gep::GepCaloCell> cellsThisFEB;
245 cellsThisFEB.push_back(caloCell);
246 gepCellsPerFEB.insert(std::pair<std::string,std::vector<Gep::GepCaloCell>>(caloCell.
FEB,cellsThisFEB));
251 auto itr = gepCellsPerFEB.begin();
252 for ( ;itr != gepCellsPerFEB.end(); ++itr) {
256 ATH_MSG_DEBUG(
"FEB " << itr->first <<
" is sending " << itr->second.size() <<
" cells, which is more cells than GEP can receive. Removing all but the possible " <<
m_maxCellsPerFEB <<
" cells.");
260 gepCellsMap->insert(std::pair<unsigned int, Gep::GepCaloCell>(
cell.id,
cell));
262 ATH_MSG_DEBUG(
"GEP is receiving a total of " << gepCellsMap->size() <<
" cells in this event");
264 return StatusCode::SUCCESS;
◆ getGepEnergy()
int CaloCellsHandlerTool::getGepEnergy |
( |
float |
offline_et | ) |
const |
|
private |
◆ getNeighbours()
Definition at line 293 of file CaloCellsHandlerTool.cxx.
298 std::vector<IdentifierHash> cellNeighbours;
303 std::vector<unsigned int> neighbour_ids;
304 for (
unsigned int iNeighbour = 0;
305 iNeighbour < cellNeighbours.size();
317 return neighbour_ids;
◆ initialize()
StatusCode CaloCellsHandlerTool::initialize |
( |
| ) |
|
Definition at line 19 of file CaloCellsHandlerTool.cxx.
38 for (
int i = 0;
i < 3; ++
i) {
66 ATH_MSG_INFO(
"Loading cell map associating cells to FEBs");
71 std::ifstream
file(cellMapPath.c_str());
78 int online_id, offline_id,
ch, con_num, fbr;
79 std::string feb, con_type;
82 std::getline(
file, feb);
87 file >> offline_id >> online_id >> feb >>
ch >> con_type >> con_num >> fbr;
89 if (
file.eof())
break;
92 caloCell.
id = offline_id;
99 m_gepCellsBase.insert(std::pair<unsigned int, Gep::GepCaloCell>(caloCell.
id, caloCell));
105 ATH_MSG_ERROR(
"Could not open file containing the cell to FEB association");
106 return StatusCode::FAILURE;
109 ATH_MSG_INFO(
"Loaded FEB information for " << n_cells <<
" cells");
112 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ removeCellsFromOverloadedFEB()
StatusCode CaloCellsHandlerTool::removeCellsFromOverloadedFEB |
( |
std::vector< Gep::GepCaloCell > & |
cells | ) |
const |
|
private |
Definition at line 322 of file CaloCellsHandlerTool.cxx.
324 std::map<int,Gep::GepCaloCell> orderedCells;
326 orderedCells.insert(std::pair<int,Gep::GepCaloCell>(
cell.channel,
cell));
331 for ( ;cell_itr != orderedCells.end(); ++cell_itr) {
332 cells.push_back(cell_itr->second);
336 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ setG()
StatusCode CaloCellsHandlerTool::setG |
( |
int |
value | ) |
|
|
inline |
◆ setLeastSignificantBit()
StatusCode CaloCellsHandlerTool::setLeastSignificantBit |
( |
int |
value | ) |
|
|
inline |
Definition at line 61 of file CaloCellsHandlerTool.h.
63 ATH_MSG_FATAL(
"The value of the least significant bit in the GEP energy encoding cannot be set to " <<
value);
64 return StatusCode::FAILURE;
66 ATH_MSG_INFO(
"Setting the value for the least significant bit in the GEP energy encoding to " <<
value <<
" MeV");
69 return StatusCode::SUCCESS;
◆ setNumberOfEnergyBits()
StatusCode CaloCellsHandlerTool::setNumberOfEnergyBits |
( |
int |
value | ) |
|
|
inline |
Definition at line 42 of file CaloCellsHandlerTool.h.
51 default:
ATH_MSG_FATAL(
"A GEP energy encoding scheme with " <<
value <<
" energy bits is currently not defined");
52 return StatusCode::FAILURE;
58 return StatusCode::SUCCESS;
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_CaloCell_ID
◆ m_detStore
◆ m_doGepHardwareStyleEnergyEncoding
Gaudi::Property<bool> CaloCellsHandlerTool::m_doGepHardwareStyleEnergyEncoding {this, "HardwareStyleEnergyEncoding", false, "Enabling or disabling the hardware-style energy encoding for the GEP"} |
|
private |
◆ m_doTruncationOfOverflowingFEBs
Gaudi::Property<bool> CaloCellsHandlerTool::m_doTruncationOfOverflowingFEBs {this, "TruncationOfOverflowingFEBs", false, "Enabling or disabling the truncation of cells from FEBs with more than the maximum number of cells which can be send"} |
|
private |
◆ m_electronicNoiseKey
Initial value:{this,
"electronicNoiseKey",
"totalNoise",
"SG Key of CaloNoise data object"}
Definition at line 104 of file CaloCellsHandlerTool.h.
◆ m_evtStore
◆ m_gepCellsBase
std::map<unsigned int,Gep::GepCaloCell> CaloCellsHandlerTool::m_gepCellsBase = {} |
|
private |
◆ m_GepEnergyEncodingScheme
Gaudi::Property<std::string> CaloCellsHandlerTool::m_GepEnergyEncodingScheme {this, "GEPEnergyEncodingScheme", "", "String defining the GEP readout scheme according to number of readout bits + '-' + value of LSB in MeV + '-' + gain value"} |
|
private |
◆ m_LArCellMap
Gaudi::Property<std::string> CaloCellsHandlerTool::m_LArCellMap {this, "LArCellMapFile", "UpgradePerformanceFunctions/LAr_Cell_Map_offlineID_0.csv", "File associating LAr cells with readout FEBs and connection technology"} |
|
private |
◆ m_maxCellsPerFEB
unsigned CaloCellsHandlerTool::m_maxCellsPerFEB = -1 |
|
private |
◆ m_nEnergyBits
int CaloCellsHandlerTool::m_nEnergyBits = -1 |
|
private |
Key of the CaloNoise Conditions data object.
Typical values are '"electronicNoise', 'pileupNoise', or '"totalNoise' (default)
Definition at line 89 of file CaloCellsHandlerTool.h.
◆ m_readoutRanges
int CaloCellsHandlerTool::m_readoutRanges[5] = {-1,-1,-1,-1,-1} |
|
private |
◆ m_stepsPerRange
int CaloCellsHandlerTool::m_stepsPerRange = -1 |
|
private |
◆ m_totalNoiseKey
Initial value:{this,
"totalNoiseKey",
"totalNoise",
"SG Key of CaloNoise data object"}
Definition at line 111 of file CaloCellsHandlerTool.h.
◆ m_valG
int CaloCellsHandlerTool::m_valG = -1 |
|
private |
◆ m_valLeastSigBit
int CaloCellsHandlerTool::m_valLeastSigBit = -1 |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
@ IsEM
cut-based identification for egamma objects (cluster and track-based)
std::vector< unsigned int > neighbours
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
double dphi() const
delta phi
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
std::vector< SG::VarHandleKeyArray * > m_vhka
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
bool is_hec(const Identifier id) const
test if the id belongs to the HEC
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
bool is_em(const Identifier id) const
test if the id belongs to LArEM
bool is_fcal(const Identifier id) const
test if the id belongs to the FCAL - true also for MiniFCAL
std::string connection_type
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
double deta() const
delta eta
virtual void renounce()=0
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
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
StatusCode initialize(bool used=true)
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Data object for each calorimeter readout cell.
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
constexpr int pow(int base, int exp) noexcept
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>