-
Notifications
You must be signed in to change notification settings - Fork 4
Developer's guide
All classes that are able to be configured via the configuration system should inherit from KTConfigurable. KTConfigurables have a member function Configure(const KTPStoreNode*) that is used to perform the configuration of the KTConfigurable instance. The KTPStoreNode pointer that is passed to the instance should be the branch of the configuration tree that is relevant to that instance. It can then process that branch in any way it sees fit.
Here are some examples of code that has been used to configure different KTConfigurable classes in Katydid. This is an incomplete list, and if new ways are developed, they should be added here.
-
Basic method for getting information from the tree, for the available data types (an exception is thrown if the data cannot be cast to the requested type, or if the data doesn't exist):
std::string stringData = node->GetData< std::string >("string-data")
Int_t intData = node->GetData< Int_t >("int-data")
Double_t floatData = node->GetData< Double_t >("float-data")
Bool_t boolData = node->GetData< Bool_t >("bool-data")
-
Data can be accessed with a default in case the data doesn't exist in the branch:
std::string stringData = node->GetData< std::string >("string-data", "some default text")
Katydid: Data analysis package for the Project 8 experiment
Copyright 2011, Project 8 Collaboration