ATLAS Offline Software
ROBDataProviderSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef BYTESTREAMCNVSVCBASE_ROBDATAPROVIDERSVC_H
6 #define BYTESTREAMCNVSVCBASE_ROBDATAPROVIDERSVC_H
7 
30 #include "eformat/SourceIdentifier.h"
33 #include <vector>
34 #include <map>
35 #include <memory>
36 
37 class ROBDataProviderSvc : public extends<AthService, IROBDataProviderSvc> {
38 
39 public:
42 
44  ROBDataProviderSvc(const std::string& name, ISvcLocator* svcloc);
45 
47  virtual StatusCode initialize() override;
48 
50  virtual void addROBData(const EventContext& context, const std::vector<uint32_t>& robIds, const std::string_view callerName="UNKNOWN") override;
51 
53  virtual void setNextEvent(const EventContext& context, const std::vector<OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment>& result) override;
54 
56  virtual void setNextEvent(const EventContext& context, const RawEvent* re) override;
57 
59  virtual void getROBData(const EventContext& context, const std::vector<uint32_t>& robIds, VROBFRAG& robFragments,
60  const std::string_view callerName="UNKNOWN") override;
61 
63  virtual const RawEvent* getEvent(const EventContext& context) override;
64 
66  virtual void setEventStatus(const EventContext& context, uint32_t status) override;
67 
69  virtual uint32_t getEventStatus(const EventContext& context) override;
70 
71  virtual void processCachedROBs(const EventContext& context,
72  const std::function< void(const ROBF* )>& fn ) const override;
73 
74  virtual bool isEventComplete(const EventContext& /*context*/) const override { return true; }
75  virtual int collectCompleteEventData(const EventContext& /*context*/, const std::string_view /*callerName*/ ) override { return 0; }
76 
77 protected:
79  //typedef std::vector<ROBF*> VROBF;
80 
82  typedef std::map<uint32_t, std::unique_ptr<const ROBF>, std::less<uint32_t> > ROBMAP;
83 
84  struct EventCache {
85  const RawEvent* event = 0;
89 
90  };
92 
95  typedef SimpleProperty< std::vector< std::pair<int, int> > > ArrayPairIntProperty;
96  ArrayPairIntProperty m_filterRobWithStatus; // filter with full ROB SourceID
98 
100  typedef std::map<uint32_t, std::vector<uint32_t> > FilterRobMap;
103  typedef std::map<eformat::SubDetector, std::vector<uint32_t> > FilterSubDetMap;
106  bool filterRobWithStatus(const ROBF* rob);
107 
109  BooleanProperty m_filterEmptyROB;
110  bool m_maskL2EFModuleID = false;
111 
112 private:
113  static void robmapClear(ROBMAP& toclear);
114 };
115 
116 #endif
ROBDataProviderSvc::ArrayPairIntProperty
SimpleProperty< std::vector< std::pair< int, int > > > ArrayPairIntProperty
Remaining attributes are for configuration vector of Source ids and status words to be ignored for th...
Definition: ROBDataProviderSvc.h:95
get_generator_info.result
result
Definition: get_generator_info.py:21
ROBDataProviderSvc::setEventStatus
virtual void setEventStatus(const EventContext &context, uint32_t status) override
Store the status for the event.
Definition: ROBDataProviderSvc.cxx:333
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition: RawEvent.h:37
ROBDataProviderSvc::EventCache::robmap
ROBMAP robmap
Definition: ROBDataProviderSvc.h:88
ROBDataProviderSvc::addROBData
virtual void addROBData(const EventContext &context, const std::vector< uint32_t > &robIds, const std::string_view callerName="UNKNOWN") override
Add ROBFragments to cache for given ROB ids, ROB fragments may be retrieved with DataCollector.
Definition: ROBDataProviderSvc.cxx:148
ROBDataProviderSvc::m_filterRobWithStatus
ArrayPairIntProperty m_filterRobWithStatus
Definition: ROBDataProviderSvc.h:96
ROBDataProviderSvc::setNextEvent
virtual void setNextEvent(const EventContext &context, const std::vector< OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment > &result) override
Add a given LVL1/LVL2 ROBFragment to cache.
Definition: ROBDataProviderSvc.cxx:187
ROBDataProviderSvc::FilterSubDetMap
std::map< eformat::SubDetector, std::vector< uint32_t > > FilterSubDetMap
map of Sub Det Source ids and status words to be ignored for the ROB map
Definition: ROBDataProviderSvc.h:103
ROBDataProviderSvc::ROBF
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
ROB Fragment class.
Definition: ROBDataProviderSvc.h:41
ROBDataProviderSvc::m_maskL2EFModuleID
bool m_maskL2EFModuleID
Definition: ROBDataProviderSvc.h:110
ROBDataProviderSvc::initialize
virtual StatusCode initialize() override
initialize the service
Definition: ROBDataProviderSvc.cxx:97
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
python.getCurrentFolderTag.fn
fn
Definition: getCurrentFolderTag.py:65
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
RawEvent.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ROBDataProviderSvc::ROBMAP
std::map< uint32_t, std::unique_ptr< const ROBF >, std::less< uint32_t > > ROBMAP
vector of ROBFragment class
Definition: ROBDataProviderSvc.h:82
ROBDataProviderSvc::getROBData
virtual void getROBData(const EventContext &context, const std::vector< uint32_t > &robIds, VROBFRAG &robFragments, const std::string_view callerName="UNKNOWN") override
Retrieve ROBFragments for given ROB ids from cache.
Definition: ROBDataProviderSvc.cxx:281
ROBDataProviderSvc::FilterRobMap
std::map< uint32_t, std::vector< uint32_t > > FilterRobMap
map of full ROB Source ids and status words to be ignored for the ROB map
Definition: ROBDataProviderSvc.h:100
ROBDataProviderSvc::ROBDataProviderSvc
ROBDataProviderSvc(const std::string &name, ISvcLocator *svcloc)
Constructor.
Definition: ROBDataProviderSvc.cxx:87
ROBDataProviderSvc::EventCache
Definition: ROBDataProviderSvc.h:84
ROBDataProviderSvc::getEventStatus
virtual uint32_t getEventStatus(const EventContext &context) override
Retrieve the status for the event.
Definition: ROBDataProviderSvc.cxx:338
ROBDataProviderSvc::isEventComplete
virtual bool isEventComplete(const EventContext &) const override
Definition: ROBDataProviderSvc.h:74
ROBDataProviderSvc
Definition: ROBDataProviderSvc.h:37
ROBDataProviderSvc::getEvent
virtual const RawEvent * getEvent(const EventContext &context) override
Retrieve the whole event.
Definition: ROBDataProviderSvc.cxx:325
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ROBDataProviderSvc::m_filterEmptyROB
BooleanProperty m_filterEmptyROB
Filter out empty ROB fragments which are send by the ROS.
Definition: ROBDataProviderSvc.h:109
ROBDataProviderSvc::EventCache::eventStatus
uint32_t eventStatus
Definition: ROBDataProviderSvc.h:86
ROBDataProviderSvc::m_filterSubDetMap
FilterSubDetMap m_filterSubDetMap
Definition: ROBDataProviderSvc.h:104
re
const boost::regex re(r_e)
ROBDataProviderSvc::collectCompleteEventData
virtual int collectCompleteEventData(const EventContext &, const std::string_view) override
Definition: ROBDataProviderSvc.h:75
ROBDataProviderSvc::robmapClear
static void robmapClear(ROBMAP &toclear)
Definition: ROBDataProviderSvc.cxx:318
AthService.h
SlotSpecificObj.h
Maintain a set of objects, one per slot.
merge.status
status
Definition: merge.py:17
ROBDataProviderSvc::m_filterRobMap
FilterRobMap m_filterRobMap
Definition: ROBDataProviderSvc.h:101
ROBDataProviderSvc::processCachedROBs
virtual void processCachedROBs(const EventContext &context, const std::function< void(const ROBF *)> &fn) const override
Definition: ROBDataProviderSvc.cxx:342
ROBDataProviderSvc::m_eventsCache
SG::SlotSpecificObj< EventCache > m_eventsCache
Definition: ROBDataProviderSvc.h:91
ROBDataProviderSvc::filterRobWithStatus
bool filterRobWithStatus(const ROBF *rob)
method to filter ROBs with given Status code
Definition: ROBDataProviderSvc.cxx:353
IROBDataProviderSvc.h
ROBDataProviderSvc::EventCache::currentLvl1ID
uint32_t currentLvl1ID
Definition: ROBDataProviderSvc.h:87
ROBDataProviderSvc::m_filterSubDetWithStatus
ArrayPairIntProperty m_filterSubDetWithStatus
Definition: ROBDataProviderSvc.h:97