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 58 of file LArLATOMEDecoder.h.

Member Typedef Documentation

◆ NumLATOME

Definition at line 66 of file LArLATOMEDecoder.h.

◆ NumWord

Definition at line 62 of file LArLATOMEDecoder.h.

◆ Packet

Definition at line 63 of file LArLATOMEDecoder.h.

◆ Path

typedef std::string LArLATOMEDecoder::Path

Definition at line 67 of file LArLATOMEDecoder.h.

◆ Sample

Definition at line 65 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 64 of file LArLATOMEDecoder.h.

◆ Word

typedef unsigned int LArLATOMEDecoder::Word

Definition at line 61 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 39 of file LArLATOMEDecoder.cxx.

40 : AthAlgTool(type, name, parent), m_sc2ccMappingTool("CaloSuperCellIDTool") {
41 declareInterface<LArLATOMEDecoder>(this);
42}
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 58 of file LArLATOMEDecoder.cxx.

60 {
61
62 if(!re) return StatusCode::FAILURE;;
63 bool ret = false;
64 // Check fragment validity:
65 try {
66 ret = re->check();
67 } catch (eformat::Issue& ex) {
68 ATH_MSG_WARNING("Exception while checking eformat fragment validity: " << ex.what());
69 ret = false;
70 }
71 if (!ret) {
72 ATH_MSG_ERROR("Got invalid RawEvent fragment");
73 return StatusCode::FAILURE;
74 }
75 // Build TOC
76 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > robIndex;
77 eformat::helper::build_toc(*re, robIndex);
78 for (const auto& mapit : robIndex)
79 ATH_MSG_DEBUG("Rob Index subdetgroup is " << std::hex << mapit.first);
80 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> >::const_iterator robIt = robIndex.find(eformat::LAR);
81 if (robIt != robIndex.end()) {
82 const std::vector<const uint32_t*>& robs = robIt->second;
83 for (const uint32_t* pRob : robs) {
84 try {
85 ROBFragment robFrag(pRob);
87 uint32_t latomeSourceID = robFrag.rod_source_id();
88 if (!(latomeSourceID & 0x1000)) {
89 ATH_MSG_DEBUG(" discarding non latome source ID " << std::hex << latomeSourceID);
90 continue;
91 }
92 ATH_MSG_DEBUG(" found latome source ID " << std::hex << latomeSourceID);
93 }
94 EventProcess ev(this, 0, 0, 0, 0, accdigits, caccdigits, header_coll);
95 ev.fillCollection(&robFrag, map, onoffmap, clmap);
96 } catch (eformat::Issue& ex) {
97 ATH_MSG_WARNING(" exception thrown by ROBFragment, badly corrupted event. Abort decoding ");
98 if (accdigits)
99 accdigits->clear();
100 if (caccdigits)
101 caccdigits->clear();
102 if (header_coll)
103 header_coll->clear();
104 break;
105 }
106 } // end loop over robs
107 } // end if got LAr-RODs
108
109 return StatusCode::SUCCESS;
110}
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 112 of file LArLATOMEDecoder.cxx.

114 {
115
116 // Check fragment validity:
117 // Build TOC
118 if (robFrags.size() > 0) {
119 for (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* pRob : robFrags) {
120 try {
121 if (m_protectSourceId) {
122 uint32_t latomeSourceID = pRob->rod_source_id();
123 if (!(latomeSourceID & 0x1000)) {
124 ATH_MSG_DEBUG(" discarding non latome source ID " << std::hex << latomeSourceID);
125 continue;
126 }
127 ATH_MSG_DEBUG(" found latome source ID " << std::hex << latomeSourceID);
128 }
129 EventProcess ev(this, adc_coll, adc_bas_coll, et_coll, et_id_coll, 0, 0, header_coll);
130 ev.fillCollection(pRob, map, nullptr, nullptr);
131 } catch (eformat::Issue& ex) {
132 ATH_MSG_WARNING(" exception thrown by ROBFragment, badly corrupted event. Abort decoding ");
133 if (adc_coll)
134 adc_coll->clear();
135 if (adc_bas_coll)
136 adc_bas_coll->clear();
137 if (et_coll)
138 et_coll->clear();
139 if (et_id_coll)
140 et_id_coll->clear();
141 if (header_coll)
142 header_coll->clear();
143 break;
144 }
145 } // end loop over robs
146 } // end if got LAr-RODs
147 return StatusCode::SUCCESS;
148}

◆ 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 77 of file LArLATOMEDecoder.h.

77{return StatusCode::SUCCESS;};

◆ initialize()

StatusCode LArLATOMEDecoder::initialize ( )
virtual

Initialize the converter.

Definition at line 48 of file LArLATOMEDecoder.cxx.

48 {
49
50 ATH_CHECK(detStore()->retrieve(m_onlineId, "LArOnline_SuperCellID"));
51
52 ATH_CHECK(m_sc2ccMappingTool.retrieve());
53 ATH_CHECK(m_cablingKeySC.initialize());
54
55 return StatusCode::SUCCESS;
56}
#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

◆ 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 44 of file LArLATOMEDecoder.cxx.

44 {
46}
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 259 of file LArLATOMEDecoder.h.

259{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 255 of file LArLATOMEDecoder.h.

255{this, "IgnoreBarrelChannels", false};

◆ m_ignoreEndcapChannels

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

Definition at line 256 of file LArLATOMEDecoder.h.

256{this, "IgnoreEndcapChannels", false};

◆ m_keepPulsed

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

Definition at line 258 of file LArLATOMEDecoder.h.

258{this, "KeepOnlyPulsed", true};

◆ m_onlineId

const LArOnline_SuperCellID* LArLATOMEDecoder::m_onlineId {}
private

Definition at line 252 of file LArLATOMEDecoder.h.

252{};

◆ 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 257 of file LArLATOMEDecoder.h.

257{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 253 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 95 of file LArLATOMEDecoder.h.


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