ATLAS Offline Software
Loading...
Searching...
No Matches
JiveXML::TriggerInfoRetriever Class Reference

#include <TriggerInfoRetriever.h>

Inheritance diagram for JiveXML::TriggerInfoRetriever:
Collaboration diagram for JiveXML::TriggerInfoRetriever:

Public Member Functions

 TriggerInfoRetriever (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor.
virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool)
 Retrieve all the data.
virtual std::string dataTypeName () const
 Return the name of the data type.
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 ()
 Return the interface identifier.

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 std::string m_typeName
 The data type that is generated by this retriever.
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

Detailed Description

Definition at line 17 of file TriggerInfoRetriever.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TriggerInfoRetriever()

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

Standard Constructor.

Definition at line 22 of file TriggerInfoRetriever.cxx.

22 :
23 AthAlgTool(type, name, parent),
24 m_typeName("TriggerInfo")
25 {
26
27 declareInterface<IDataRetriever>(this);
28 }
AthAlgTool()
Default constructor:
const std::string m_typeName
The data type that is generated by this retriever.

Member Function Documentation

◆ dataTypeName()

virtual std::string JiveXML::TriggerInfoRetriever::dataTypeName ( ) const
inlinevirtual

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 28 of file TriggerInfoRetriever.h.

28{ return m_typeName; };

◆ 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

◆ 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 & JiveXML::IDataRetriever::interfaceID ( )
inlinestaticinherited

Return the interface identifier.

Definition at line 40 of file IDataRetriever.h.

40{ return IID_IDataRetriever; }
static const InterfaceID IID_IDataRetriever("JiveXML::IDataRetriever", 3, 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 }

◆ retrieve()

StatusCode JiveXML::TriggerInfoRetriever::retrieve ( ToolHandle< IFormatTool > & FormatTool)
virtual

Retrieve all the data.

Implements JiveXML::IDataRetriever.

Definition at line 32 of file TriggerInfoRetriever.cxx.

