ATLAS Offline Software
Loading...
Searching...
No Matches
LArLATOMEDecoder Class Reference

#include <LArLATOMEDecoder.h>

Inheritance diagram for LArLATOMEDecoder:
Collaboration diagram for LArLATOMEDecoder:

Classes

class  EventProcess
class  LatomeAveragedRawData
class  LatomeCalibPatterns
class  LatomeRawData
 4th bit should be this value if the word indicate ADC value. More...

Public Types

typedef unsigned int Word
typedef int NumWord
typedef int Packet
typedef int SuperCell
typedef int Sample
typedef int NumLATOME
typedef std::string Path

Public Member Functions

 LArLATOMEDecoder (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor.
virtual ~LArLATOMEDecoder ()=default
 Destructor.
virtual StatusCode initialize ()
 Initialize the converter.
virtual StatusCode finalize ()
 Finalize the converter.
StatusCode convert (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &robFrags, const LArLATOMEMapping *map, LArDigitContainer *adc_coll, LArDigitContainer *adc_bas_coll, LArRawSCContainer *et_coll, LArRawSCContainer *et_id_coll, LArLATOMEHeaderContainer *header_coll) const
 Converter.
StatusCode convert (const RawEvent *re, const LArLATOMEMapping *map, const LArOnOffIdMapping *onoffmap, const LArCalibLineMapping *clmap, LArAccumulatedDigitContainer *accdigits, LArAccumulatedCalibDigitContainer *caccdigits, LArLATOMEHeaderContainer *header_coll) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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 extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const LArOnline_SuperCellIDm_onlineId {}
ToolHandle< ICaloSuperCellIDToolm_sc2ccMappingTool
BooleanProperty m_ignoreBarrelChannels {this, "IgnoreBarrelChannels", false}
BooleanProperty m_ignoreEndcapChannels {this, "IgnoreEndcapChannels", false}
BooleanProperty m_protectSourceId {this, "ProtectSourceId", true, "discard main readout sourceID, should be false for reading all files from the mon path with old source IDs"}
BooleanProperty m_keepPulsed {this, "KeepOnlyPulsed", true}
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKeySC {this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static const int s_nBunches = 3564
 Maximum value of BCID.

Detailed Description

Definition at line 61 of file LArLATOMEDecoder.h.

Member Typedef Documentation

◆ NumLATOME

Definition at line 69 of file LArLATOMEDecoder.h.

◆ NumWord

Definition at line 65 of file LArLATOMEDecoder.h.

◆ Packet

Definition at line 66 of file LArLATOMEDecoder.h.

◆ Path

typedef std::string LArLATOMEDecoder::Path

Definition at line 70 of file LArLATOMEDecoder.h.

◆ Sample

Definition at line 68 of file LArLATOMEDecoder.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ SuperCell

Definition at line 67 of file LArLATOMEDecoder.h.

◆ Word

typedef unsigned int LArLATOMEDecoder::Word

Definition at line 64 of file LArLATOMEDecoder.h.

Constructor & Destructor Documentation

◆ LArLATOMEDecoder()

LArLATOMEDecoder::LArLATOMEDecoder ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructor.

Definition at line 24 of file LArLATOMEDecoder.cxx.

25 : AthAlgTool(type, name, parent), m_sc2ccMappingTool("CaloSuperCellIDTool") {
26 declareInterface<LArLATOMEDecoder>(this);
27}
AthAlgTool()
Default constructor:
ToolHandle< ICaloSuperCellIDTool > m_sc2ccMappingTool

◆ ~LArLATOMEDecoder()

virtual LArLATOMEDecoder::~LArLATOMEDecoder ( )
virtualdefault

Destructor.

Member Function Documentation

◆ convert() [1/2]

StatusCode LArLATOMEDecoder::convert ( const RawEvent * re,
const LArLATOMEMapping * map,
const LArOnOffIdMapping * onoffmap,
const LArCalibLineMapping * clmap,
LArAccumulatedDigitContainer * accdigits,
LArAccumulatedCalibDigitContainer * caccdigits,
LArLATOMEHeaderContainer * header_coll ) const

Definition at line 43 of file LArLATOMEDecoder.cxx.

45 {
46
47 if(!re) return StatusCode::FAILURE;;
48 bool ret = false;
49 // Check fragment validity:
50 try {
51 ret = re->check();
52 } catch (eformat::Issue& ex) {
53 ATH_MSG_WARNING("Exception while checking eformat fragment validity: " << ex.what());
54 ret = false;
55 }
56 if (!ret) {
57 ATH_MSG_ERROR("Got invalid RawEvent fragment");
58 return StatusCode::FAILURE;
59 }
60 // Build TOC
61 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > robIndex;
62 eformat::helper::build_toc(*re, robIndex);
63 for (const auto& mapit : robIndex)
64 ATH_MSG_DEBUG("Rob Index subdetgroup is " << std::hex << mapit.first);
65 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> >::const_iterator robIt = robIndex.find(eformat::LAR);
66 if (robIt != robIndex.end()) {
67 const std::vector<const uint32_t*>& robs = robIt->second;
68 for (const uint32_t* pRob : robs) {
69 try {
70 ROBFragment robFrag(pRob);
72 uint32_t latomeSourceID = robFrag.rod_source_id();
73 if (!(latomeSourceID & 0x1000)) {
74 ATH_MSG_DEBUG(" discarding non latome source ID " << std::hex << latomeSourceID);
75 continue;
76 }
77 ATH_MSG_DEBUG(" found latome source ID " << std::hex << latomeSourceID);
78 }
79 EventProcess ev(this, 0, 0, 0, 0, accdigits, caccdigits, header_coll);
80 ev.fillCollection(&robFrag, map, onoffmap, clmap);
81 } catch (eformat::Issue& ex) {
82 ATH_MSG_WARNING(" exception thrown by ROBFragment, badly corrupted event. Abort decoding ");
83 if (accdigits)
84 accdigits->clear();
85 if (caccdigits)
86 caccdigits->clear();
87 if (header_coll)
88 header_coll->clear();
89 break;
90 }
91 } // end loop over robs
92 } // end if got LAr-RODs
93
94 return StatusCode::SUCCESS;
95}
const boost::regex re(r_e)
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
void clear()
Erase all the elements in the collection.
BooleanProperty m_protectSourceId
int ev
Definition globals.cxx:25
eformat::ROBFragment< PointerType > ROBFragment
Definition RawEvent.h:27
setEventNumber uint32_t

◆ convert() [2/2]

StatusCode LArLATOMEDecoder::convert ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > & robFrags,
const LArLATOMEMapping * map,
LArDigitContainer * adc_coll,
LArDigitContainer * adc_bas_coll,
LArRawSCContainer * et_coll,
LArRawSCContainer * et_id_coll,
LArLATOMEHeaderContainer * header_coll ) const

