ATLAS Offline Software
Loading...
Searching...
No Matches
ByteStreamEmonInputSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef BYTESTREAMCNVSVC_BYTESTREAMEVENTSTORAGEINPUTSVC_H
6#define BYTESTREAMCNVSVC_BYTESTREAMEVENTSTORAGEINPUTSVC_H
7
14
15// Include files.
16#define BOOST_BIND_GLOBAL_PLACEHOLDERS // Needed to silence Boost pragma message
17#include "emon/EventIterator.h"
18
19#include "TrigConfData/L1Menu.h"
20
25#include "GaudiKernel/ServiceHandle.h"
26#include "GaudiKernel/ITHistSvc.h"
27
28#include <vector>
29#include <stdint.h>
30#include <memory>
31
32#include <boost/regex.hpp>
33
34class OHRootProvider;
35class StoreGateSvc;
36
37class ByteStreamEmonInputSvc: public extends<AthService, IByteStreamInputSvc> {
38public:
39
41 ByteStreamEmonInputSvc(const std::string& name, ISvcLocator* svcloc);
42
43 virtual StatusCode initialize() override;
44 virtual StatusCode start() override;
45 virtual StatusCode finalize() override;
46
48 virtual const RawEvent* previousEvent() override;
49 virtual const RawEvent* nextEvent() override;
50
52 virtual const RawEvent* currentEvent() const override;
53
54private:
55
56 bool getIterator();
57 void check_publish();
58 void get_runparams();
59
60 void updateHandler(Gaudi::Details::PropertyBase& p);
61
63
64 std::unique_ptr<RawEvent> m_re{nullptr};
65
66 // Properties
67 Gaudi::Property<std::string> m_partition{this, "Partition", {}, "Partition name, default taken from $TDAQ_PARTITION if not set"};
68 Gaudi::Property<std::string> m_key{this, "Key", {}, &ByteStreamEmonInputSvc::updateHandler, "EMON Selection key, e.g. SFI"};
69 Gaudi::Property<std::vector<std::string>> m_value{this, "KeyValue", {}, &ByteStreamEmonInputSvc::updateHandler, "EMON key values, e.g. [SFI-1, SFI-2]; if empty all SFIs"};
70 Gaudi::Property<unsigned int> m_key_count{this, "KeyCount", 0, &ByteStreamEmonInputSvc::updateHandler, "EMON key count, e.g. 5 to get five random SFIs"};
71 Gaudi::Property<std::string> m_publish{this, "PublishName", "Athena", &ByteStreamEmonInputSvc::updateHandler, "Name under which to publish histograms"};
72 Gaudi::Property<bool> m_exit {this, "ExitOnPartitionShutdown", false, &ByteStreamEmonInputSvc::updateHandler, "If true, exit if partition shuts down"};
73 Gaudi::Property<std::string> m_is_server{this, "ISServer", "", &ByteStreamEmonInputSvc::updateHandler, "IS Server to publish histograms to"};
74 Gaudi::Property<std::string> m_include{this, "Include", {}, &ByteStreamEmonInputSvc::updateHandler, "Regular expression to select histograms to publish"};
75 Gaudi::Property<std::string> m_exclude{this, "Exclude", {}, &ByteStreamEmonInputSvc::updateHandler, "Regular expression to select histograms not to publish"};
76 Gaudi::Property<int> m_frequency{this, "Frequency", 60, &ByteStreamEmonInputSvc::updateHandler, "Frequency (in number of events) of publishing histograms"};
77 Gaudi::Property<int> m_updatePeriod{this, "UpdatePeriod", 0, &ByteStreamEmonInputSvc::updateHandler, "Frequency (in seconds) of publishing histograms"};
78 Gaudi::Property<float> m_updatePeriodRange{this, "UpdatePeriodRange", 0.2, "A percentage number to determine how close we have to be to the next update time to publish now"};
79 Gaudi::Property<bool> m_clearHistograms{this, "ClearHistograms", true, &ByteStreamEmonInputSvc::updateHandler, "If true, clear histograms when new run starts (default: True)"};
80 Gaudi::Property<std::vector<std::string>> m_l1names{this, "LVL1Names", {}, &ByteStreamEmonInputSvc::updateHandler, "A list of L1 bit names"};
81 Gaudi::Property<std::vector<unsigned int>> m_l1items{this, "LVL1Items", {}, &ByteStreamEmonInputSvc::updateHandler, "A list of L1 bit numbers"};
82 Gaudi::Property<std::string> m_l1logic{this, "LVL1Logic", "Ignore", &ByteStreamEmonInputSvc::updateHandler, "'And', 'Or' or 'Ignore' (default: Ignore)"};
83 Gaudi::Property<std::string> m_l1origin{this, "LVL1Origin", "TAV", &ByteStreamEmonInputSvc::updateHandler, "TBP, TAP, TAV (default: TAV"};
84 Gaudi::Property<std::string> m_stream_type{this, "StreamType", "physics", &ByteStreamEmonInputSvc::updateHandler, "HLT stream type (e.g. physics or calibration)"};
85 Gaudi::Property<std::vector<std::string>> m_stream_names{this, "StreamNames", {}, &ByteStreamEmonInputSvc::updateHandler, "List of HLT stream names"};
86 Gaudi::Property<std::string> m_stream_logic{this, "StreamLogic", "Ignore", &ByteStreamEmonInputSvc::updateHandler, "'And', 'Or' or 'Ignore' (default: Ignore)"};
87
88 Gaudi::Property<unsigned int> m_trigger_type{this, "TriggerType", 256, &ByteStreamEmonInputSvc::updateHandler, "LVL1 8 bit trigger type"};
89 Gaudi::Property<std::string> m_groupName{this, "GroupName", {}, &ByteStreamEmonInputSvc::updateHandler, "Name of the monitoring group"};
90 Gaudi::Property<unsigned int> m_buffer_size{this, "BufferSize", 2, "Number of buffers"};
91 Gaudi::Property<bool> m_readDetectorMask{this, "ReadDetectorMaskFromIS", true, "Read detector mask from IS"};
92 Gaudi::Property<int> m_timeout{this, "Timeout", 3600000, &ByteStreamEmonInputSvc::updateHandler, "Timeout in seconds, -1 == infinity"};
93 Gaudi::Property<bool> m_corrupted_events{this, "ProcessCorruptedEvents", false, &ByteStreamEmonInputSvc::updateHandler, "Process corrupted events not passing check_tree()"};
94 Gaudi::Property<std::string> m_state{this, "State", "None", "Read-only property showing the state"};
95 Gaudi::Property<bool> m_convertEfficiency{this, "ConvertEfficiency", true, "Convert TEfficiency to TProfile before publishing"};
96
97 // Data handles
98 SG::ReadHandleKey<TrigConf::L1Menu> m_l1MenuKey{this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "Name of the L1Menu object to read configuration from"};
99
100 // internal
101 bool m_connect{false};
102 std::auto_ptr<emon::EventIterator> m_eventIt;
103
104 OHRootProvider* m_provider{nullptr};
105
106 boost::regex m_include_rex;
107 boost::regex m_exclude_rex;
108
111
116};
117
118#endif
This file contains the interface for the ByteStreamInputSvc classes.
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition RawEvent.h:37
void updateHandler(Gaudi::Details::PropertyBase &p)
Gaudi::Property< int > m_timeout
Gaudi::Property< std::vector< unsigned int > > m_l1items
Gaudi::Property< unsigned int > m_key_count
Gaudi::Property< bool > m_convertEfficiency
Gaudi::Property< std::string > m_groupName
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_stream_type
virtual const RawEvent * currentEvent() const override
Implementation of the ByteStreamInputSvc interface methods.
Gaudi::Property< std::string > m_stream_logic
virtual const RawEvent * previousEvent() override
Implementation of the ByteStreamInputSvc interface methods.
Gaudi::Property< std::string > m_l1logic
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
Gaudi::Property< bool > m_clearHistograms
ServiceHandle< IROBDataProviderSvc > m_robProvider
Gaudi::Property< bool > m_exit
Gaudi::Property< bool > m_corrupted_events
Gaudi::Property< std::vector< std::string > > m_stream_names
Gaudi::Property< std::string > m_key
Gaudi::Property< std::vector< std::string > > m_l1names
Gaudi::Property< bool > m_readDetectorMask
int m_totalEventCounter
event Counter
Gaudi::Property< std::string > m_l1origin
virtual StatusCode finalize() override
Gaudi::Property< std::vector< std::string > > m_value
Gaudi::Property< std::string > m_is_server
virtual StatusCode start() override
std::auto_ptr< emon::EventIterator > m_eventIt
Event iterator.
Gaudi::Property< unsigned int > m_trigger_type
Gaudi::Property< std::string > m_exclude
Gaudi::Property< std::string > m_partition
Gaudi::Property< int > m_updatePeriod
ServiceHandle< StoreGateSvc > m_inputMetaDataStore
Gaudi::Property< float > m_updatePeriodRange
ByteStreamEmonInputSvc(const std::string &name, ISvcLocator *svcloc)
Constructors:
std::unique_ptr< RawEvent > m_re
current event
Gaudi::Property< std::string > m_state
ServiceHandle< StoreGateSvc > m_sgSvc
Gaudi::Property< std::string > m_include
Gaudi::Property< std::string > m_publish
Gaudi::Property< unsigned int > m_buffer_size
Gaudi::Property< int > m_frequency
ServiceHandle< ITHistSvc > m_histSvc
virtual const RawEvent * nextEvent() override
Property holding a SG store/key/clid from which a ReadHandle is made.
The Athena Transient Store API.