32 {
33
34// retrieve TriggerInfo
35 const EventInfo* eventInfo = nullptr;
36 const TriggerInfo* trigger_info = nullptr;
37
38 if ( evtStore()->retrieve(eventInfo).isFailure() ) {
39 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No EventInfo found in SG" << endmsg;
40 return StatusCode::SUCCESS;
41 }
42 trigger_info = eventInfo->trigger_info();
43 if (trigger_info == 0){
44 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No TriggerInfo in EventInfo" << endmsg;
45 return StatusCode::SUCCESS;
46 }
47 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Retrieved EventInfo and TriggerInfo" << endmsg;
48
49 std::string triggerInfoStrL1="0";
50 std::string triggerInfoStrL2="0";
51 std::string triggerInfoStrEF="0";
52 std::string triggerInfoStreamTag="0";
53
54// Level-1 Missing-ET from LVL1_ROI:
55 DataVect energySumEtVec;
56 DataVect energyExVec;
57 DataVect energyEyVec;
58 DataVect energyEtMissVec;
59
60// TriggerInfo from EventInfo:
61 DataVect trigInfoStatusVec;
62 DataVect trigInfoExtL1IDVec;
63 DataVect trigInfoLvl1TypeVec;
64 DataVect trigInfoL1Vec;
65 DataVect trigInfoL2Vec;
66 DataVect trigInfoEFVec;
67 DataVect trigInfoStreamTagVec;
68
69// from: AtlasTest/DatabaseTest/AthenaPoolTest/AthenaPoolTestDataReader
70
71 trigInfoStatusVec.push_back(DataType( trigger_info->statusElement() ) );
72 trigInfoExtL1IDVec.push_back(DataType( trigger_info->extendedLevel1ID() ) );
73 trigInfoLvl1TypeVec.push_back(DataType( trigger_info->level1TriggerType() ) );
74 if ( trigger_info->level1TriggerInfo().size() > 0 ){
75 triggerInfoStrL1 = "-"; // item seperator
76 }
77 for (unsigned int i = 0; i < trigger_info->level1TriggerInfo().size(); ++i) {
78 triggerInfoStrL1 += DataType( trigger_info->level1TriggerInfo()[i]).toString() + "-";
79 }
80
81 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " lvl2Info " << endmsg;
82 if ( trigger_info->level2TriggerInfo().size() > 0 ){
83 triggerInfoStrL2 = "-"; // item seperator
84 }
85 for (unsigned int i = 0; i < trigger_info->level2TriggerInfo().size(); ++i) {
86 triggerInfoStrL2 += DataType( trigger_info->level2TriggerInfo()[i] ).toString() + "-";
87 }
88
89 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "EventFilterInfo " << endmsg;
90 if ( trigger_info->eventFilterInfo().size() > 0 ){
91 triggerInfoStrEF = "-"; // item seperator
92 }
93 for (unsigned int i = 0; i < trigger_info->eventFilterInfo().size(); ++i) {
94 triggerInfoStrEF += DataType( trigger_info->eventFilterInfo()[i]).toString() + "-";
95 }
96
97 if ( trigger_info->streamTags().size() > 0 ){
98 triggerInfoStreamTag = "-"; // item seperator
99 }
100 for (unsigned int i = 0; i < trigger_info->streamTags().size(); ++i) {
101 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " i " << i << " name " << trigger_info->streamTags()[i].name()
102 << " type " << trigger_info->streamTags()[i].type()
103 << " ObeysLumi " << trigger_info->streamTags()[i].obeysLumiblock();
105 triggerInfoStreamTag += trigger_info->streamTags()[i].name() + "_" +
106 trigger_info->streamTags()[i].type() + "_";
107 if ( trigger_info->streamTags()[i].obeysLumiblock() ){ // is a boolean
108 triggerInfoStreamTag += "ObeysLumi";
109 }else{
110 triggerInfoStreamTag += "notObeysLumi";
111 }
112 if ( eventInfo->event_ID()->lumi_block() ){
113 triggerInfoStreamTag += "_lumiBlock";
114 triggerInfoStreamTag += DataType(eventInfo->event_ID()->lumi_block()).toString();
115 }else{
116 triggerInfoStreamTag += "_lumiBlockUnknown";
117 }
118 triggerInfoStreamTag += "-";
119 }
120
121 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "trigInfoL1: " << triggerInfoStrL1 << endmsg;
122 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "trigInfoL2: " << triggerInfoStrL2 << endmsg;
123 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "trigInfoEF: " << triggerInfoStrEF << endmsg;
124 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "triggerInfoStreamTag: " << triggerInfoStreamTag << endmsg;
125
126 trigInfoL1Vec.emplace_back(std::move(triggerInfoStrL1));
127 trigInfoL2Vec.emplace_back(std::move(triggerInfoStrL2 ));
128 trigInfoEFVec.emplace_back(std::move( triggerInfoStrEF ));
129 trigInfoStreamTagVec.emplace_back(std::move( triggerInfoStreamTag ));
130
131 // Retrieve LVL1_ROI for trigger energies
132 // assume that eventInfo->triggerInfo _has_ to be present,
133 // but LVL1_ROI not present under all circumstances (ACR: muoncomm)
134 // Don't exit upon failed SG retrieval as usual.
135
136 const LVL1_ROI * roi;
137 if ( evtStore()->retrieve(roi,"LVL1_ROI").isFailure() ) {
138 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No LVL1_ROI for Trigger-MissingET found in SG, setting placeholders." << endmsg;
139 // placeholders:
140 energySumEtVec.push_back(DataType( -1. ) ); // means n/a
141 energyExVec.push_back(DataType( -1. ) );
142 energyEyVec.push_back(DataType( -1. ) );
143 energyEtMissVec.push_back(DataType( -1. ) );
144 }else{
145 if ( (roi->getEnergySumROIs()).size() != 0 ){ // catch empty container
146 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TriggerInfo: LVL1_ROI for EnergySum retrieved" << endmsg;
147
148 LVL1_ROI::energysums_type::const_iterator itES = (roi->getEnergySumROIs()).begin();
149 LVL1_ROI::energysums_type::const_iterator itESe = (roi->getEnergySumROIs()).end();
150 for (; itES != itESe; ++itES){
151 float Et = itES->getEnergyT()/CLHEP::GeV;
152 float Ex = itES->getEnergyX()/CLHEP::GeV;
153 float Ey = itES->getEnergyY()/CLHEP::GeV;
154 energySumEtVec.push_back(DataType( Et ) );
155 energyExVec.push_back(DataType( Ex ) );
156 energyEyVec.push_back(DataType( Ey ) );
157 float EtMiss = static_cast<long>(sqrt(static_cast<double>(Ex*Ex + Ey*Ey)));
158 energyEtMissVec.push_back(DataType( EtMiss ) );
159
160 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "EnergySum from LVL1_ROI: X:" << Ex << ", Y:"
161 << Ey << ", T:" << Et << ", ETMiss:" << EtMiss << endmsg;
162 }
163 }else{ // empty container
164 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TriggerInfo: LVL1_ROI for EnergySum empty !" << endmsg;
165
166 energySumEtVec.push_back(DataType( "-1" ) ); // means n/a
167 energyExVec.push_back(DataType( "-1" ) );
168 energyEyVec.push_back(DataType( "-1" ) );
169 energyEtMissVec.push_back(DataType( "-1" ) );
170 }
171 } // LVL1_ROI available ?
172
173 DataMap myDataMap;
174 const int nEntries = trigInfoStatusVec.size();
175 myDataMap["energySumEt"] = std::move(energySumEtVec);
176 myDataMap["energyEx"] = std::move(energyExVec);
177 myDataMap["energyEy"] = std::move(energyEyVec);
178 myDataMap["energyEtMiss"] = std::move(energyEtMissVec);
179 myDataMap["trigInfoStatus"] = std::move(trigInfoStatusVec);
180 myDataMap["trigInfoExtL1ID"] = std::move(trigInfoExtL1IDVec);
181 myDataMap["trigInfoLvl1Type"] = std::move(trigInfoLvl1TypeVec);
182 myDataMap["trigInfoL1"] = std::move(trigInfoL1Vec);
183 myDataMap["trigInfoL2"] = std::move(trigInfoL2Vec);
184 myDataMap["trigInfoEF"] = std::move(trigInfoEFVec);
185 myDataMap["trigInfoStreamTag"] = std::move(trigInfoStreamTagVec);
186
187 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << ": "<< nEntries << endmsg;
188
189 //forward data to formating tool
190 std::string emptyStr=""; // eventInfo has no SGKey
191 return FormatTool->AddToEvent(dataTypeName(), emptyStr, &myDataMap);
192 }
#define endmsg
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
ServiceHandle< StoreGateSvc > & evtStore()
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
EventID * event_ID()
the unique identification of the event.
TriggerInfo * trigger_info()
trigger information (ptr may be NULL)
virtual std::string dataTypeName() const
Return the name of the data type.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
const energysums_type & getEnergySumROIs() const
Get all the energy sum RoIs in the event.
Definition LVL1_ROI.h:71
number_type level1TriggerType() const
get level1 trigger type
const std::vector< number_type > & eventFilterInfo() const
get event filter trigger info
number_type extendedLevel1ID() const
get extended level1 ID
number_type statusElement() const
get status element
const std::vector< number_type > & level1TriggerInfo() const
get level1 trigger info
const std::vector< StreamTag > & streamTags() const
get stream tags
const std::vector< number_type > & level2TriggerInfo() const
get level2 trigger info
std::map< std::string, DataVect > DataMap
Definition DataType.h:59
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition DataType.h:58
EventInfo_v1 EventInfo
Definition of the latest event info version.

◆ 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_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_typeName

const std::string JiveXML::TriggerInfoRetriever::m_typeName
private

The data type that is generated by this retriever.

Definition at line 33 of file TriggerInfoRetriever.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.


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