 |
ATLAS Offline Software
|
#include <LArCellPreparationAlg.h>
|
virtual StatusCode | initialize () override |
| initialize function running before first event More...
|
|
virtual StatusCode | execute (const EventContext &) const override |
| execute function running for every event More...
|
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
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 | 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, V, H > &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 |
|
|
std::pair< float, boost::dynamic_bitset<> > | encodeEnergy (float energy) const |
| Function to simulate the cell energy as seen by Global. More...
|
|
StatusCode | removeCellsFromOverloadedFEB (std::vector< GlobalSim::GlobalLArCell > &cells) const |
| Function to simulate the truncation of overflowing FEB2s. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
int | m_readoutRanges [5] = {-1,-1,-1,-1,-1} |
| array holding the energy edges of the multilinear encoding More...
|
|
int | m_stepsPerRange = -1 |
| number of discrete values per multilinear energy encoding range More...
|
|
unsigned | m_maxCellsPerFEB = -1 |
| maximum number of cells that can be send to Global for each FEB2 More...
|
|
std::map< int, GlobalSim::GlobalLArCell > | m_gblLArCellMap = {} |
| LAr cell map where the key is the offline cell ID. More...
|
|
std::unique_ptr< GlobalSim::GlobalLArCellContainer > | m_gblLArCellContainerTemplate |
| GlobalLArCellContainer template which is constructed in initialize and used in execute. More...
|
|
SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfo {this, "EventInfo", "EventInfo", "Key for the EventInfo container"} |
| Key for the EventInfo object. More...
|
|
Gaudi::Property< int > | m_numberOfEnergyBits {this, "numberOfEnergyBits", 6, "Number of bits reserved for the multilinear energy encoding"} |
| Parameters defining the multilinear energy encoding scheme. More...
|
|
Gaudi::Property< int > | m_valueLSB {this, "valueLeastSignificantBit", 40, "Value of the least significant bit in MeV"} |
|
Gaudi::Property< int > | m_valueGainFactor {this, "valueGainFactor", 4, "Value of the gain factor of the multilinear energey encoding"} |
|
Gaudi::Property< std::string > | m_LArCellMap |
| Path to the LAr cell map in the CVMFS GroupData space. More...
|
|
SG::ReadHandleKey< CaloCellContainer > | m_caloCellsKey {this, "caloCells", "AllCalo", "key to read in a CaloCell container"} |
| Key to the CaloCell container. More...
|
|
SG::ReadCondHandleKey< CaloNoise > | m_totalNoiseKey {this, "totalNoiseKey", "totalNoise", "SG Key of CaloNoise data object"} |
| Key to the total noise used for each CaloCell. More...
|
|
SG::WriteHandleKey< GlobalSim::GlobalLArCellContainer > | m_LArCellContainerKey {this, "GlobalLArCellsKey", "GlobalLArCells", "Key for the output container of the LAr cells sent to Global"} |
| Key to writing the GlobalLArCellContainer to StoreGate. More...
|
|
DataObjIDColl | m_extendedExtraObjects |
| Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
|
|
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 29 of file LArCellPreparationAlg.h.
◆ StoreGateSvc_t
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ 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);
◆ 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.
◆ 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.
◆ 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()
◆ encodeEnergy()
std::pair< float, boost::dynamic_bitset<> > GlobalSim::LArCellPreparationAlg::encodeEnergy |
( |
float |
energy | ) |
const |
|
private |
Function to simulate the cell energy as seen by Global.
Definition at line 218 of file LArCellPreparationAlg.cxx.
231 for (
int i = 1;
i <= 3; ++
i) {
237 float encoded_energy = -1;
249 return std::pair<float,boost::dynamic_bitset<>>(encoded_energy,energy_bits);
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode GlobalSim::LArCellPreparationAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
execute function running for every event
Definition at line 130 of file LArCellPreparationAlg.cxx.
135 CHECK(eventInfo.isValid());
139 CHECK(h_caloCells.isValid());
140 const auto &
cells = *h_caloCells;
145 if (!totalNoiseHdl.isValid()) {
return StatusCode::FAILURE;}
146 const CaloNoise* totalNoiseCDO = *totalNoiseHdl;
148 std::map<std::string,std::vector<GlobalSim::GlobalLArCell>> gblLArCellsPerFEB2;
152 int cell_id = (
cell->ID().get_identifier32()).get_compact();
160 float sigma =
cell->energy() / totalNoise;
163 if (
sigma < 2.0)
continue;
165 if (
cell->badcell())
continue;
167 std::pair<float, boost::dynamic_bitset<>> gep_energy =
encodeEnergy(
cell->energy() / TMath::CosH(
cell->eta()));
169 gblLArCell.
setEnergy(gep_energy.first, std::move(gep_energy.second));
174 auto feb2_itr = gblLArCellsPerFEB2.find(gblLArCell.
getFEB2());
175 if (feb2_itr != gblLArCellsPerFEB2.end()) feb2_itr->second.push_back(gblLArCell);
177 std::vector<GlobalSim::GlobalLArCell> cellsThisFEB;
178 cellsThisFEB.push_back(gblLArCell);
179 gblLArCellsPerFEB2.insert(std::pair<std::string,std::vector<GlobalSim::GlobalLArCell>>(gblLArCell.
getFEB2(),cellsThisFEB));
185 auto gblLArCellContainer = std::make_unique<GlobalSim::GlobalLArCellContainer>(templateRef);
188 for (
auto& [feb2Name,
cells] : gblLArCellsPerFEB2) {
191 bool inOverflow =
false;
192 bool inError =
false;
196 ATH_MSG_INFO(
"FEB " << feb2Name <<
" is sending " <<
cells.size() <<
" cells, which is more cells than GEP can receive. Removing all but the possible " <<
m_maxCellsPerFEB <<
" cells.");
201 for (
auto& gblLArCell :
cells)
202 gblLArCellContainer->push_back(std::move(gblLArCell));
204 gblLArCellContainer->setFeb2Flags(feb2Name, inOverflow, inError);
206 ATH_MSG_DEBUG(
"Global is receiving a total of " << gblLArCellContainer->size() <<
" LAr cells in this event");
209 ATH_CHECK( h_gblLArCellContainer.
record( std::move(gblLArCellContainer) ) );
211 return StatusCode::SUCCESS;
◆ 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
◆ extraOutputDeps()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.
◆ filterPassed()
◆ initialize()
StatusCode GlobalSim::LArCellPreparationAlg::initialize |
( |
| ) |
|
|
overridevirtual |
initialize function running before first event
Definition at line 27 of file LArCellPreparationAlg.cxx.
62 return StatusCode::FAILURE;
65 ATH_MSG_INFO(
"Loading cell map associating LAr cells to FEB2s");
70 std::ifstream
file(cellMapPath.c_str());
75 std::map<std::string,Feb2MuxInfo> feb2MuxAssoc;
80 int online_id, offline_id,
channel, con_num, fbr;
81 std::string assocFEB2, con_type, muxname, muxrack, cnnctr, laspname, lasprack;
84 std::getline(
file, assocFEB2);
89 file >> offline_id >> online_id >> assocFEB2 >>
channel >> con_type >> con_num >> fbr >> muxname >> muxrack >> cnnctr >> laspname >> lasprack;
91 if (
file.eof())
break;
94 gblLArCell.setBoardConnector(cnnctr, con_type, con_num, fbr);
95 gblLArCell.setMUX(muxname);
96 gblLArCell.setLASP(laspname);
98 m_gblLArCellMap.insert(std::pair<int, GlobalSim::GlobalLArCell>(offline_id, gblLArCell));
100 int indexOnMux = fbr;
101 if (cnnctr ==
"B") indexOnMux += 24;
102 if (cnnctr ==
"C") indexOnMux += 32;
105 auto itr = feb2MuxAssoc.find(assocFEB2);
106 if (itr == feb2MuxAssoc.end()) {
107 feb2MuxAssoc.insert(std::pair<std::string,Feb2MuxInfo>(assocFEB2, {muxname, indexOnMux}));
114 ATH_MSG_ERROR(
"Could not open file containing the cell to FEB2 association");
115 return StatusCode::FAILURE;
118 ATH_MSG_DEBUG(
"Loaded FEB2 information for " << n_cells <<
" LAr cells");
124 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.
◆ isClonable()
◆ 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 GlobalSim::LArCellPreparationAlg::removeCellsFromOverloadedFEB |
( |
std::vector< GlobalSim::GlobalLArCell > & |
cells | ) |
const |
|
private |
Function to simulate the truncation of overflowing FEB2s.
Definition at line 255 of file LArCellPreparationAlg.cxx.
259 return a.getChannel() < b.getChannel(); });
265 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ sysExecute()
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.
◆ sysInitialize()
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ 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_caloCellsKey
◆ m_detStore
◆ m_eventInfo
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 114 of file AthCommonReentrantAlgorithm.h.
◆ m_gblLArCellContainerTemplate
◆ m_gblLArCellMap
◆ m_LArCellContainerKey
◆ m_LArCellMap
Gaudi::Property<std::string> GlobalSim::LArCellPreparationAlg::m_LArCellMap |
|
private |
Initial value:{this, "LArCellMapFile", "UpgradePerformanceFunctions/LAr_Cell_Map_offlineID_1.csv",
"File associating LAr cells with readout FEBs and connection technology"}
Path to the LAr cell map in the CVMFS GroupData space.
Definition at line 67 of file LArCellPreparationAlg.h.
◆ m_maxCellsPerFEB
unsigned GlobalSim::LArCellPreparationAlg::m_maxCellsPerFEB = -1 |
|
private |
◆ m_numberOfEnergyBits
Gaudi::Property<int> GlobalSim::LArCellPreparationAlg::m_numberOfEnergyBits {this, "numberOfEnergyBits", 6, "Number of bits reserved for the multilinear energy encoding"} |
|
private |
◆ m_readoutRanges
int GlobalSim::LArCellPreparationAlg::m_readoutRanges[5] = {-1,-1,-1,-1,-1} |
|
private |
◆ m_stepsPerRange
int GlobalSim::LArCellPreparationAlg::m_stepsPerRange = -1 |
|
private |
◆ m_totalNoiseKey
◆ m_valueGainFactor
Gaudi::Property<int> GlobalSim::LArCellPreparationAlg::m_valueGainFactor {this, "valueGainFactor", 4, "Value of the gain factor of the multilinear energey encoding"} |
|
private |
◆ m_valueLSB
Gaudi::Property<int> GlobalSim::LArCellPreparationAlg::m_valueLSB {this, "valueLeastSignificantBit", 40, "Value of the least significant bit in MeV"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
std::unique_ptr< GlobalSim::GlobalLArCellContainer > m_gblLArCellContainerTemplate
GlobalLArCellContainer template which is constructed in initialize and used in execute.
Gaudi::Property< int > m_valueGainFactor
std::map< int, GlobalSim::GlobalLArCell > m_gblLArCellMap
LAr cell map where the key is the offline cell ID.
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
Key to the total noise used for each CaloCell.
int m_readoutRanges[5]
array holding the energy edges of the multilinear encoding
Gaudi::Property< int > m_valueLSB
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
void setEnergy(float energy)
set transverse energy in MeV
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
void setSigma(float sigma)
set significancy of energy deposit
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
int m_stepsPerRange
number of discrete values per multilinear energy encoding range
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const std::string & getFEB2() const
get the name of the FEB2 this cell is associated with
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Gaudi::Property< int > m_numberOfEnergyBits
Parameters defining the multilinear energy encoding scheme.
std::pair< float, boost::dynamic_bitset<> > encodeEnergy(float energy) const
Function to simulate the cell energy as seen by Global.
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
Key to the CaloCell container.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Gaudi::Property< std::string > m_LArCellMap
Path to the LAr cell map in the CVMFS GroupData space.
std::string to_string(const DetectorType &type)
StatusCode initialize(bool used=true)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
unsigned m_maxCellsPerFEB
maximum number of cells that can be send to Global for each FEB2
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
StatusCode removeCellsFromOverloadedFEB(std::vector< GlobalSim::GlobalLArCell > &cells) const
Function to simulate the truncation of overflowing FEB2s.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Key for the EventInfo object.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode sysInitialize() override
Override sysInitialize.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
void setPosition(float eta, float phi)
set position of cell in eta-phi space
constexpr int pow(int base, int exp) noexcept
SG::WriteHandleKey< GlobalSim::GlobalLArCellContainer > m_LArCellContainerKey
Key to writing the GlobalLArCellContainer to StoreGate.