Converter.

Definition at line 97 of file LArLATOMEDecoder.cxx.

99 {
100
101 // Check fragment validity:
102 // Build TOC
103 if (robFrags.size() > 0) {
104 for (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* pRob : robFrags) {
105 try {
106 if (m_protectSourceId) {
107 uint32_t latomeSourceID = pRob->rod_source_id();
108 if (!(latomeSourceID & 0x1000)) {
109 ATH_MSG_DEBUG(" discarding non latome source ID " << std::hex << latomeSourceID);
110 continue;
111 }
112 ATH_MSG_DEBUG(" found latome source ID " << std::hex << latomeSourceID);
113 }
114 EventProcess ev(this, adc_coll, adc_bas_coll, et_coll, et_id_coll, 0, 0, header_coll);
115 ev.fillCollection(pRob, map, nullptr, nullptr);
116 } catch (eformat::Issue& ex) {
117 ATH_MSG_WARNING(" exception thrown by ROBFragment, badly corrupted event. Abort decoding ");
118 if (adc_coll)
119 adc_coll->clear();
120 if (adc_bas_coll)
121 adc_bas_coll->clear();
122 if (et_coll)
123 et_coll->clear();
124 if (et_id_coll)
125 et_id_coll->clear();
126 if (header_coll)
127 header_coll->clear();
128 break;
129 }
130 } // end loop over robs
131 } // end if got LAr-RODs
132 return StatusCode::SUCCESS;
133}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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()

virtual StatusCode LArLATOMEDecoder::finalize ( )
inlinevirtual

Finalize the converter.

Definition at line 80 of file LArLATOMEDecoder.h.

80{return StatusCode::SUCCESS;};

◆ initialize()

StatusCode LArLATOMEDecoder::initialize ( )
virtual

Initialize the converter.

Definition at line 33 of file LArLATOMEDecoder.cxx.

33 {
34
35 ATH_CHECK(detStore()->retrieve(m_onlineId, "LArOnline_SuperCellID"));
36
37 ATH_CHECK(m_sc2ccMappingTool.retrieve());
38 ATH_CHECK(m_cablingKeySC.initialize());
39
40 return StatusCode::SUCCESS;
41}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
const LArOnline_SuperCellID * m_onlineId
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

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 & LArLATOMEDecoder::interfaceID ( )
static

Definition at line 29 of file LArLATOMEDecoder.cxx.

29 {
31}
static const InterfaceID IID_ILArLATOMEDecoder("LArLATOMEDecoder", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

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()

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 > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_cablingKeySC

SG::ReadCondHandleKey<LArOnOffIdMapping> LArLATOMEDecoder::m_cablingKeySC {this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
private

Definition at line 261 of file LArLATOMEDecoder.h.

261{this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_ignoreBarrelChannels

BooleanProperty LArLATOMEDecoder::m_ignoreBarrelChannels {this, "IgnoreBarrelChannels", false}
private

Definition at line 257 of file LArLATOMEDecoder.h.

257{this, "IgnoreBarrelChannels", false};

◆ m_ignoreEndcapChannels

BooleanProperty LArLATOMEDecoder::m_ignoreEndcapChannels {this, "IgnoreEndcapChannels", false}
private

Definition at line 258 of file LArLATOMEDecoder.h.

258{this, "IgnoreEndcapChannels", false};

◆ m_keepPulsed

BooleanProperty LArLATOMEDecoder::m_keepPulsed {this, "KeepOnlyPulsed", true}
private

Definition at line 260 of file LArLATOMEDecoder.h.

260{this, "KeepOnlyPulsed", true};

◆ m_onlineId

const LArOnline_SuperCellID* LArLATOMEDecoder::m_onlineId {}
private

Definition at line 254 of file LArLATOMEDecoder.h.

254{};

◆ m_protectSourceId

BooleanProperty LArLATOMEDecoder::m_protectSourceId {this, "ProtectSourceId", true, "discard main readout sourceID, should be false for reading all files from the mon path with old source IDs"}
private

Definition at line 259 of file LArLATOMEDecoder.h.

259{this, "ProtectSourceId", true, "discard main readout sourceID, should be false for reading all files from the mon path with old source IDs"};

◆ m_sc2ccMappingTool

ToolHandle<ICaloSuperCellIDTool> LArLATOMEDecoder::m_sc2ccMappingTool
private

Definition at line 255 of file LArLATOMEDecoder.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ s_nBunches

const int LArLATOMEDecoder::s_nBunches = 3564
staticprivate

Maximum value of BCID.

Definition at line 98 of file LArLATOMEDecoder.h.


The documentation for this class was generated from the following files: