Public Types | Public Member Functions | Private Attributes | List of all members
FclRunDataTool Class Reference

#include <FclRunDataTool.h>

Inheritance diagram for FclRunDataTool:
RunDataTool

Public Types

using Name = std::string
 
using NameVector = std::vector< Name >
 
- Public Types inherited from RunDataTool
using Index = unsigned int
 

Public Member Functions

 FclRunDataTool (fhicl::ParameterSet const &ps)
 
 ~FclRunDataTool () override=default
 
RunData runData (Index run, Index subRun) const override
 
- Public Member Functions inherited from RunDataTool
virtual ~RunDataTool ()=default
 

Private Attributes

Index m_LogLevel
 
NameVector m_FileNames
 
Name m_fclPath
 

Detailed Description

Definition at line 27 of file FclRunDataTool.h.

Member Typedef Documentation

Definition at line 31 of file FclRunDataTool.h.

Definition at line 32 of file FclRunDataTool.h.

Constructor & Destructor Documentation

FclRunDataTool::FclRunDataTool ( fhicl::ParameterSet const &  ps)

Definition at line 50 of file FclRunDataTool_tool.cc.

51 : m_LogLevel(ps.get<Index>("LogLevel")),
52  m_FileNames(ps.get<NameVector>("FileNames")) {
53  const Name myname = "FclRunDataTool::ctor: ";
54  m_fclPath = gSystem->Getenv("FHICL_FILE_PATH");
55  if ( m_LogLevel ) {
56  cout << myname << "Configuration:" << endl;
57  cout << myname << " LogLevel: " << m_LogLevel << endl;
58  cout << myname << " FileNames: ";
59  if ( m_FileNames.size() == 0 ) {
60  cout << "<empty>";
61  }
62  for ( Name fname : m_FileNames ) {
63  cout << "\n" << myname << " " << fname;
64  }
65  cout << endl;
66  }
67 }
ChannelGroupService::Name Name
NameVector m_FileNames
unsigned int Index
static constexpr double ps
Definition: Units.h:99
std::vector< string > NameVector
QTextStream & endl(QTextStream &s)
FclRunDataTool::~FclRunDataTool ( )
overridedefault

Member Function Documentation

RunData FclRunDataTool::runData ( Index  run,
Index  subRun 
) const
overridevirtual

Implements RunDataTool.

Definition at line 71 of file FclRunDataTool_tool.cc.

71  {
72  const Name myname = "FclRunDataTool::runData: ";
73  RunData rdat;
74  bool useSubRun = subRun;
75  if ( m_LogLevel >= 2 ) {
76  cout << myname << "Fetching tool for run " << run;
77  if ( useSubRun ) cout << ", subrun " << subRun;
78  cout << endl;
79  }
80  for ( Name fname : m_FileNames ) {
81  StringManipulator sman(fname, false);
82  sman.replaceFixedWidth("%RUN%", run, 6);
83  sman.replaceFixedWidth("%SUBRUN%", subRun, 6);
84  if ( parseFcl(m_fclPath, fname, rdat) ) {
85  if ( m_LogLevel >= 3 ) cout << myname << "Unable to find/read " << fname << endl;
86  } else {
87  if ( m_LogLevel >= 3 ) cout << myname << " Read " << fname << endl;
88  }
89  }
90  return rdat;
91 }
ChannelGroupService::Name Name
NameVector m_FileNames
QTextStream & endl(QTextStream &s)

Member Data Documentation

Name FclRunDataTool::m_fclPath
private

Definition at line 49 of file FclRunDataTool.h.

NameVector FclRunDataTool::m_FileNames
private

Definition at line 47 of file FclRunDataTool.h.

Index FclRunDataTool::m_LogLevel
private

Definition at line 46 of file FclRunDataTool.h.


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