The Gaudi Framework  v30r3 (a5ef0a68)
Gaudi::RootConnectionSetup Class Referencefinal

#include <RootCnv/RootDataConnection.h>

Collaboration diagram for Gaudi::RootConnectionSetup:

Public Types

typedef std::vector< std::stringStringVec
 Type definition for string maps. More...
 

Public Member Functions

 RootConnectionSetup ()=default
 Standard constructor. More...
 
void setMessageSvc (MsgStream *m)
 Set message service reference. More...
 
MsgStreammsgSvc () const
 Retrieve message service. More...
 
void setIncidentSvc (IIncidentSvc *m)
 Set incident service reference. More...
 
IIncidentSvcincidentSvc () const
 Retrieve incident service. More...
 

Static Public Member Functions

static StatusCode setCompression (boost::string_ref compression)
 Set the global compression level. More...
 
static int compression ()
 Access to global compression level. More...
 

Public Attributes

StringVec cacheBranches
 Vector of strings with branches to be cached for input files. More...
 
StringVec vetoBranches
 Vector of strings with branches to NOT be cached for input files. More...
 
std::string loadSection
 RootCnvSvc Property: Root data cache size. More...
 
int cacheSize
 RootCnvSvc Property: Root data cache size. More...
 
int learnEntries
 RootCnvSvc Property: ROOT cache learn entries. More...
 

Private Attributes

std::unique_ptr< MsgStreamm_msgSvc
 Reference to message service. More...
 
SmartIF< IIncidentSvcm_incidentSvc = nullptr
 Reference to incident service. More...
 

Detailed Description

Definition at line 45 of file RootDataConnection.h.

Member Typedef Documentation

typedef std::vector<std::string> Gaudi::RootConnectionSetup::StringVec

Type definition for string maps.

Definition at line 55 of file RootDataConnection.h.

Constructor & Destructor Documentation

Gaudi::RootConnectionSetup::RootConnectionSetup ( )
default

Standard constructor.

Member Function Documentation

int RootConnectionSetup::compression ( )
static

Access to global compression level.

Global compression level.

Definition at line 152 of file RootDataConnection.cpp.

152 { return s_compressionLevel; }
IIncidentSvc* Gaudi::RootConnectionSetup::incidentSvc ( ) const
inline

Retrieve incident service.

Definition at line 84 of file RootDataConnection.h.

84 { return m_incidentSvc.get(); }
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
MsgStream& Gaudi::RootConnectionSetup::msgSvc ( ) const
inline

Retrieve message service.

Definition at line 79 of file RootDataConnection.h.

79 { return *m_msgSvc; }
std::unique_ptr< MsgStream > m_msgSvc
Reference to message service.
StatusCode RootConnectionSetup::setCompression ( boost::string_ref  compression)
static

Set the global compression level.

Definition at line 116 of file RootDataConnection.cpp.

117 {
118 #if ROOT_VERSION_CODE >= ROOT_VERSION( 5, 33, 0 )
119  int res = 0, level = ROOT::CompressionSettings( ROOT::kLZMA, 6 );
120  auto idx = compression.find( ':' );
121  if ( idx != string::npos ) {
122  auto alg = compression.substr( 0, idx );
123  ROOT::ECompressionAlgorithm alg_code = ROOT::kUseGlobalSetting;
124  if ( alg.size() == 4 && strncasecmp( alg.data(), "ZLIB", 4 ) == 0 )
125  alg_code = ROOT::kZLIB;
126  else if ( alg.size() == 4 && strncasecmp( alg.data(), "LZMA", 4 ) == 0 )
127  alg_code = ROOT::kLZMA;
128  else
129  throw runtime_error( "ERROR: request to set unknown ROOT compression algorithm:" + alg.to_string() );
130  res = ::sscanf( compression.substr( idx + 1 ).to_string().c_str(), "%d",
131  &level ); // TODO: use C++17 std::from_chars instead...
132  if ( res == 1 ) {
133  s_compressionLevel = ROOT::CompressionSettings( alg_code, level );
134  return StatusCode::SUCCESS;
135  }
136  throw runtime_error( "ERROR: request to set unknown ROOT compression level:" +
137  compression.substr( idx + 1 ).to_string() );
138  } else if ( 1 ==
139  ::sscanf( compression.to_string().c_str(), "%d", &level ) ) { // TODO: use C++17 std::from_chars instead
140  s_compressionLevel = level;
141  return StatusCode::SUCCESS;
142  }
143  throw runtime_error( "ERROR: request to set unknown ROOT compression mechanism:" + compression.to_string() );
144 #else
145  if ( !compression.empty() ) {
146  }
147  return StatusCode::SUCCESS;
148 #endif
149 }
T sscanf(T...args)
static int compression()
Access to global compression level.
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
void RootConnectionSetup::setIncidentSvc ( IIncidentSvc m)

Set incident service reference.

Definition at line 158 of file RootDataConnection.cpp.

158 { m_incidentSvc.reset( s ); }
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
string s
Definition: gaudirun.py:253
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:92
void RootConnectionSetup::setMessageSvc ( MsgStream m)

Set message service reference.

Definition at line 155 of file RootDataConnection.cpp.

155 { m_msgSvc.reset( m ); }
std::unique_ptr< MsgStream > m_msgSvc
Reference to message service.
T reset(T...args)

Member Data Documentation

StringVec Gaudi::RootConnectionSetup::cacheBranches

Vector of strings with branches to be cached for input files.

Definition at line 58 of file RootDataConnection.h.

int Gaudi::RootConnectionSetup::cacheSize

RootCnvSvc Property: Root data cache size.

Definition at line 64 of file RootDataConnection.h.

int Gaudi::RootConnectionSetup::learnEntries

RootCnvSvc Property: ROOT cache learn entries.

Definition at line 66 of file RootDataConnection.h.

std::string Gaudi::RootConnectionSetup::loadSection

RootCnvSvc Property: Root data cache size.

Definition at line 62 of file RootDataConnection.h.

SmartIF<IIncidentSvc> Gaudi::RootConnectionSetup::m_incidentSvc = nullptr
private

Reference to incident service.

Definition at line 51 of file RootDataConnection.h.

std::unique_ptr<MsgStream> Gaudi::RootConnectionSetup::m_msgSvc
private

Reference to message service.

Definition at line 49 of file RootDataConnection.h.

StringVec Gaudi::RootConnectionSetup::vetoBranches

Vector of strings with branches to NOT be cached for input files.

Definition at line 60 of file RootDataConnection.h.


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