The Gaudi Framework  v36r9p1 (5c15b2bb)
Gaudi::RootConnectionSetup Class Referencefinal

#include </builds/gaudi/Gaudi/RootCnv/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 (std::string_view 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 { 0 }
 RootCnvSvc Property: Root data cache size. More...
 
int learnEntries { 0 }
 RootCnvSvc Property: ROOT cache learn entries. More...
 
Gaudi::Property< bool > produceReproducibleFiles
 

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 55 of file RootDataConnection.h.

Member Typedef Documentation

◆ StringVec

Type definition for string maps.

Definition at line 64 of file RootDataConnection.h.

Constructor & Destructor Documentation

◆ RootConnectionSetup()

Gaudi::RootConnectionSetup::RootConnectionSetup ( )
default

Standard constructor.

Member Function Documentation

◆ compression()

int RootConnectionSetup::compression ( )
static

Access to global compression level.

Global compression level.

Definition at line 162 of file RootDataConnection.cpp.

162 { return s_compressionLevel; }

◆ incidentSvc()

IIncidentSvc* Gaudi::RootConnectionSetup::incidentSvc ( ) const
inline

Retrieve incident service.

Definition at line 96 of file RootDataConnection.h.

96 { return m_incidentSvc.get(); }

◆ msgSvc()

MsgStream& Gaudi::RootConnectionSetup::msgSvc ( ) const
inline

Retrieve message service.

Definition at line 91 of file RootDataConnection.h.

91 { return *m_msgSvc; }

◆ setCompression()

StatusCode RootConnectionSetup::setCompression ( std::string_view  compression)
static

Set the global compression level.

Definition at line 122 of file RootDataConnection.cpp.

122  {
123 #if ROOT_VERSION_CODE >= ROOT_VERSION( 5, 33, 0 )
124  int res = 0, level = ROOT::CompressionSettings( ROOT::kLZMA, 6 );
125  auto idx = compression.find( ':' );
126  if ( idx != string::npos ) {
127  auto alg = compression.substr( 0, idx );
128  ROOT::ECompressionAlgorithm alg_code = ROOT::kUseGlobalSetting;
129  if ( alg.size() == 4 && strncasecmp( alg.data(), "ZLIB", 4 ) == 0 )
130  alg_code = ROOT::kZLIB;
131  else if ( alg.size() == 4 && strncasecmp( alg.data(), "LZMA", 4 ) == 0 )
132  alg_code = ROOT::kLZMA;
133  else if ( alg.size() == 3 && strncasecmp( alg.data(), "LZ4", 3 ) == 0 )
134  alg_code = ROOT::kLZ4;
135 # if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 20, 0 )
136  else if ( alg.size() == 4 && strncasecmp( alg.data(), "ZSTD", 4 ) == 0 )
137  alg_code = ROOT::kZSTD;
138 # endif
139  else
140  throw runtime_error( "ERROR: request to set unknown ROOT compression algorithm:" + std::string{ alg } );
141  res = ::sscanf( std::string{ compression.substr( idx + 1 ) }.c_str(), "%d",
142  &level ); // TODO: use C++17 std::from_chars instead...
143  if ( res == 1 ) {
144  s_compressionLevel = ROOT::CompressionSettings( alg_code, level );
145  return StatusCode::SUCCESS;
146  }
147  throw runtime_error( "ERROR: request to set unknown ROOT compression level:" +
148  std::string{ compression.substr( idx + 1 ) } );
149  } else if ( 1 == ::sscanf( std::string{ compression }.c_str(), "%d", &level ) ) { // TODO: use C++17 std::from_chars
150  // instead
151  s_compressionLevel = level;
152  return StatusCode::SUCCESS;
153  }
154  throw runtime_error( "ERROR: request to set unknown ROOT compression mechanism:" + std::string{ compression } );
155 #else
156  if ( !compression.empty() ) {}
157  return StatusCode::SUCCESS;
158 #endif
159 }

◆ setIncidentSvc()

void RootConnectionSetup::setIncidentSvc ( IIncidentSvc m)

Set incident service reference.

Definition at line 168 of file RootDataConnection.cpp.

168 { m_incidentSvc.reset( s ); }

◆ setMessageSvc()

void RootConnectionSetup::setMessageSvc ( MsgStream m)

Set message service reference.

Definition at line 165 of file RootDataConnection.cpp.

165 { m_msgSvc.reset( m ); }

Member Data Documentation

◆ cacheBranches

StringVec Gaudi::RootConnectionSetup::cacheBranches

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

Definition at line 67 of file RootDataConnection.h.

◆ cacheSize

int Gaudi::RootConnectionSetup::cacheSize { 0 }

RootCnvSvc Property: Root data cache size.

Definition at line 73 of file RootDataConnection.h.

◆ learnEntries

int Gaudi::RootConnectionSetup::learnEntries { 0 }

RootCnvSvc Property: ROOT cache learn entries.

Definition at line 75 of file RootDataConnection.h.

◆ loadSection

std::string Gaudi::RootConnectionSetup::loadSection

RootCnvSvc Property: Root data cache size.

Definition at line 71 of file RootDataConnection.h.

◆ m_incidentSvc

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

Reference to incident service.

Definition at line 60 of file RootDataConnection.h.

◆ m_msgSvc

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

Reference to message service.

Definition at line 58 of file RootDataConnection.h.

◆ produceReproducibleFiles

Gaudi::Property<bool> Gaudi::RootConnectionSetup::produceReproducibleFiles
Initial value:
{ "ProduceReproducibleFiles", true,
"configure output files to be more reproducible" }

Definition at line 77 of file RootDataConnection.h.

◆ vetoBranches

StringVec Gaudi::RootConnectionSetup::vetoBranches

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

Definition at line 69 of file RootDataConnection.h.


The documentation for this class was generated from the following files:
std::string
STL class.
gaudirun.s
string s
Definition: gaudirun.py:346
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
Gaudi::RootConnectionSetup::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootDataConnection.h:60
std::sscanf
T sscanf(T... args)
std::unique_ptr::reset
T reset(T... args)
basic.alg
alg
Definition: basic.py:15
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:108
Gaudi::RootConnectionSetup::m_msgSvc
std::unique_ptr< MsgStream > m_msgSvc
Reference to message service.
Definition: RootDataConnection.h:58
std::runtime_error
STL class.
gaudirun.level
level
Definition: gaudirun.py:364
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
Gaudi::RootConnectionSetup::compression
static int compression()
Access to global compression level.
Definition: RootDataConnection.cpp:162