DAS  3.0
Das Analysis System
IPlugin

Description

Dummy, common type for all plugins in Darwin.

This includes observables and generic plugins.

#include <IPlugin.h>

+ Inheritance diagram for IPlugin:

Public Member Functions

 IPlugin ()=default
 
virtual ~IPlugin ()
 
void SetPath (const std::filesystem::path &file) noexcept
 
virtual void Load (Darwin::Tools::Flow &, Darwin::Tools::MetaInfo &, int=0, const boost::property_tree::ptree &={})
 
 IPlugin ()=default
 
virtual ~IPlugin ()
 
void SetPath (const std::filesystem::path &file) noexcept
 
virtual void Load (Darwin::Tools::Flow &, Darwin::Tools::MetaInfo &, int=0, const boost::property_tree::ptree &={})
 

Protected Member Functions

virtual int GetParamsVeto () noexcept
 
virtual int GetParamsVeto () noexcept
 

Protected Attributes

int steering = none
 
bool isMC = false
 

Private Attributes

std::filesystem::path file
 

Constructor & Destructor Documentation

◆ IPlugin() [1/2]

IPlugin ( )
default

◆ ~IPlugin() [1/2]

virtual ~IPlugin ( )
inlinevirtual
47  {
48  using namespace std;
49  if (steering & verbose)
50  cout << "IPlugin: destroying plugin from " << file << endl;
51  }

◆ IPlugin() [2/2]

IPlugin ( )
default

◆ ~IPlugin() [2/2]

virtual ~IPlugin ( )
inlinevirtual
47  {
48  using namespace std;
49  if (steering & verbose)
50  cout << "IPlugin: destroying plugin from " << file << endl;
51  }

Member Function Documentation

◆ GetParamsVeto() [1/2]

virtual int GetParamsVeto ( )
inlineprotectedvirtualnoexcept

Plugin's forbidden modes.

See also
Darwin::Tools::Mode

Reimplemented in TreeFlattener, TreeFlattener, and SilentPlugin.

41 { return none; }

◆ GetParamsVeto() [2/2]

virtual int GetParamsVeto ( )
inlineprotectedvirtualnoexcept

Plugin's forbidden modes.

See also
Darwin::Tools::Mode

Reimplemented in TreeFlattener, TreeFlattener, and SilentPlugin.

41 { return none; }

◆ Load() [1/2]

virtual void Load ( Darwin::Tools::Flow ,
Darwin::Tools::MetaInfo ,
int  = 0,
const boost::property_tree::ptree &  = {} 
)
virtual

Set steering.

Load branches and histograms in overloads.

Todo:

Handle reproducibility (fix #99)

Take variations as additional input? (might be needed for histograms)

◆ Load() [2/2]

void Load ( Darwin::Tools::Flow ,
Darwin::Tools::MetaInfo metainfo,
int  steering = 0,
const boost::property_tree::ptree &  = {} 
)
virtual

Set steering.

Load branches and histograms in overloads.

Todo:

Handle reproducibility (fix #99)

Take variations as additional input? (might be needed for histograms)

22  {
23  int params_veto = GetParamsVeto();
24  if (params_veto & (verbose | config | plugin))
25  BOOST_THROW_EXCEPTION( logic_error("Plugins may not veto -v, -c, nor -p") );
26  if (params_veto & steering) {
27  string what = "The following steering options are vetoed:";
28  if (params_veto & split ) what += " -k -j";
29  if (params_veto & fill ) what += " -f";
30  if (params_veto & Friend ) what += " -F";
31  if (params_veto & syst ) what += " -s";
32  BOOST_THROW_EXCEPTION( invalid_argument(what) );
33  }
34  this->steering = steering;
35 
36  isMC = metainfo.Get<bool>("flags", "isMC");
37 }
38 catch (boost::exception& e) {
39  BOOST_THROW_EXCEPTION( DE::PluginException(file, e) );
40 }

◆ SetPath() [1/2]

void SetPath ( const std::filesystem::path &  file)
inlinenoexcept

Set location of plugin file.

55 { this->file = file; }

◆ SetPath() [2/2]

void SetPath ( const std::filesystem::path &  file)
inlinenoexcept

Set location of plugin file.

55 { this->file = file; }

Member Data Documentation

◆ file

std::filesystem::path file
private

plugin file

◆ isMC

bool isMC = false
protected

◆ steering

int steering = none
protected

runtime steering options from command line (

See also
Darwin::Tools::Mode)

The documentation for this class was generated from the following files:
Darwin::Tools::fill
@ fill
activate -f to fill the tree
Definition: Options.h:32
Darwin::Exceptions::PluginException
Exception type to throw from plugins.
Definition: exceptions.h:132
Darwin::Tools::Friend
@ Friend
activate -F to only fill the new branches
Definition: Options.h:33
Darwin::Tools::UserInfo::Get
T Get(TList *mother, const char *key) const
Definition: UserInfo.h:77
Darwin::Tools::split
@ split
activate -k and -j to define slice
Definition: Options.h:31
Darwin::Tools::syst
@ syst
activate -s to systematic uncertainties
Definition: Options.h:34
Darwin::Tools::none
@ none
default (for simple executables)
Definition: Options.h:28
Darwin::Tools::IPlugin::isMC
bool isMC
Definition: IPlugin.h:35
Darwin::Tools::plugin
@ plugin
activate -p to run a plugin
Definition: Options.h:35
Darwin::Tools::IPlugin::GetParamsVeto
virtual int GetParamsVeto() noexcept
Plugin's forbidden modes.
Definition: IPlugin.h:41
Darwin::Tools::verbose
@ verbose
bit for debug mode (-v is always available)
Definition: Options.h:29
Darwin::Tools::IPlugin::steering
int steering
runtime steering options from command line (
Definition: IPlugin.h:33
Darwin::Tools::IPlugin::file
std::filesystem::path file
plugin file
Definition: IPlugin.h:29
Darwin::Tools::config
@ config
activate -c option to provide config file
Definition: Options.h:30