Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Attributes | List of all members
evdb::ServiceTable Class Reference

Collection of Services used in the event display. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/nuevdb/v1_00_02/source/nuevdb/EventDisplayBase/ServiceTable.h"

Public Member Functions

void RegisterService (fhicl::ParameterSet const &ps, cet::exempt_ptr< Reconfigurable > s)
 
void Edit (unsigned int i)
 
void ApplyEdits ()
 
fhicl::ParameterSet const & GetParameterSet (unsigned int i) const
 

Static Public Member Functions

static ServiceTableInstance ()
 
static bool IsDrawingService (std::string const &s)
 
static void OverrideCategory (std::string const &s, int cat)
 

Public Attributes

std::vector< ServiceTableEntryfServices
 

Private Member Functions

 ServiceTable ()
 

Static Private Attributes

static std::map< std::string, intfgCategoryOverrides
 

Detailed Description

Collection of Services used in the event display.

Definition at line 36 of file ServiceTable.h.

Constructor & Destructor Documentation

ServiceTable::ServiceTable ( )
private

Definition at line 111 of file ServiceTable.cxx.

111 {}

Member Function Documentation

void ServiceTable::ApplyEdits ( )

Definition at line 64 of file ServiceTable.cxx.

References e, fServices, LOG_DEBUG, LOG_ERROR, and fhicl::make_ParameterSet().

Referenced by evdb::EventDisplay::postProcessEvent().

65 {
66  // Look to see if we have any new service configurations to apply
67  for (auto& s : fServices) {
68  if (s.fParamSet.empty()) continue;
69 
70  LOG_DEBUG("ServiceTable") << "Applying edits for "
71  << s.fName
72  << "\n"
73  << s.fParamSet;
74 
75  try {
77  //
78  // Each of the next 2 lines may throw on error: should check.
79  //
80  fhicl::make_ParameterSet(s.fParamSet, pset);
81  s.fParamSet.clear();
82  s.fService->do_reconfigure(pset);
83  s.fCurrentParamSet = pset;
84  }
85  catch (fhicl::exception const& e) {
86  LOG_ERROR("ServiceTable") << "Error parsing the new configuration:\n"
87  << e
88  << "\nRe-configuration has been ignored for service: "
89  << s.fName;
90  }
91  }
92 }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
void make_ParameterSet(intermediate_table const &tbl, ParameterSet &ps)
const XML_Char * s
Definition: expat.h:262
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
Float_t e
Definition: plot.C:35
#define LOG_ERROR(stream)
Definition: Messenger.h:129
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void ServiceTable::Edit ( unsigned int  i)

Definition at line 56 of file ServiceTable.cxx.

References ana::assert(), and fServices.

Referenced by evdb::EditMenu::MenuSelect().

57 {
58  assert(i < fServices.size());
60 }
Top-level interface to all parameter sets.
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
assert(nhit_max >=nhit_nbins)
fhicl::ParameterSet const & ServiceTable::GetParameterSet ( unsigned int  i) const

Definition at line 103 of file ServiceTable.cxx.

References ana::assert(), and fServices.

Referenced by evdb::ParameterSetEditFrame::ParameterSetEditFrame().

104 {
105  assert(id < fServices.size());
106  return fServices[id].fCurrentParamSet;
107 }
::xsd::cxx::tree::id< char, ncname > id
Definition: Database.h:165
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
assert(nhit_max >=nhit_nbins)
ServiceTable & ServiceTable::Instance ( void  )
static
bool ServiceTable::IsDrawingService ( std::string const &  s)
static

Definition at line 23 of file ServiceTable.cxx.

References fgCategoryOverrides, and evdb::kDRAWING_SERVICE.

Referenced by RegisterService().

24 {
25  if(fgCategoryOverrides.count(s))
27 
28  return (s.find("DrawingOptions")!=std::string::npos);
29 }
static constexpr int kDRAWING_SERVICE
Definition: ServiceTable.h:19
static std::map< std::string, int > fgCategoryOverrides
Definition: ServiceTable.h:53
const XML_Char * s
Definition: expat.h:262
void ServiceTable::OverrideCategory ( std::string const &  s,
int  cat 
)
static

Definition at line 96 of file ServiceTable.cxx.

References make_static_page::cat, and fgCategoryOverrides.

Referenced by evd::SliceNavigator::SliceNavigator().

97 {
99 }
static std::map< std::string, int > fgCategoryOverrides
Definition: ServiceTable.h:53
const XML_Char * s
Definition: expat.h:262
void ServiceTable::RegisterService ( fhicl::ParameterSet const &  ps,
cet::exempt_ptr< Reconfigurable s 
)

Definition at line 33 of file ServiceTable.cxx.

References HTMLTools::entry(), evdb::ServiceTableEntry::fCategory, evdb::ServiceTableEntry::fCurrentParamSet, evdb::ServiceTableEntry::fName, evdb::ServiceTableEntry::fParamSet, evdb::ServiceTableEntry::fService, fServices, fhicl::ParameterSet::get(), IsDrawingService(), evdb::kDRAWING_SERVICE, evdb::kEXPERIMENT_SERVICE, nd_projection_maker::ps, and string.

Referenced by evdb::Reconfigurable::Reconfigurable().

35 {
37  entry.fName = ps.get<std::string>("service_type");
38  entry.fCurrentParamSet = ps;
39  entry.fParamSet = "";
41  entry.fService = s;
42 
43  fServices.emplace_back(std::move(entry));
44 }
static constexpr int kDRAWING_SERVICE
Definition: ServiceTable.h:19
cet::exempt_ptr< Reconfigurable > fService
Definition: ServiceTable.h:30
const XML_Char * s
Definition: expat.h:262
static constexpr int kEXPERIMENT_SERVICE
Definition: ServiceTable.h:20
static bool IsDrawingService(std::string const &s)
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
fhicl::ParameterSet fCurrentParamSet
Definition: ServiceTable.h:27
Information about a service required by the event display.
Definition: ServiceTable.h:25
def entry(str)
Definition: HTMLTools.py:26
enum BeamMode string

Member Data Documentation

std::map< std::string, int > ServiceTable::fgCategoryOverrides
staticprivate

Definition at line 53 of file ServiceTable.h.

Referenced by IsDrawingService(), and OverrideCategory().

std::vector<ServiceTableEntry> evdb::ServiceTable::fServices

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