ATLAS Offline Software
IROBDataProviderSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef IROBDATAPROVIDERSVC_H
6 #define IROBDATAPROVIDERSVC_H
7 
8 #include "GaudiKernel/IInterface.h"
10 #include "GaudiKernel/EventContext.h"
11 
12 #include <cstdint>
13 #include <vector>
14 #include <string>
15 #include <string_view>
16 #include <stdexcept>
17 #include <functional>
18 
19 // Declaration of the interface ID ( interface id, major version, minor version)
20 //static const InterfaceID IID_IROBDataProviderSvc("IROBDataProviderSvc", 1 , 0);
21 
25 class IROBDataProviderSvc : virtual public IInterface {
26 
27 public:
29  typedef std::vector<const ROBF*> VROBFRAG;
30 
32  // static const InterfaceID& interfaceID() { return IID_IROBDataProviderSvc; }
34 
36  virtual void addROBData(const std::vector<uint32_t>& robIds, const std::string_view callerName="UNKNOWN") = 0 ;
37 
39  virtual void setNextEvent(const std::vector<ROBF>& result) = 0 ;
40 
41 
43  virtual void setNextEvent(const RawEvent* re) = 0 ;
44 
45 
47  virtual void getROBData(const std::vector<uint32_t>& robIds, VROBFRAG& robFragments, const std::string_view callerName="UNKNOWN") = 0;
48 
49 
51  virtual const RawEvent* getEvent() = 0;
52 
53 
55  virtual void setEventStatus(uint32_t status) = 0;
56 
57 
59  virtual uint32_t getEventStatus() = 0;
60 
61 
62  // variants for MT, it has an implementation for now in order not to require change in all implementations yet, they will all become pure virtual methods
63  virtual void addROBData(const EventContext& /*context*/, const std::vector<uint32_t>& /*robIds*/, const std::string_view callerName="UNKNOWN") {
64  throw std::runtime_error( std::string(callerName)+ std::string(" is using unimplemented ") + __FUNCTION__ ) ;
65  }
66  virtual void setNextEvent(const EventContext& /*context*/, const std::vector<ROBF>& /*result*/) {
67  throw std::runtime_error( std::string("Unimplemented ") + __FUNCTION__ );
68  }
69  virtual void setNextEvent( const EventContext& /*context*/, const RawEvent* /*re*/) {
70  throw std::runtime_error(std::string("Unimplemented ") + __FUNCTION__ );
71  }
72  virtual void getROBData(const EventContext& /*context*/, const std::vector<uint32_t>& /*robIds*/, VROBFRAG& /*robFragments*/,
73  const std::string_view callerName="UNKNOWN") {
74  throw std::runtime_error( std::string(callerName)+ std::string(" is using unimplemented ") + __FUNCTION__ ) ;
75  }
76  virtual const RawEvent* getEvent(const EventContext& /*context*/) {
77  throw std::runtime_error(std::string("Unimplemented ") + __FUNCTION__ );
78  }
79  virtual void setEventStatus(const EventContext& /*context*/, uint32_t /*status*/) {
80  throw std::runtime_error(std::string("Unimplemented ") + __FUNCTION__ );
81  }
82  virtual uint32_t getEventStatus(const EventContext& /*context*/) {
83  throw std::runtime_error(std::string("Unimplemented ") + __FUNCTION__ );
84  return 0;
85  }
86 
94  virtual void processCachedROBs(const EventContext& /*context*/,
95  const std::function< void(const ROBF* )>& /*fn*/ ) const {
96  throw std::runtime_error(std::string("Unimplemented ") + __FUNCTION__ );
97  }
98 
100  virtual bool isEventComplete(const EventContext& /*context*/) const {
101  throw std::runtime_error(std::string("Unimplemented ") + __FUNCTION__ );
102  }
103 
107  virtual int collectCompleteEventData(const EventContext& /*context*/, const std::string_view callerName="UNKNOWN") {
108  throw std::runtime_error(std::string(callerName) + std::string(" is using unimplemented ") + __FUNCTION__ );
109  return 0;
110  }
111 
112 };
113 
114 #endif
get_generator_info.result
result
Definition: get_generator_info.py:21
IROBDataProviderSvc::collectCompleteEventData
virtual int collectCompleteEventData(const EventContext &, const std::string_view callerName="UNKNOWN")
Collect all data for an event from the ROS and put them into the cache.
Definition: IROBDataProviderSvc.h:107
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
IROBDataProviderSvc::processCachedROBs
virtual void processCachedROBs(const EventContext &, const std::function< void(const ROBF *)> &) const
Interface to access cache of ROBs (it is a full event in case of offline) In online implementation th...
Definition: IROBDataProviderSvc.h:94
IROBDataProviderSvc::setNextEvent
virtual void setNextEvent(const EventContext &, const RawEvent *)
Definition: IROBDataProviderSvc.h:69
IROBDataProviderSvc::setEventStatus
virtual void setEventStatus(uint32_t status)=0
Store the status for the event.
IROBDataProviderSvc::ROBF
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
Definition: IROBDataProviderSvc.h:28
IROBDataProviderSvc::isEventComplete
virtual bool isEventComplete(const EventContext &) const
Check if complete event data are already in cache.
Definition: IROBDataProviderSvc.h:100
IROBDataProviderSvc::addROBData
virtual void addROBData(const EventContext &, const std::vector< uint32_t > &, const std::string_view callerName="UNKNOWN")
Definition: IROBDataProviderSvc.h:63
IROBDataProviderSvc
Interface class for managing ROB for both online and offline.
Definition: IROBDataProviderSvc.h:25
IROBDataProviderSvc::getROBData
virtual void getROBData(const std::vector< uint32_t > &robIds, VROBFRAG &robFragments, const std::string_view callerName="UNKNOWN")=0
Retrieve ROBFragments for given ROB ids from cache.
IROBDataProviderSvc::setEventStatus
virtual void setEventStatus(const EventContext &, uint32_t)
Definition: IROBDataProviderSvc.h:79
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
IROBDataProviderSvc::setNextEvent
virtual void setNextEvent(const std::vector< ROBF > &result)=0
Add a given LVL1/LVL2 ROBFragment to cache.
RawEvent.h
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition: IROBDataProviderSvc.h:29
IROBDataProviderSvc::setNextEvent
virtual void setNextEvent(const EventContext &, const std::vector< ROBF > &)
Definition: IROBDataProviderSvc.h:66
IROBDataProviderSvc::getROBData
virtual void getROBData(const EventContext &, const std::vector< uint32_t > &, VROBFRAG &, const std::string_view callerName="UNKNOWN")
Definition: IROBDataProviderSvc.h:72
IROBDataProviderSvc::getEvent
virtual const RawEvent * getEvent()=0
Retrieve the whole event.
IROBDataProviderSvc::getEventStatus
virtual uint32_t getEventStatus(const EventContext &)
Definition: IROBDataProviderSvc.h:82
IROBDataProviderSvc::getEventStatus
virtual uint32_t getEventStatus()=0
Retrieve the status for the event.
re
const boost::regex re(r_e)
IROBDataProviderSvc::addROBData
virtual void addROBData(const std::vector< uint32_t > &robIds, const std::string_view callerName="UNKNOWN")=0
Add ROBFragments to cache for given ROB ids, ROB fragments may be retrieved with DataCollector.
merge.status
status
Definition: merge.py:17
IROBDataProviderSvc::getEvent
virtual const RawEvent * getEvent(const EventContext &)
Definition: IROBDataProviderSvc.h:76
IROBDataProviderSvc::setNextEvent
virtual void setNextEvent(const RawEvent *re)=0
Add all ROBFragments of a RawEvent to cache.
IROBDataProviderSvc::DeclareInterfaceID
DeclareInterfaceID(IROBDataProviderSvc, 1, 1)
Retrieve interface ID.