 |
ATLAS Offline Software
|
#include <LArCellMuxAlg.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 |
|
|
StatusCode | writeMuxInputBitstream (Feb2BitsetMap &feb2Bitsets, const xAOD::EventInfo &eventInfo, const GlobalSim::GlobalLArCellContainer &gblLArCells) const |
| Function that compiles the LASP to MUX bitstream and writes it to file. More...
|
|
StatusCode | writeMuxOutputBitstream (const Feb2BitsetMap &feb2Bitsets, const xAOD::EventInfo &eventInfo, const GlobalSim::GlobalLArCellContainer &gblLArCells) const |
| Function that compiles the MUX to GEP bitstream and writes it to file. More...
|
|
std::bitset< FEB2_BITSTREAM_SIZE > | assembleBitsetForFeb2 (const std::vector< GlobalSim::GlobalLArCell * > &cells, std::size_t maxCells, bool inOverflow, bool inError, uint32_t bcid) const |
| Function which compiles the bitset for one particular FEB2. 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...
|
|
|
template<std::size_t N, typename T > |
static std::size_t | appendBits (std::bitset< N > &target, const T &src, std::size_t pos) |
| Helper function to append a bitset or vector of bools at a specific position in another bitset. More...
|
|
|
SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfo {this, "EventInfo", "EventInfo", "Key for the EventInfo container"} |
| Key for the EventInfo object. More...
|
|
SG::ReadHandleKey< GlobalSim::GlobalLArCellContainer > | m_gblLArCellContainerKey {this, "GlobalLArCellsKey", "GlobalLArCells", "Key for the output container of the LAr cells sent to Global"} |
| Key to the GlobalLArCellContainer. More...
|
|
Gaudi::Property< bool > | m_writeMuxInputBitstreamToFile {this, "WriteMuxInputBitstreamToFile", true, "Flag to enable the writing of MUX input bitstreams to file"} |
| Flag to enable writing of MUX input bitstreams (FEB2/LASP -> MUX) to file. More...
|
|
Gaudi::Property< bool > | m_writeMuxOutputBitstreamToFile {this, "WriteMuxOutputBitstreamToFile", true, "Flag to enable the writing of MUX output bitstreams to file"} |
| Flag to enable writing ofMUX output bitstreams (MUX -> GEP) to file. 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 27 of file LArCellMuxAlg.h.
◆ Feb2BitsetMap
◆ StoreGateSvc_t
◆ appendBits()
template<std::size_t N, typename T >
std::size_t GlobalSim::LArCellMuxAlg::appendBits |
( |
std::bitset< N > & |
target, |
|
|
const T & |
src, |
|
|
std::size_t |
pos |
|
) |
| |
|
staticprivate |
Helper function to append a bitset or vector of bools at a specific position in another bitset.
Definition at line 273 of file LArCellMuxAlg.cxx.
274 for (std::size_t
i = 0;
i <
src.size(); ++
i, ++
pos)
◆ assembleBitsetForFeb2()
Function which compiles the bitset for one particular FEB2.
Definition at line 110 of file LArCellMuxAlg.cxx.
113 std::vector<const GlobalSim::GlobalLArCell*> sortedCells(
cells.begin(),
cells.end());
114 std::sort(sortedCells.begin(), sortedCells.end(), [](
const auto*
a,
const auto*
b) {
115 return a->getChannel() < b->getChannel();
119 const std::size_t bitwidth_4SigmaMask = maxCells;
123 std::vector<bool> mask_fourSigma(bitwidth_4SigmaMask,
false);
124 std::vector<bool> energyBits(bitwidth_energyBlock,
false);
126 std::size_t bitPosEnergy = 0;
128 for (std::size_t
i = 0;
i < sortedCells.size(); ++
i) {
130 const auto*
cell = sortedCells[
i];
133 mask_twoSigma[
cell->getChannel()] =
true;
136 mask_fourSigma[
i] = (
cell->getSigma() >= 4.0);
139 const boost::dynamic_bitset<>& enBits =
cell->getEnergyBitstring();
140 for (std::size_t j = 0; j < enBits.size() && bitPosEnergy < bitwidth_energyBlock; ++j, ++bitPosEnergy) {
141 energyBits[bitPosEnergy]= enBits[j];
146 std::bitset<8> bitsBCN(
bcid & 0xFF);
149 std::bitset<FEB2_BITSTREAM_SIZE> bitstream;
155 if (inOverflow) bitstream.set(
pos);
157 if (inError) bitstream.set(
pos);
◆ 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()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode GlobalSim::LArCellMuxAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
execute function running for every event
Definition at line 34 of file LArCellMuxAlg.cxx.
40 CHECK(eventInfo.isValid());
44 CHECK(h_gblLArCells.isValid());
45 const auto & gblLArCells = *h_gblLArCells;
57 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::LArCellMuxAlg::initialize |
( |
| ) |
|
|
overridevirtual |
initialize function running before first event
Definition at line 22 of file LArCellMuxAlg.cxx.
28 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.
◆ 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()
◆ writeMuxInputBitstream()
Function that compiles the LASP to MUX bitstream and writes it to file.
Definition at line 64 of file LArCellMuxAlg.cxx.
74 return StatusCode::FAILURE;
78 for (
const auto& feb2Key : gblLArCells.
getFeb2Keys()) {
87 feb2Bitsets[feb2Key] = input_bitstream;
90 out <<
"====== " << feb2Key <<
" is sending to " << gblLArCells.
getMuxForFeb2(feb2Key) <<
":\n";
95 out << input_bitstream[bitIndex];
105 return StatusCode::SUCCESS;
◆ writeMuxOutputBitstream()
Function that compiles the MUX to GEP bitstream and writes it to file.
Definition at line 171 of file LArCellMuxAlg.cxx.
176 return StatusCode::SUCCESS;
183 return StatusCode::FAILURE;
190 unsigned long long markerPattern =
191 (0xAULL << nBitsMarker*7) |
192 (0xBULL << nBitsMarker*6) |
193 (0xBULL << nBitsMarker*5) |
194 (0xAULL << nBitsMarker*4) |
195 (0xAULL << nBitsMarker*3) |
196 (0xBULL << nBitsMarker*2) |
197 (0xBULL << nBitsMarker) |
200 std::bitset<BITWIDTH_MUX_OUTPUT> markerBitset(markerPattern);
203 std::bitset<12> bitsBCN(eventInfo.
bcid() & 0xFFF);
206 for (
int muxID = 0; muxID < 32; ++muxID) {
208 std::string muxKey =
fmt::format(
"apl-gbl-mux-lasp-{:02d}", muxID);
209 out <<
"====== " << muxKey <<
" is sending to GEP:\n";
211 std::bitset<6> bitsetMuxID(muxID);
215 std::bitset<bitwidthMuxHeader> fullMuxHeader;
233 out << fullMuxHeader[bitIndex];
240 for (
const auto& feb2 : feb2s) {
242 auto it = feb2Bitsets.find(feb2);
243 if (
it == feb2Bitsets.end()) {
245 return StatusCode::FAILURE;
247 const std::bitset<FEB2_BITSTREAM_SIZE>& feb2Bitset =
it->second;
252 out << feb2Bitset[bitIndex];
270 return StatusCode::SUCCESS;
◆ BITWIDTH_2SIGMAMASK
constexpr std::size_t GlobalSim::LArCellMuxAlg::BITWIDTH_2SIGMAMASK = 128 |
|
staticconstexpr |
◆ BITWIDTH_MUX_INPUT
constexpr std::size_t GlobalSim::LArCellMuxAlg::BITWIDTH_MUX_INPUT = 32 |
|
staticconstexpr |
◆ BITWIDTH_MUX_OUTPUT
constexpr std::size_t GlobalSim::LArCellMuxAlg::BITWIDTH_MUX_OUTPUT = 64 |
|
staticconstexpr |
◆ FEB2_BITSTREAM_SIZE
constexpr std::size_t GlobalSim::LArCellMuxAlg::FEB2_BITSTREAM_SIZE = 576 |
|
staticconstexpr |
◆ 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_gblLArCellContainerKey
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeMuxInputBitstreamToFile
Gaudi::Property<bool> GlobalSim::LArCellMuxAlg::m_writeMuxInputBitstreamToFile {this, "WriteMuxInputBitstreamToFile", true, "Flag to enable the writing of MUX input bitstreams to file"} |
|
private |
Flag to enable writing of MUX input bitstreams (FEB2/LASP -> MUX) to file.
Definition at line 66 of file LArCellMuxAlg.h.
◆ m_writeMuxOutputBitstreamToFile
Gaudi::Property<bool> GlobalSim::LArCellMuxAlg::m_writeMuxOutputBitstreamToFile {this, "WriteMuxOutputBitstreamToFile", true, "Flag to enable the writing of MUX output bitstreams to file"} |
|
private |
Flag to enable writing ofMUX output bitstreams (MUX -> GEP) to file.
Definition at line 69 of file LArCellMuxAlg.h.
◆ N_WORDS_MUX_FOOTER
constexpr std::size_t GlobalSim::LArCellMuxAlg::N_WORDS_MUX_FOOTER = 7 |
|
staticconstexpr |
◆ N_WORDS_MUX_HEADER
constexpr std::size_t GlobalSim::LArCellMuxAlg::N_WORDS_MUX_HEADER = 2 |
|
staticconstexpr |
The documentation for this class was generated from the following files:
std::size_t getMaxCellsPerFeb2() const
Function to get maximum number of cells per FEB2.
bool feb2InOverflow(const std::string &feb2Key) const
Check if a given FEB2 is in overflow.
const std::vector< std::string > & getOrderedFeb2sForMux(const std::string &mux) const
Function to get ordered list of FEB2s for a given MUX name.
uint64_t eventNumber() const
The current event's event number.
static constexpr std::size_t BITWIDTH_MUX_INPUT
static std::size_t appendBits(std::bitset< N > &target, const T &src, std::size_t pos)
Helper function to append a bitset or vector of bools at a specific position in another bitset.
bool feb2InError(const std::string &feb2Key) const
Check if a given FEB2 is in error.
SG::ReadHandleKey< GlobalSim::GlobalLArCellContainer > m_gblLArCellContainerKey
Key to the GlobalLArCellContainer.
static constexpr std::size_t FEB2_BITSTREAM_SIZE
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)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
static constexpr std::size_t BITWIDTH_2SIGMAMASK
const std::unordered_set< std::string > & getFeb2Keys() const
Function to return the full list of FEB2 names.
static constexpr std::size_t N_WORDS_MUX_HEADER
uint32_t runNumber() const
The current event's run number.
StatusCode writeMuxInputBitstream(Feb2BitsetMap &feb2Bitsets, const xAOD::EventInfo &eventInfo, const GlobalSim::GlobalLArCellContainer &gblLArCells) const
Function that compiles the LASP to MUX bitstream and writes it to file.
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
StatusCode writeMuxOutputBitstream(const Feb2BitsetMap &feb2Bitsets, const xAOD::EventInfo &eventInfo, const GlobalSim::GlobalLArCellContainer &gblLArCells) const
Function that compiles the MUX to GEP bitstream and writes it to file.
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.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Gaudi::Property< bool > m_writeMuxOutputBitstreamToFile
Flag to enable writing ofMUX output bitstreams (MUX -> GEP) to file.
::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.
const std::vector< GlobalLArCell * > & getCellsForFeb2(const std::string &feb2) const
Function to get all GlobalLArCells for a given FEB2 name.
#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.
static constexpr std::size_t N_WORDS_MUX_FOOTER
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::map< std::string, std::bitset< FEB2_BITSTREAM_SIZE > > Feb2BitsetMap
std::string to_string(const DetectorType &type)
static constexpr std::size_t BITWIDTH_MUX_OUTPUT
setEventNumber setTimeStamp bcid
const std::string & getMuxForFeb2(const std::string &feb2Key) const
Function to get the associated MUX name for a given FEB2.
bool muxInOverflow(const std::string &muxKey) const
Check if a given MUX is in overflow.
Gaudi::Property< bool > m_writeMuxInputBitstreamToFile
Flag to enable writing of MUX input bitstreams (FEB2/LASP -> MUX) to file.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Key for the EventInfo object.
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)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode sysInitialize() override
Override sysInitialize.
uint32_t bcid() const
The bunch crossing ID of the event.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
std::bitset< FEB2_BITSTREAM_SIZE > assembleBitsetForFeb2(const std::vector< GlobalSim::GlobalLArCell * > &cells, std::size_t maxCells, bool inOverflow, bool inError, uint32_t bcid) const
Function which compiles the bitset for one particular FEB2.
bool muxInError(const std::string &muxKey) const
Check if a given MUX is in error.