ATLAS Offline Software
Static Public Member Functions | List of all members
JetStoreHelper Struct Reference

#include <JetStoreHelper.h>

Collaboration diagram for JetStoreHelper:

Static Public Member Functions

static bool getStoreGate (StoreGateSvc *&pSG)
 
template<class STORE >
static bool recordStore (STORE *store, const std::string &key)
 
template<class STORE >
static bool retrieveStore (STORE *&store, const std::string &key, const std::string &msg)
 
template<class STORE >
static bool retrieveStore (STORE *&store, const std::string &key, MsgStream &report)
 
static void stringFilter (std::string &str)
 

Detailed Description

Definition at line 19 of file JetStoreHelper.h.

Member Function Documentation

◆ getStoreGate()

static bool JetStoreHelper::getStoreGate ( StoreGateSvc *&  pSG)
inlinestatic

Definition at line 22 of file JetStoreHelper.h.

23  {
24  return (Gaudi::svcLocator()->service("StoreGate",pSG)).isSuccess();
25  }

◆ recordStore()

template<class STORE >
static bool JetStoreHelper::recordStore ( STORE *  store,
const std::string &  key 
)
inlinestatic

Definition at line 28 of file JetStoreHelper.h.

29  {
30  StoreGateSvc* pSG = 0;
31  return getStoreGate(pSG)
32  ? (pSG->record(store,key)).isSuccess()
33  : false;
34  }

◆ retrieveStore() [1/2]

template<class STORE >
static bool JetStoreHelper::retrieveStore ( STORE *&  store,
const std::string &  key,
const std::string &  msg 
)
inlinestatic

Definition at line 37 of file JetStoreHelper.h.

39  {
40  IMessageSvc* msgSvc = 0;
41  if ( (Gaudi::svcLocator()->service("MessageSvc",msgSvc)).isFailure() )
42  return false;
43  MsgStream report(msgSvc,msg);
44  return retrieveStore(store,key,report);
45  }

◆ retrieveStore() [2/2]

template<class STORE >
static bool JetStoreHelper::retrieveStore ( STORE *&  store,
const std::string &  key,
MsgStream &  report 
)
inlinestatic

Definition at line 48 of file JetStoreHelper.h.

50  {
51  // allocate StoreGate service
52  StoreGateSvc* pSG = 0;
53  if ( (Gaudi::svcLocator()->service("StoreGate",pSG)).isFailure() )
54  {
55  report << MSG::WARNING
56  << "cannot retrieve StoreGate service"
57  << endmsg;
58  return false;
59  }
60  //
61  if ( (pSG->retrieve(store,key)).isFailure() )
62  {
63  std::string tStr(typeid(store).name()); stringFilter(tStr);
64  report << MSG::WARNING
65  << "cannot retrieve store type \042"
66  << tStr << "\042 with key <"
67  << key << ">" << endmsg;
68  return false;
69  }
70  //
71  return true;
72  }

◆ stringFilter()

static void JetStoreHelper::stringFilter ( std::string &  str)
inlinestatic

Definition at line 74 of file JetStoreHelper.h.

75  {
76  std::string::iterator fStr(str.begin());
77  while ( fStr != str.end() )
78  {
79  if ( *fStr >= '0' && *fStr <= '9' )
80  {
81  fStr = str.erase(fStr);
82  }
83  else
84  {
85  ++fStr;
86  }
87  }
88  }

The documentation for this struct was generated from the following file:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
StoreGateSvc::record
StatusCode record(T *p2BRegistered, const TKEY &key)
Record an object with a key.
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
JetStoreHelper::getStoreGate
static bool getStoreGate(StoreGateSvc *&pSG)
Definition: JetStoreHelper.h:22
checkTP.report
report
Definition: checkTP.py:127
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
JetStoreHelper::retrieveStore
static bool retrieveStore(STORE *&store, const std::string &key, const std::string &msg)
Definition: JetStoreHelper.h:37
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
str
Definition: BTagTrackIpAccessor.cxx:11
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
JetStoreHelper::stringFilter
static void stringFilter(std::string &str)
Definition: JetStoreHelper.h:74
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37