ATLAS Offline Software
xAODTrigDecisionRetriever.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <string>
8 
9 #include "CLHEP/Units/SystemOfUnits.h"
10 
11 // references:
12 // Event/xAOD/xAODTrigger/trunk/Root/TrigDecision_v1.cxx
13 // Event/xAOD/xAODTrigger/trunk/Root/TrigDecisionAuxInfo_v1.cxx
15 
16 namespace JiveXML {
17 
18  //--------------------------------------------------------------------------
19 
20  xAODTrigDecisionRetriever::xAODTrigDecisionRetriever(const std::string& type, const std::string& name, const IInterface* parent):
21  AthAlgTool(type, name, parent), m_typeName("TrigDecision_xAOD")
22  {
23 
24  declareInterface<IDataRetriever>(this);
25  }
26 
27  //--------------------------------------------------------------------------
28 
29  StatusCode xAODTrigDecisionRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
30 
31  DataVect test;
32 
33  const xAOD::TrigDecision* trigDec = 0;
34 
35  m_sgKey = "xTrigDecision"; //sgKey from 20.0.0.2 AOD
36  if ( evtStore()->retrieve(trigDec,m_sgKey).isFailure() ) {
37  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No xAOD::xTrigDecision found in SG " << endmsg;
38  return StatusCode::SUCCESS;
39  }
40  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Found xAOD::xTrigDecision in SG ! " << endmsg;
41 
42  DataVect smk;
44  DataVect tav;
45  DataVect tap;
46  DataVect tbp;
47 
48  smk.push_back(DataType( trigDec->smk() ));
52 /*
53  bgCode.push_back(DataType( trigDec->bgCode() ));
54  tav.push_back(DataType( trigDec->tav() ));
55  tap.push_back(DataType( trigDec->tap() ));
56  tbp.push_back(DataType( trigDec->tbp() ));
57 */
58  DataMap myDataMap;
59 /*
60  myDataMap["smk"] = smk;
61  myDataMap["bgCode"] = bgCode;
62  myDataMap["tav"] = tav;
63  myDataMap["tap"] = tap;
64  myDataMap["tbp"] = tbp;
65 */
66  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << ": "
67  << " SMK: " << trigDec->smk()
68  << " BGCODE: " << trigDec->bgCode()
69  << " TAV: " << trigDec->tav()
70  << " TAP: " << trigDec->tap()
71  << " TBP: " << trigDec->tbp()
72  << " from: " << m_sgKey << endmsg;
73 
75  //return 0;
77  return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap);
78  }
79 }
xAODTrigDecisionRetriever.h
TrigDecision.h
RunEBWeightsComputation.smk
smk
Definition: RunEBWeightsComputation.py:87
xAOD::bgCode
bgCode
Definition: TrigDecision_v1.cxx:39
JiveXML::xAODTrigDecisionRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition: xAODTrigDecisionRetriever.cxx:29
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
xAOD::TrigDecision_v1::tav
const std::vector< uint32_t > & tav() const
Get the Trigger After Veto bits.
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:144
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
xAOD::tap
setBGCode tap
Definition: TrigDecision_v1.cxx:43
JiveXML::xAODTrigDecisionRetriever::m_sgKey
std::string m_sgKey
Definition: xAODTrigDecisionRetriever.h:50
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
JiveXML::xAODTrigDecisionRetriever::xAODTrigDecisionRetriever
xAODTrigDecisionRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition: xAODTrigDecisionRetriever.cxx:20
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
JiveXML::xAODTrigDecisionRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition: xAODTrigDecisionRetriever.h:43
test_pyathena.parent
parent
Definition: test_pyathena.py:15
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
xAOD::TrigDecision_v1::smk
uint32_t smk() const
Get the Super Master Key describing this object.
xAOD::TrigDecision_v1::tap
const std::vector< uint32_t > & tap() const
Get the Trigger After Prescale bits.
xAOD::TrigDecision_v1::bgCode
char bgCode() const
Get the bunch group code of the current event.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
xAOD::TrigDecision_v1::tbp
const std::vector< uint32_t > & tbp() const
Get the Trigger Before Prescale bits.
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::TrigDecision_v1
Interface to the raw trigger decision information of the event.
Definition: TrigDecision_v1.h:44