|
ATLAS Offline Software
|
An AlgTool class to help converting LAr raw data objects to/from ByteStream.
More...
#include <LArRawDataContByteStreamTool.h>
|
| LArRawDataContByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Constructor Standard AlgTool constructor. More...
|
|
virtual | ~LArRawDataContByteStreamTool () |
| Destructor. More...
|
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
template<class COLLECTION , typename ... ARGS> |
StatusCode | convert (const RawEvent *re, COLLECTION *digit_cont, CaloGain::CaloGain gain, ARGS &&... args) const |
| Templated conversion class form Raw Event to a container. More...
|
|
StatusCode | WriteLArDigits (const LArDigitContainer *digit_cont, FEA_t &fea) const |
| Fill channels from LArDigitContainer to a FullEvent. More...
|
|
StatusCode | WriteLArCalibDigits (const LArCalibDigitContainer *digit_cont, FEA_t &fea) const |
| Fill channels from LArCalibDigitContainer to a FullEvent. More...
|
|
StatusCode | WriteLArRawChannels (const LArRawChannelContainer *CannelCont, FEA_t &fea) const |
| Fill channels from LArRawChannelContainer to a FullEvent. More...
|
|
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 |
|
|
CxxUtils::CachedUniquePtr< Hid2RESrcID > | m_hid2re |
| Contains the mapping from channel to ROD (writing only) More...
|
|
PublicToolHandle< LArRodDecoder > | m_decoder { this, "LArRodDecoder", "LArRodDecoder", "LArRodDecoder" } |
|
unsigned | m_DSPRunMode |
| Indicates which version of DSP code should be used for writing. More...
|
|
unsigned short | m_RodBlockVersion |
| Minor ROD block version This is equivalent to the lower 16 bits of the version word in the ROD block header. More...
|
|
bool | m_initializeForWriting |
| JobOption to intitialize services needed only for writing. More...
|
|
uint16_t | m_subDetId |
|
double | m_nfebsigma |
|
bool | m_includeDigits |
|
std::string | m_DigitContName |
|
const LArOnlineID * | m_onlineHelper = nullptr |
|
SG::ReadCondHandleKey< CaloNoise > | m_caloNoiseKey { this, "CaloNoiseKey", "totalNoise", "" } |
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_onOffIdMappingKey { this, "OnOffIdMappingKey", "LArOnOffIdMap", "LArOnOffIdMap" } |
|
SG::ReadCondHandleKey< LArFebRodMapping > | m_febRodMappingKey { this, "FebRodMappingKey", "LArFebRodMap", "LArFebRodMap" } |
|
SG::ReadCondHandleKey< CaloDetDescrManager > | m_caloMgrKey { this, "CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" } |
|
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 |
|
An AlgTool class to help converting LAr raw data objects to/from ByteStream.
This tool is used for reading as well as writing. It's main prupose is to find all LAr-Fragment in the full byte-stream event
Definition at line 48 of file LArRawDataContByteStreamTool.h.
◆ FEA_t
◆ RobIndex_t
◆ StoreGateSvc_t
◆ LArRawDataContByteStreamTool()
LArRawDataContByteStreamTool::LArRawDataContByteStreamTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~LArRawDataContByteStreamTool()
LArRawDataContByteStreamTool::~LArRawDataContByteStreamTool |
( |
| ) |
|
|
virtual |
◆ checkGainConsistency()
template<class COLLECTION >
bool LArRawDataContByteStreamTool::checkGainConsistency |
( |
const COLLECTION * |
coll | ) |
const |
|
private |
Check that all elements in a container have the same gain.
- Parameters
-
coll | Pointer to input container (template) |
- Returns
- false if an incosistency is detected
◆ convert()
template<class COLLECTION , typename ... ARGS>
Templated conversion class form Raw Event to a container.
- Parameters
-
- Returns
- Gaudi StatusCode
Iterates though all levels of the Atlas ByteStream format (aka eformat) to get all ROD fragments belonging to LAr. Methods from LArRodDecoder
are used to deal with the individual ROD fragments.
◆ 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
◆ finalize()
StatusCode LArRawDataContByteStreamTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getHid2RESrcID()
◆ initialize()
StatusCode LArRawDataContByteStreamTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ 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.
◆ interfaceID()
const InterfaceID & LArRawDataContByteStreamTool::interfaceID |
( |
| ) |
|
|
static |
◆ makeRodBlockStructure()
std::unique_ptr< LArRodBlockStructure > LArRawDataContByteStreamTool::makeRodBlockStructure |
( |
| ) |
const |
|
private |
Construct a RodBlockStructure instance of the proper concrete type.
Definition at line 425 of file LArRawDataContByteStreamTool.cxx.
432 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockTransparent (#2)" );
433 return std::make_unique<LArRodBlockTransparentV0<LArRodBlockHeaderTransparentV0> >();
437 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockCalibration (#7)" );
438 return std::make_unique<LArRodBlockCalibrationV0<LArRodBlockHeaderCalibrationV0> >();
443 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#5)" );
444 return std::make_unique<LArRodBlockPhysicsV5>();
447 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#6)" );
448 return std::make_unique<LArRodBlockPhysicsV6>();
451 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#4)" );
452 return std::make_unique<LArRodBlockPhysicsV0>();
457 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#5)" );
458 return std::make_unique<LArRodBlockPhysicsV3>();
462 return std::make_unique<LArRodBlockPhysicsV0>();
◆ 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.
◆ prepareRobIndex()
Prepare ROB index before conversion.
Definition at line 393 of file LArRawDataContByteStreamTool.cxx.
403 ATH_MSG_ERROR (
"RawEvent passed to 'convert'-function is a null pointer!" );
404 return StatusCode::FAILURE;
407 if (!
m_decoder->check_valid (
re,
msg()))
return StatusCode::FAILURE;
410 ATH_MSG_VERBOSE ( MSG::hex <<
"Full source ID: " <<
re->source_id() << MSG::dec );
415 eformat::helper::build_toc(*
re, robIndex );
416 if ( robIndex.empty() ) {
417 return StatusCode::FAILURE;
419 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ 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()
◆ WriteLArCalibDigits()
Fill channels from LArCalibDigitContainer to a FullEvent.
- Parameters
-
- Returns
- Gaudi StatusCode
Definition at line 200 of file LArRawDataContByteStreamTool.cxx.
205 <<
name()<<
".InitializeForWriting" );
206 return StatusCode::FAILURE;
208 ATH_MSG_DEBUG (
"Writing LArCalibDigitContainer to ByteStream" );
210 ATH_MSG_DEBUG (
"Null pointer passed to WriteLArCalibDigit routine!" );
211 return StatusCode::FAILURE;
217 ATH_MSG_DEBUG (
"This instance of LArRodBlockStructure can't hold LArCalibDigits!" );
218 return StatusCode::FAILURE;
229 ATH_MSG_WARNING (
"Attempt to persistify a empty LArDigitContainer to ByteStream" );
230 return StatusCode::SUCCESS;
233 ATH_MSG_ERROR (
"Inconsistent gain in LArCalibDigitContainer" );
234 return StatusCode::FAILURE;
237 const EventContext& ctx = Gaudi::Hive::currentContext();
243 std::map<uint32_t, LArRodEncoder> mapEncoder;
246 {
return mapEncoder.try_emplace (reid,
250 blstruct.get()).
first->second; };
253 int fixgain=(*it_b)->gain();
256 for(; it_b!=it_e; ++it_b){
260 getEncoder(reid).add (
digit, fixgain);
264 ATH_MSG_VERBOSE(
" number of channels in the LArCalibDigitContainer for gain "
265 << fixgain <<
": "<<
n );
274 for(;
it!=it_end;++
it) {
275 theROD = fea.getRodData( (*it).first );
278 ATH_MSG_DEBUG (
"Filled " << mapEncoder.size() <<
" Rod Blocks" );
279 return StatusCode::SUCCESS;
◆ WriteLArDigits()
Fill channels from LArDigitContainer to a FullEvent.
- Parameters
-
digit_cont | Pointer to LArDigitContainer (input) |
fea | Pointer to FullEventAssember (output) |
- Returns
- Gaudi StatusCode
Definition at line 100 of file LArRawDataContByteStreamTool.cxx.
105 <<
name()<<
".InitializeForWriting" );
106 return StatusCode::FAILURE;
110 ATH_MSG_ERROR (
"Null pointer passed to WriteLArDigit routine!" );
111 return StatusCode::FAILURE;
117 ATH_MSG_DEBUG (
"This instance of LArRodBlockStructure can't hold LArDigits!" );
118 return StatusCode::FAILURE;
129 ATH_MSG_WARNING (
"Attempt to persistify an empty LArDigitContainer to ByteStream" );
130 return StatusCode::SUCCESS;
133 const EventContext& ctx = Gaudi::Hive::currentContext();
139 std::map<uint32_t, LArRodEncoder> mapEncoder;
142 {
return mapEncoder.try_emplace (reid,
146 blstruct.get()).
first->second; };
151 int fixgain=(*it_b)->gain();
152 ATH_MSG_DEBUG(
" number of Digits in LArDigitContainer for gain " << fixgain <<
": "
153 << digitCont->size() );
155 for(; it_b!=it_e; ++it_b){
159 getEncoder(reid).add (
digit, fixgain);
162 ATH_MSG_VERBOSE(
" number of channels in the LArDigitContainer for gain "
163 << fixgain <<
": "<<
n );
167 ATH_MSG_DEBUG(
" number of channels in LArDigit container: "<< digitCont->size() );
170 for(; it_b!=it_e; ++it_b){
174 getEncoder(reid).add (
digit);
187 for(;
it!=it_end;++
it) {
188 theROD = fea.getRodData( (*it).first );
191 ATH_MSG_DEBUG (
"Filled " << mapEncoder.size() <<
" Rod Blocks" );
194 return StatusCode::SUCCESS;
◆ WriteLArRawChannels()
Fill channels from LArRawChannelContainer to a FullEvent.
- Parameters
-
- Returns
- Gaudi StatusCode
Definition at line 284 of file LArRawDataContByteStreamTool.cxx.
289 <<
name()<<
".InitializeForWriting" );
290 return StatusCode::FAILURE;
293 ATH_MSG_DEBUG (
"Null pointer passed to WriteLArCalibDigit routine!" );
294 return StatusCode::FAILURE;
300 ATH_MSG_DEBUG (
"This instance of LArRodBlockStructure can't hold LArRawChannels!" );
301 return StatusCode::FAILURE;
308 LArRawChannelContainer::const_iterator
it = channelCont->begin();
309 LArRawChannelContainer::const_iterator it_e= channelCont->end();
311 ATH_MSG_WARNING (
"Attempt to persistify a empty LArDigitContainer to ByteStream" );
312 return StatusCode::SUCCESS;
315 const EventContext& ctx = Gaudi::Hive::currentContext();
321 std::map<uint32_t, LArRodEncoder> mapEncoder;
324 {
return mapEncoder.try_emplace (reid,
328 blstruct.get()).
first->second; };
333 ATH_MSG_DEBUG(
" number of LArRawChannel container "<< channelCont->size() );
334 for(;
it!=it_e; ++
it){
349 getEncoder(reid).add (&rawChan);
361 ATH_MSG_WARNING (
"Attempt to persistify a empty LArDigitContainer to ByteStream" );
363 for(; it_b!=it_e; ++it_b){
368 getEncoder(reid).add (
digit);
381 for(; it_m!=it_m_e;++it_m) {
382 theROD = fea.getRodData( (*it_m).first );
387 ATH_MSG_DEBUG (
"Filled " << mapEncoder.size() <<
" Rod Blocks" );
388 return StatusCode::SUCCESS;
◆ m_caloMgrKey
◆ m_caloNoiseKey
◆ m_decoder
◆ m_detStore
◆ m_DigitContName
std::string LArRawDataContByteStreamTool::m_DigitContName |
|
private |
◆ m_DSPRunMode
unsigned LArRawDataContByteStreamTool::m_DSPRunMode |
|
private |
Indicates which version of DSP code should be used for writing.
This is equivalent to the DetectorEventType word in the ROD block header. Only for writing.
Definition at line 145 of file LArRawDataContByteStreamTool.h.
◆ m_evtStore
◆ m_febRodMappingKey
◆ m_hid2re
◆ m_includeDigits
bool LArRawDataContByteStreamTool::m_includeDigits |
|
private |
◆ m_initializeForWriting
bool LArRawDataContByteStreamTool::m_initializeForWriting |
|
private |
◆ m_nfebsigma
double LArRawDataContByteStreamTool::m_nfebsigma |
|
private |
◆ m_onlineHelper
◆ m_onOffIdMappingKey
◆ m_RodBlockVersion
unsigned short LArRawDataContByteStreamTool::m_RodBlockVersion |
|
private |
Minor ROD block version This is equivalent to the lower 16 bits of the version word in the ROD block header.
Only for writing.
Definition at line 151 of file LArRawDataContByteStreamTool.h.
◆ m_subDetId
uint16_t LArRawDataContByteStreamTool::m_subDetId |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Const iterator class for DataVector/DataList.
HWIdentifier channelID() const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
uint32_t getRodID(const LArFebRodMapping &rodMapping, const HWIdentifier &hid) const
make a ROD SrcID for a HWIdentifier
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
#define ATH_MSG_VERBOSE(x)
virtual bool canSetRawData()
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
virtual bool canIncludeRawData()
Liquid Argon digit base class.
Liquid Argon ROD output object base class.
virtual bool canSetRawDataFixed()
virtual bool canSetCalibration()
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Base class for LArDigits taken during calibration runs.
StatusCode initialize(bool used=true)
virtual bool canSetEnergy()
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
This class provides conversion from LArRawChannel and LArDigit to ROD format.
#define ATH_MSG_WARNING(x)
const boost::regex re(r_e)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Container class for LArDigit.
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.