List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
fwk::CentralConfig Class Reference

Main configuration utility. More...

#include <CentralConfig.h>

Classes

struct  InternalIdFunctor
 

Public Types

typedef
boost::transform_iterator
< InternalIdFunctor,
InternalConfigIterator,
std::string > 
IdIterator
 IdIterator returns a pointer to a config link Id. More...
 

Public Member Functions

std::string GetConfig ()
 Get configuration in a string. More...
 
const std::string & GetInstallPath () const
 
const utl::ReaderGetReader (const std::string &id)
 Get the Reader for moduleConfigLink with given id (XML files) More...
 
utl::Branch GetTopBranch (const std::string &id)
 Get top branch for moduleConfigLink with given id (XML files) More...
 
IdIterator IdsBegin ()
 Id's begin. More...
 
IdIterator IdsEnd ()
 Id's end. More...
 
void WriteConfig (const std::string &fileName="")
 Get the link name for moduleConfigLink with given id (any) More...
 

Static Public Member Functions

static CentralConfigGetInstance (const std::string &bootstrapFileName, const bool fingerprintFatal=false, const bool validate=true)
 Use this the first time you get an instance of central configuration. More...
 
static CentralConfigGetInstance ()
 Use this the first time you get an instance of central configuration. More...
 

Protected Member Functions

 CentralConfig ()
 
 ~CentralConfig ()
 

Static Protected Member Functions

static void Reset (const std::string &bootstrapFileName, const bool fingerprintFatal=false, const bool validate=true)
 

Static Protected Attributes

static CentralConfigfgInstance = nullptr
 

Private Types

typedef std::map< std::string,
ConfigLink >::iterator 
InternalConfigIterator
 

Private Member Functions

void AbortParse (const std::string &s="")
 
std::string AsString (const utl::Branch &branch, const int indent=0, const int indentIncrement=2)
 
void CheckFingerprints (const bool fingerprintFatal)
 
void DescendAndReplace (utl::Branch replacement, utl::Branch &original)
 
void FillConfigTimeFingerMap ()
 
void FillMap (const utl::Branch &branch)
 
void FillMd5Excludes ()
 
utl::Branch Find (std::string path)
 
void FindConfigBranch ()
 
std::string GetBootstrapUri ()
 
void LogBootstrap ()
 
void ReadConfig (const std::string &bootstrapFile)
 
void ReplaceParameters (const utl::Branch &)
 

Private Attributes

utl::ReaderfBootstrapReader = nullptr
 
std::stringstream fConfigInfo
 
bool fConfigInfoIsValid = false
 
std::map< std::string, ConfigLinkfConfigMap
 
std::multimap< std::string,
std::string > 
fConfigTimeFingerMap
 
std::string fInstallPath
 
std::set< std::string > fMd5Excludes
 
std::list< std::string > fMismatchedMd5List
 
std::list< std::string > fNoMd5List
 
std::set< std::string > fUsedConfigs
 

Static Private Attributes

static bool fgIsInitialized = false
 
static bool fgValidate = true
 

Detailed Description

Main configuration utility.

  The CentralConfig  holds links to all external configuration files
  needed by various parts of the framework.  It also provides services
  for concatenating all configurations used and writing them on file. 
  Finally, the CentralConfig
  implements a mechanism for centralized overriding of default configuration
  data.

  \author T. Paul
  \author J. Gonzalez

CentralConfig introduction

In order to provide the flexibility to carry out many different sorts of applications, the Offline framework was designed to be highly configurable. One consequence of this is that there can be many configuration files to keep track of! A portion of the framework known as the fwk::CentralConfig provides services to specify which configuration files should be used, import default configurations, and log the configurations used for a run. The CentralConfig object is essentially just a dictionary that associates a file on a local disk or a URL on the internet to a logical name. Framework code or user code can then request configuration information using the logical name, and the CentralConfig will look up the appropriate physical file.

Configuration files are typically required for such tasks as:

Using the CentralConfig

The CentralConfig fills itself using a so-called bootstrap XML file whose name can be passed on the command line of the main program. Here is an example of a bootstrap XML file:

<bootstrap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:noNamespaceSchemaLocation='/someplace/bootstrap.xsd'
                xmlns:xlink="http://www.auger.org/schema/types">

  <centralConfig>

    <!-- The file containing the sequencing file used by RunManager -->
    <configLink 
        id         = "ModuleSequence"
        type       = "XML" 
        xlink:href = "./ModuleSequence.xml" /> 

    <!-- A file containing parameters used by one of the modules -->
    <configLink 
        id         = "Module1Config"
        type       = "XML" 
        xlink:href = "./Module1Config.xml" /> 

    <!-- A file containing SD detector geometry and materials for simulations -->
    <configLink 
        id = "SModelsXMLManager" 
        type = "XML"
        xlink:href = "http://www.hep.physics.neu.edu/auger/xml/SModelConfig.xml" />

  </centralConfig>
</bootstrap>

Once constructed, the CentralConfig object evaluates everything between the <centralConfig> tags of the bootstrap file. Pointers to configuration files are set in the attributes of <configLink> tags. These attributes define a link id, the type of file, and and xlink:href. These three items are discussed below.

The configLink id attribute is simply a logical name used from within C++ code to refer to a link, where a link in this context is simply a file path and name or a URL. For example, to request the file name and path for Module1Config.xml, one could query the CentralConfig as follows:

string module1File = theCC->GetLinkName("Module1Config");
assert (module1File == "./Module1Config.xml");

The type attribute contains information about the file format, and is used by the CentralConfig to take some action based on what format it is dealing with. For example, if type = "XML", the CentralConfig will automatically create a utl::Reader for the requested XML file. The user can then jump directly into the XML document using the CentralConfig::GetTopBranch method:

Branch topOfModule1Config = theCC->GetTopBranch("Module1Config");

On the other hand, if type = "ROOT", for example, no utl::Reader is created, as the utl::Reader class cannot read ROOT files. In this case, one could only request the file name and path using the CentralConfig::GetLinkName method; the utl::Branch::GetTopBranch method would return a null Branch.

Finally, we comment on the xlink:href attribute. As discussed above, this attribute contains the actual link to the file, where in our case this link is just a file name and path or a URL. Using a URL is sometimes convenient in cases where you are collaborating on a task and wish to use a common configuration file. One person can post and maintain the configuration on a web site, and everyone else can simply set their configLink to the appropriate URL.

Configuration logging

The CentralConfig also contains machinery to assist in logging the complete configuration used during a run. This feature is invoked using the -l option on the command line. For example,

userAugerOffline -b bootstrap.xml -l logfile.xml

will cause the CentralConfig to keep track of all configuration files requested during the run and, at the end, concatenate them into one big XML log file. This log file can be opened in any text editor, or it can be viewed in an WWW browser. If you look through a log file, you'll discover that it begins with something that looks like a bootstrap file. Rather than pointing to external files, this bootstrap file points to different locations within the same log file in which the various configurations are located. As a result, you can use a log file as if it were a bootstrap file, and so reconstitute a run with exactly the same configuration that was originally used. Thus the command,

userAugerOffline -b logfile.xml

will run the program with precisely the configuration used at the time the logfile.xml file was generated.

Configuration data are also automatically stored in any files written in Offline native format. The data stored in the Offline files can be converted back into an XML logfile by running the EventFileReaderOG::EventFileReader module with the following option:

<DumpConfig> myConfigFileName.xml </DumpConfig>

Standard and example configurations

The bootstrap file for a typical simulation or reconstruction application can get rather long, particularly if there are many modules and/or data sources. To make life easier, several example configurations as well as so-called "standard" configurations (see section Standard configurations) are provided; these can be included in the user's bootstrap file as illustrated here:

<!DOCTYPE bootstrap [
  <!-- alias for example SD config files -->
  <!ENTITY exampleSDConfig SYSTEM '/someplace/exampleSDConfig.xml'> 
]>

<bootstrap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:noNamespaceSchemaLocation='/someplace/bootstrap.xsd'
                xmlns:xlink="http://www.auger.org/schema/types">

  <centralConfig>

  <!-- get example configuration for SD -->
  &exampleSDConfig;

  <configLink 
      id         = "ModuleSequence"
      type       = "XML" 
      xlink:href = "./ModuleSequence.xml"/>

  <configLink 
      id         = "EventFileReader"
      type       = "XML" 
      xlink:href = "./EventFileReader.xml"/>

  <configLink 
      id         = "EventFileReader"
      type       = "XML" 
      xlink:href = "./EventFileReader.xml"/>

  <!-- override example ParticleInjector configuration -->
  <configLink
      id         = "ParticleInjector"
      type       = "XML" 
      xlink:href = "./myParticleInjectorConfig.xml"/>

  </centralConfig>
</bootstrap>

Including an example or standard configuration involves declaring a so-called ENTITY, as shown at the top of the figure. In XML-speak, an ENTITY simply defines an alias that gets replaced by some other text at the time the file is parsed. In this case, exampleSDConfig gets replaced by a bit of XML (defining the example configuration) which is read from a file. The magic word SYSTEM tells the parser that the XML we are interested in resides in a separate file, rather than in the current document. The name and location of this file is given following the SYSTEM keyword; in this case, the file is /someplace/exampleSDConfig.xml. When the bootstrap file is parsed, the parser replaces &exampleSDConfig; with the XML read in from exampleSDConfig.xml.

Notice in the example above that, despite including a example configuration, we still define configLink's for the EventFileReader logical name. This is because the exampleSDConfig.xml file does not set example configurations for this file, as there is no sensible example module sequences of event file reader configurations.

You can override a configLink set by a example configuration file by simply redefining that configLink in your bootstrap file anywhere below the inclusion of the example configuration. In the example above, the example configuration for the ParticleInjector module is replaced with a different configuration file.

Standard configurations

"Standard" configuration files are intended to document configurations used for standard simulation and reconstruction applications. The specification of standard configurations are meant to be determined by the responsible analysis teams. (N.B. as of 26 September 20007, the standard configurations have not yet been reviewed by the analysis groups, and thus far are meant only as a starting point for future evaluation.)

The standard configuration files are located in $prefix/auger-offline/config/ and use the following naming convention:

For example, the standard FD simulation application includes the following configuration:

<!DOCTYPE bootstrap [
<!ENTITY standardFdIdealDetConfig SYSTEM '@CONFIGDIR@/standardFdIdealDetConfig.xml'>
<!ENTITY standardFdSimModuleConfig SYSTEM '@CONFIGDIR@/standardFdSimModuleConfig.xml'>
]>
<bootstrap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='@SCHEMALOCATION@/bootstrap.xsd'
xmlns:xlink="http://www.auger.org/schema/types">
<!-- get standard configuration for FD -->
&standardFdIdealDetConfig;
&standardFdSimModuleConfig;
<!-- etc. -->

Reconstruction of the simulated event(s) above would use the configuration for the Rec modules and the configuration for the Ideal detector configuration.

<!DOCTYPE bootstrap [
<!ENTITY standardFdIdealDetConfig SYSTEM '@CONFIGDIR@/standardFdIdealDetConfig.xml'>
<!ENTITY standardFdRecModuleConfig SYSTEM '@CONFIGDIR@/standardFdRecModuleConfig.xml'>
]>
<bootstrap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='@SCHEMALOCATION@/bootstrap.xsd'
xmlns:xlink="http://www.auger.org/schema/types">
&standardFdIdealDetConfig;
&standardFdRecModuleConfig;
<!-- etc -->

The Ideal detector configuration is used since, in this example, it was the detector configuration used to generate the event(s) in the first place.

Reconstruction of real FD data would point to the configuration for Rec modules, and to the Real detector configuration, which provides access to time-varying detector data from the offline databases:

<!DOCTYPE bootstrap [
<!ENTITY standardFdRealDetConfig SYSTEM '@CONFIGDIR@/standardFdRealDetConfig.xml'>
<!ENTITY standardFdRecModuleConfig SYSTEM '@CONFIGDIR@/standardFdRecModuleConfig.xml'>
]>
<bootstrap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='@SCHEMALOCATION@/bootstrap.xsd'
xmlns:xlink="http://www.auger.org/schema/types">
&standardFdRealDetConfig;
&standardFdRecModuleConfig;
<!-- etc. -->

Example configurations

Example configuration files are located in $prefix/auger-offline/config/, and begin with the word example. These files include most (hopefully all) of the confLinks one could possibly need for SD, FD and Hybrid work. They are not verified by analysis groups, and are meant primarily as informal shortcuts which may be convenient when working on rapid prototyping. Applications which use the example configurations can be found in $prefix/auger-offline/doc/ExampleApplications.

Configuration overrides

The CentralConfig also provides a mechanism to override any portion of a example configuration file from within the bootstrap file. To use this mechanism, one includes a <parameterOverides> element in the bootstrap file in which one can indicate the data one wishes to override. The full XML hierarchy required uniquely identify the data to override must be specified. For example, the following <parameterOverrides> element overrides the example value of the altitude for eye 3 of the example configuration file pointed to by <configLink id="FTelescopeListXMLManager">:

  <parameterOverrides>

  <!-- change the example altitude of Loma Amarilla -->

  <configLink id="FTelescopeListXMLManager">
     <telescopeList>
        <eye id="3">
  
          <altitude unit="km"> 1.5 </altitude>

        </eye>
     </telescopeList>
  </configLink>

  </parameterOverrides>

Note that, in addition to replacing the data specified in the <parameterOverrides> element, the CentralConfig will re-validate the full configuration against all relevant schema files to check for errors. How cool is that?

More on overrides: using XPath to reduce the number of config files

Sometimes dealing with a lot of configuration files can get annoying. For example, when preparing job submission scripts in which each job does something slightly different, you might need to generate several different configuration files per job. Rather than generating and keeping track of lots and lots of files, it is possible to stuff all of your custom configuration information into a single file, namely the bootstrap file. This can be achieved using part of the XML standard known as XPath.

XPath allows one part of an XML file to point to another location in the same file. In bootstrap files, we can use this to direct the configLink to another location in the bootstrap file, rather than directing it to a separate file on disk or to a URL.

Here is an example. Suppose you have a configLink in your bootstrap file which points to the configuration file for the EventFileReader :

<bootstrap>
  <centralConfig>
    <configLink
        id         = "EventFileReader"
        type       = "XML"
        xlink:href = "/myConfigs/MyEventFileReaderConfig.xml" />
  <centralConfig>
</bootstrap>

You can copy the contents of MyEventFileReaderConfig.xml into the bootstrap file and point the configLink to it using XPath notation:

<bootstrap>
  <centralConfig>
    <configLink
        id         = "EventFileReader"
        type       = "XML"
        xlink:href = "#myEvtReader" />
  </centralConfig>          

  <myEvtReader>
    <EventFileReader>  
      <!-- event file config data goes here -->
    </EventFileReader>
  </myEvtReader>

</bootstrap>

In this example, the #myEvtReader simply instructs to CentralConfig to retrieve the EventFileReader configuration from the location in the bootstrap file enclosed in the <myEvtReader> tags.

Md5 fingerprints

Another job of the utl::CentralConfig is to verify that the contents of configuration files used in a run have not been altered since the time they were originally installed. This can be useful for catching errors and for bookkeeping during production runs.

Each configuration file is accompanied by an Md5 fingerprint, which is computed during Offline installation and checked at run time. If the run-time fingerprint does not match the original fingerprint for the file, the CentralConfig will log a warning message. For instance, if the example configuration file for the RandomEngineRegistry is altered, a warning like this will be logged:

CentralConfig/CentralConfig.cc:581: CheckFingerprints: Incorrect md5 fingerprint for 
configuration file: 'RandomEngineRegistry'. This implies this configuration file has been altered.

The framework can also be run with a command line option which which will halt execuation in case of a mis-matched fingerprint:

userAugerOffline --fingerprintFatal

Note that there are some configuration files whose contents are expected to be changed from run to run. Such files are excluded from the usual fingerprint checking by listing them in the utl::CentralConfig::FillMd5Excludes method. Developers are responsible for maintaining this file. The current contents of the Md5Excludes file is shown below:

// This file contains a list of configuration files which should
// NOT have their md5 fingerprints checked at run-time.  This 
// includes files whose contents are expected to change from run 
// to run.  If run in fatal mode, a fingerprint mismatch for any
// file NOT in this list will cause an exception throw.  Framework
// developers are responsible for keeping this file updated.

void
fwk::CentralConfig::FillMd5Excludes()
{
  fMd5Excludes.insert("RecDataLister");
  fMd5Excludes.insert("RecDataWriter");
  fMd5Excludes.insert("EventFileReader");
  fMd5Excludes.insert("EventFileExporter");
  fMd5Excludes.insert("ModuleSequence");
  fMd5Excludes.insert("ParticleInjector");
  fMd5Excludes.insert("EventGenerator");
  fMd5Excludes.insert("EventGenerator");
  fMd5Excludes.insert("SOverride");
}

Definition at line 51 of file CentralConfig.h.

Member Typedef Documentation

typedef boost::transform_iterator<InternalIdFunctor, InternalConfigIterator, std::string> fwk::CentralConfig::IdIterator

IdIterator returns a pointer to a config link Id.

Definition at line 93 of file CentralConfig.h.

typedef std::map<std::string, ConfigLink>::iterator fwk::CentralConfig::InternalConfigIterator
private

Definition at line 53 of file CentralConfig.h.

Constructor & Destructor Documentation

CentralConfig::CentralConfig ( )
protected

Definition at line 78 of file CentralConfig.cc.

References fwk::GetLibraryPath().

CentralConfig::~CentralConfig ( )
protected

Definition at line 86 of file CentralConfig.cc.

References RdGeoCeLDFFitter::c.

Member Function Documentation

void CentralConfig::AbortParse ( const std::string &  s = "")
private

Definition at line 961 of file CentralConfig.cc.

References ERROR, and utl::s.

string CentralConfig::AsString ( const utl::Branch branch,
const int  indent = 0,
const int  indentIncrement = 2 
)
private
void CentralConfig::CheckFingerprints ( const bool  fingerprintFatal)
private

Definition at line 671 of file CentralConfig.cc.

References ERROR, file, is(), and WARNING.

Referenced by GetInstance().

void CentralConfig::DescendAndReplace ( utl::Branch  replacement,
utl::Branch original 
)
private

Descend recursively through the replacement XML document. For every branch with data, look up corresponding branch in reader and make a replacement. Does not (currently) work for branches with data AND children. For example:

<br1> 1.2 <br2> 1.3 </br2> </br1>

won't be handled. It is probably possible to do it, but I think we have no such cases to support.

Definition at line 534 of file CentralConfig.cc.

References fwk::AsString(), fwk::AsXML(), RdGeoCeLDFFitter::c, ERROR, utl::XercesPtr< T >::Get(), utl::Branch::Get(), utl::Branch::GetAttributes(), utl::Branch::GetData(), utl::Branch::GetDOMNode(), utl::Branch::GetFirstChild(), utl::Branch::GetName(), utl::Branch::GetNextSibling(), utl::Branch::GetParent(), utl::Branch::GetSibling(), and WARNING.

void fwk::CentralConfig::FillConfigTimeFingerMap ( )
private
void CentralConfig::FillMap ( const utl::Branch branch)
private
void fwk::CentralConfig::FillMd5Excludes ( )
private

Definition at line 9 of file Md5Excludes.icc.

References fMd5Excludes.

Referenced by GetInstance().

Branch CentralConfig::Find ( std::string  path)
private

Definition at line 902 of file CentralConfig.cc.

References utl::Branch::GetChild(), and utl::Branch::GetTopBranch().

void fwk::CentralConfig::FindConfigBranch ( )
private
string CentralConfig::GetBootstrapUri ( )
private

Definition at line 278 of file CentralConfig.cc.

string CentralConfig::GetConfig ( )
const std::string& fwk::CentralConfig::GetInstallPath ( ) const
inline

Definition at line 99 of file CentralConfig.h.

References fInstallPath.

Referenced by CentralConfigTest::testCreation().

CentralConfig * CentralConfig::GetInstance ( const std::string &  bootstrapFileName,
const bool  fingerprintFatal = false,
const bool  validate = true 
)
static

Use this the first time you get an instance of central configuration.

Option checkFingerprints can be set to false if you do not want an exception thrown in case the md5 fingerprints have been altered (though they will still be checked and warnings issued in case of mismatch). When it's set to true, any alteration aborts the execution of the method with an exception.

Returns instance of CentralConfig if it already exists, or, if not, creates an instance from the bootstrap file which is passed as an argument to GetInstance and returns it. This method must be used the first time you ask for the CentralConfig instance. Subsequently, the CentralConfig can be retrieved by the argument-less method CentralConfig::GetInstance(). Keep in mind that the bootstrap filename is static so you can only have one bootstrap file per run! If you try to have more, you will get a warning message and only the first one you declare will actually be used

Definition at line 110 of file CentralConfig.cc.

References CheckFingerprints(), FillMd5Excludes(), INFO, and ReadConfig().

CentralConfig * CentralConfig::GetInstance ( )
static

Use this the first time you get an instance of central configuration.

This method is provided as a convenient alternative to CentralConfig::GetInstance(string), for cases where you want to retrieve the CentralConfig instance created previously but don't want to bother passing a string argument. If you try to use this method before first instantiating the CentralConfig with CentralConfig::GetInstance(string), you will get an error and the program will be terminated. That is, you must tell the CentralConfig about the bootstrap file the first time you call it.

Definition at line 212 of file CentralConfig.cc.

Referenced by un2::CalcDXCorsikaAtm(), Config(), det::VSQLManager::Connect(), fdet::FdChannelMappingManager::FillMaps(), fwk::RunController::Finish(), otoa::Offline2ADST::FinishDetectorAndFileInfo(), GetConfig(), io::OfflineROOTFile::GetEventBranch(), un2::GetSignal(), un2::GetTimeQuantile(), un2::GetTraceParameters(), MdCornerClippingCorrecterAG::MdCornerClippingCorrecter::Init(), RdChannelResampler::RdChannelResampler::Init(), RdStationDebugWriter::RdStationDebugWriter::Init(), PixelSelectorOG::PixelSelector::Init(), RdChannelUpsampler::RdChannelUpsampler::Init(), RdStationSimPulseFinder::RdStationSimPulseFinder::Init(), RdChannelMedianFilter::RdChannelMedianFilter::Init(), RdChannelTimeSeriesClipper::RdChannelTimeSeriesClipper::Init(), RdEventPostSelector::RdEventPostSelector::Init(), SdBaselineFinderKG::SdBaselineFinderKG::Init(), SdHistogramFitterKG::SdHistogramFitter::Init(), RdChannelNoiseImporter_RD::RdChannelNoiseImporter_RD::Init(), SdHorizontalEventSelectorHOG::SdHorizontalEventSelector::Init(), RdChannelASCIINoiseImporterRD::RdChannelASCIINoiseImporterRD::Init(), MdBiasCorrecterAG::MdBiasCorrecter::Init(), RdStationPulseShapeRejector::RdStationPulseShapeRejector::Init(), SdGainRatioCorrectorKG::SdGainRatioCorrector::Init(), MdADCCalibrationAG::MdADCCalibration::Init(), RdTimeJitterAdder::RdTimeJitterAdder::Init(), SdAreaSelectorWG::SdAreaSelector::Init(), RdChannelDebugWriter::RdChannelDebugWriter::Init(), MdMuonIntegratorAG::MdMuonIntegrator::Init(), SdEventPosteriorSelectorOG::SdEventPosteriorSelector::Init(), FdProfileReconstructorKG::EnergyFitter::Init(), RdChannelSelector::RdChannelSelector::Init(), FdEnergyDepositFinderKG::LateralLightCalculator::Init(), RdChannelBeaconSuppressor::RdChannelBeaconSuppressor::Init(), RdEventPreSelector::RdEventPreSelector::Init(), RdStationPolarizationRejector::RdStationPolarizationRejector::Init(), SdBaselineFinderOG::SdBaselineFinder::Init(), SdHistogramFitterOG::SdHistogramFitter::Init(), SdTraceCalibratorOG::SdTraceCalibrator::Init(), FdProfileConstrainedGeometryFit::ProfileChi2::Init(), FdProfileConstrainedGeometryFitPG::ProfileChi2::Init(), MdEventSelectorAG::MdEventSelector::Init(), DoublePeakDetectorNS::DoublePeakDetector::Init(), TankTriggerSimulatorOG::TankTriggerSimulator::Init(), FdCherenkovFinderOG::FdCherenkovFinder::Init(), RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::Init(), FdEnergyFinderOG::FdEnergyFinder::Init(), FdEnergyDepositFinderKG::ProfileFitter::Init(), RdVirtualStationNoiseImporter::RdVirtualStationNoiseImporter::Init(), SValidStore::Init(), FdEnergyDepositFinderKG::CFMatrixCalculator::Init(), RdChannelNoiseImporter_AERA::RdChannelNoiseImporter_AERA::Init(), MdGeometryFitterAG::MdGeometryFitter::Init(), HybridGeometryFinderWG::HybridGeometryFinder::Init(), MuonProductionDepthFinderGL::MuonProductionDepthFinder::Init(), MdModuleRejectorAG::MdModuleRejector::Init(), FdProfileConstrainedGeometryFitPG::FdProfileConstrainedGeometryFit::Init(), MdPileUpCorrecterAG::MdPileUpCorrecter::Init(), MdPatternFinderAG::MdPatternFinder::Init(), MdMuonEstimatorAG::MdMuonEstimator::Init(), MdMuonCounterAG::MdMuonCounter::Init(), SdEventSelectorOG::SdEventSelector::Init(), MdLDFFinderAG::MdLDFFinder::Init(), fwk::RunController::Init(), PlotGOESNS::PlotGOES::Init(), fwk::MagneticFieldModel::Init(), SdCalibratorOG::SdCalibrator::Init(), G4StationSimulatorOG::G4StationSimulator::Init(), RdChannelNoisePowerAnalyser::RdChannelNoisePowerAnalyser::Init(), FdProfileConstrainedGeometryFitPG::ApertureLight::Init(), FdProfileConstrainedGeometryFit::ApertureLight::Init(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::Init(), MdCounterSimulatorAG::MdCounterSimulator::Init(), UniversalityFitter::UniversalityFitter::Init(), main(), MultipleScatterer::MultipleScatterer(), Reset(), fwk::RunController::Run(), EdepSimulatorAG::ScintillatorConstruction::ScintillatorConstruction(), testShowerImpl::setUp(), testSEventImpl::setUp(), testREventImpl::setUp(), testMEventImpl::setUp(), testFEventImpl::setUp(), testMagneticFieldModel::setUp(), RSQLManagerTest::setUp(), RDetectorTest::setUp(), MDetectorTest::setUp(), testArtificialShowerFile::setUp(), un2::SimpleReco(), sdet::T2Life::T2Life(), testCorsikaShowerFile::testConstruct(), LocalCoordinateSystemTest::testCreate(), testAiresShowerFile::testdEdX(), testRunControllerNonExistentModule::testDoesNotExist(), testCDASEventFile::testEventRead(), CoordinateSystemRegistryTest::testFactory(), CoordinateSystemRegistryTest::testInitSequenceException(), CoordinateSystemRegistryTest::testInvalidCoordinateSystemException(), testAiresShowerFile::testLongitudinalProfile(), testRunControllerStoreEventOnBreak::testModuleConfirmData(), testRunControllerFail::testModuleFail(), testRunControllerFailFinish::testModuleInitAndRun(), CoordinateSystemRegistryTest::testPampaAmarilla(), testSenecaShowerFile::testParticleRead(), testAiresShowerFile::testParticleRead(), testEVAFile::testRead(), testZHAireSFile::testRead(), testCONEXFile::testRead(), testREASFile::testRead(), testSenecaShowerFile::testRead(), testRunController::testSequence(), otoa::fd::UsingGDASProfileDatabase(), otoa::fd::UsingMieAttenuationDatabase(), and WriteConfig().

const Reader * CentralConfig::GetReader ( const std::string &  id)

Get the Reader for moduleConfigLink with given id (XML files)

Definition at line 246 of file CentralConfig.cc.

References DEBUGLOG, and INFO.

Referenced by CentralConfigTest::testParameterOverride().

Branch CentralConfig::GetTopBranch ( const std::string &  id)

Get top branch for moduleConfigLink with given id (XML files)

Though this currently only works for XML, it may be generalized in the future. This will require modifications to the Reader classes.

Definition at line 229 of file CentralConfig.cc.

References RdGeoCeLDFFitter::b, utl::Reader::GetTopBranch(), and utl::Branch::SetWarning().

Referenced by un2::CalcDXCorsikaAtm(), det::VSQLManager::Connect(), fdet::FdChannelMappingManager::FillMaps(), fwk::RunController::Finish(), un2::GetSignal(), un2::GetTimeQuantile(), un2::GetTraceParameters(), MdCornerClippingCorrecterAG::MdCornerClippingCorrecter::Init(), RdChannelResampler::RdChannelResampler::Init(), RdStationDebugWriter::RdStationDebugWriter::Init(), PixelSelectorOG::PixelSelector::Init(), RdChannelUpsampler::RdChannelUpsampler::Init(), RdChannelMedianFilter::RdChannelMedianFilter::Init(), RdChannelTimeSeriesClipper::RdChannelTimeSeriesClipper::Init(), RdStationSimPulseFinder::RdStationSimPulseFinder::Init(), RdEventPostSelector::RdEventPostSelector::Init(), RdChannelNoiseImporter_RD::RdChannelNoiseImporter_RD::Init(), SdBaselineFinderKG::SdBaselineFinderKG::Init(), SdHistogramFitterKG::SdHistogramFitter::Init(), RdChannelASCIINoiseImporterRD::RdChannelASCIINoiseImporterRD::Init(), MdBiasCorrecterAG::MdBiasCorrecter::Init(), SdHorizontalEventSelectorHOG::SdHorizontalEventSelector::Init(), RdStationPulseShapeRejector::RdStationPulseShapeRejector::Init(), MdADCCalibrationAG::MdADCCalibration::Init(), SdGainRatioCorrectorKG::SdGainRatioCorrector::Init(), RdChannelDebugWriter::RdChannelDebugWriter::Init(), RdTimeJitterAdder::RdTimeJitterAdder::Init(), SdAreaSelectorWG::SdAreaSelector::Init(), FdNoiseAdderKG::FdNoiseAdder::Init(), ThresholdCalculatorKG::ThresholdCalculator::Init(), GeometryGeneratorKG::GeometryGenerator::Init(), ProfileSimulatorOG::ProfileSimulator::Init(), MdMuonIntegratorAG::MdMuonIntegrator::Init(), SdEventPosteriorSelectorOG::SdEventPosteriorSelector::Init(), MyPyModuleNS::MyPyModule::Init(), FdProfileReconstructorKG::EnergyFitter::Init(), RdChannelSelector::RdChannelSelector::Init(), ConexShowerGeneratorKG::ConexShowerGenerator::Init(), Sd5T5Tester::Sd5T5Tester::Init(), FdPulseFinderOG::FdPulseFinder::Init(), RdChannelBeaconSuppressor::RdChannelBeaconSuppressor::Init(), FdEnergyDepositFinderKG::LateralLightCalculator::Init(), RdEventPreSelector::RdEventPreSelector::Init(), RdStationPolarizationRejector::RdStationPolarizationRejector::Init(), SdBaselineFinderOG::SdBaselineFinder::Init(), SdRecPlotterOG::SdRecPlotter::Init(), fdDoubleBumpFinder::FdDoubleBumpFinder::Init(), SdHistogramFitterOG::SdHistogramFitter::Init(), SdTraceCalibratorOG::SdTraceCalibrator::Init(), FdProfileConstrainedGeometryFit::ProfileChi2::Init(), FdProfileReconstructorKG::RootCFMatrixOutput::Init(), FdProfileConstrainedGeometryFitPG::ProfileChi2::Init(), MdEventSelectorAG::MdEventSelector::Init(), DoublePeakDetectorNS::DoublePeakDetector::Init(), PrimaryGeneratorKG::PrimaryGenerator::Init(), FdEnergyFinderOG::FdEnergyFinder::Init(), RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::Init(), FdCherenkovFinderOG::FdCherenkovFinder::Init(), LaserLightSimulatorNA::LaserLightSimulator::Init(), atm::ParametricXMLProfileModel::Init(), FdSimEventCheckerOG::FdSimEventChecker::Init(), StereoGeometryFinderOG::StereoGeometryFinder::Init(), FdEnergyDepositFinderKG::ProfileFitter::Init(), FdBackgroundSimulatorOG::FdBackgroundSimulator::Init(), FdEnergyDepositFinderKG::CFMatrixCalculator::Init(), FdProfileFinderOG::FdProfileFinder::Init(), RdVirtualStationNoiseImporter::RdVirtualStationNoiseImporter::Init(), SValidStore::Init(), RdChannelNoiseImporter_AERA::RdChannelNoiseImporter_AERA::Init(), HdAxisFinderUU::HdAxisFinder::Init(), MdGeometryFitterAG::MdGeometryFitter::Init(), HybridGeometryFinderOG::HybridGeometryFinder::Init(), HybridGeometryFinderWG::HybridGeometryFinder::Init(), atm::Nagano2004FluorescenceModel::Init(), ScintillatorLDFFinderKG::ScintillatorLDFFinder::Init(), MuonProductionDepthFinderGL::MuonProductionDepthFinder::Init(), MdModuleRejectorAG::MdModuleRejector::Init(), RdAirplane::RdTransformAds_bLogFile::Init(), RdAirplane::RdAirplaneTiming::Init(), FdProfileConstrainedGeometryFitPG::FdProfileConstrainedGeometryFit::Init(), FdEventLoggerGS::FdEventLogger::Init(), MdPileUpCorrecterAG::MdPileUpCorrecter::Init(), FdLaserEnergyReconstructorKG::FdLaserEnergyReconstructor::Init(), UserModule::Init(), MdPatternFinderAG::MdPatternFinder::Init(), LDFTestKG::LDFTest::Init(), MdMuonEstimatorAG::MdMuonEstimator::Init(), MdMuonCounterAG::MdMuonCounter::Init(), SdEventSelectorOG::SdEventSelector::Init(), RdAirplane::RdAirplaneArrivalDirectionSetter::Init(), FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::Init(), MdLDFFinderAG::MdLDFFinder::Init(), FdElectronicsSimulatorOG::FdElectronicsSimulator::Init(), fwk::RunController::Init(), LDFFinderOG::LDFFinder::Init(), SdSimpleSimKG::SdSimpleSim::Init(), fwk::MagneticFieldModel::Init(), SdCalibratorOG::SdCalibrator::Init(), RdChannelNoisePowerAnalyser::RdChannelNoisePowerAnalyser::Init(), DrumPhotonGeneratorOG::DrumPhotonGenerator::Init(), FdProfileReconstructorKG::FdProfileReconstructor::Init(), FdTriggerSimulatorOG::FdTriggerSimulator::Init(), FdProfileConstrainedGeometryFitPG::ApertureLight::Init(), FdProfileConstrainedGeometryFit::ApertureLight::Init(), SdHorizontalReconstructionNS::SdHorizontalReconstruction::Init(), atm::ParametricXMLRayleighModel::Init(), SdSimMuonNumberFitterNS::SdSimMuonNumberFitter::Init(), SdCompParam::SdCompositionParameters::Init(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::Init(), FdApertureLightFinderKG::FdApertureLightFinder::Init(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::Init(), MdCounterSimulatorAG::MdCounterSimulator::Init(), UniversalityFitter::UniversalityFitter::Init(), MultipleScatterer::MultipleScatterer(), EdepSimulatorAG::PrimaryGenerator::PrimaryGenerator(), fwk::RunController::Run(), G4TankSimulatorOG::G4TankConstruction::SetXMLParameters(), G4TankSimulatorASCII::G4TankConstruction::SetXMLParameters(), G4XTankSimulatorAG::G4XTankConstruction::SetXMLParameters(), G4StationSimulatorOG::G4StationConstruction::SetXMLParameters(), un2::SimpleReco(), GroundPropagatorAG::SoilConstruction::SoilConstruction(), sdet::T2Life::T2Life(), CentralConfigTest::testConfigLinkOverride(), CentralConfigTest::testGetSomeData(), CentralConfigTest::testParameterOverride(), otoa::fd::UsingGDASProfileDatabase(), and otoa::fd::UsingMieAttenuationDatabase().

CentralConfig::IdIterator CentralConfig::IdsBegin ( )

Id's begin.

Definition at line 947 of file CentralConfig.cc.

CentralConfig::IdIterator CentralConfig::IdsEnd ( )

Id's end.

Definition at line 954 of file CentralConfig.cc.

void CentralConfig::LogBootstrap ( )
private

Definition at line 872 of file CentralConfig.cc.

References RdGeoCeLDFFitter::a, and RdGeoCeLDFFitter::c.

void CentralConfig::ReadConfig ( const std::string &  bootstrapFile)
private
void CentralConfig::ReplaceParameters ( const utl::Branch b)
private

Parse the replacementParameters branch of bootstrap file and replace parameters specified there in the appropriate configuration document. Then, revalidate the document to ensure that replacement XML obeys the schema of the original.

Definition at line 479 of file CentralConfig.cc.

References fwk::AsXML(), ERROR, utl::Branch::GetFirstChild(), utl::Branch::GetNextSibling(), fwk::ConfigLink::GetReader(), utl::Reader::GetTopBranch(), and utl::Branch::String().

void CentralConfig::Reset ( const std::string &  bootstrapFileName,
const bool  fingerprintFatal = false,
const bool  validate = true 
)
staticprotected

Definition at line 145 of file CentralConfig.cc.

References RdGeoCeLDFFitter::b, and GetInstance().

void CentralConfig::WriteConfig ( const std::string &  fileName = "")

Get the link name for moduleConfigLink with given id (any)

Write configuration to file

Definition at line 777 of file CentralConfig.cc.

References GetConfig(), and out.

Referenced by main(), CentralConfigTest::testCreation(), CentralConfigTest::testLog(), and WriteConfig().

Member Data Documentation

utl::Reader* fwk::CentralConfig::fBootstrapReader = nullptr
private

Definition at line 148 of file CentralConfig.h.

std::stringstream fwk::CentralConfig::fConfigInfo
private

Definition at line 139 of file CentralConfig.h.

bool fwk::CentralConfig::fConfigInfoIsValid = false
private

Definition at line 140 of file CentralConfig.h.

std::map<std::string, ConfigLink> fwk::CentralConfig::fConfigMap
private

Definition at line 136 of file CentralConfig.h.

std::multimap<std::string, std::string> fwk::CentralConfig::fConfigTimeFingerMap
private

Definition at line 143 of file CentralConfig.h.

CentralConfig * fwk::CentralConfig::fgInstance = nullptr
staticprotected

Definition at line 115 of file CentralConfig.h.

bool fwk::CentralConfig::fgIsInitialized = false
staticprivate

Definition at line 135 of file CentralConfig.h.

bool fwk::CentralConfig::fgValidate = true
staticprivate

Definition at line 150 of file CentralConfig.h.

std::string fwk::CentralConfig::fInstallPath
private

Definition at line 152 of file CentralConfig.h.

Referenced by GetInstallPath().

std::set<std::string> fwk::CentralConfig::fMd5Excludes
private

Definition at line 137 of file CentralConfig.h.

Referenced by FillMd5Excludes().

std::list<std::string> fwk::CentralConfig::fMismatchedMd5List
private

Definition at line 146 of file CentralConfig.h.

std::list<std::string> fwk::CentralConfig::fNoMd5List
private

Definition at line 145 of file CentralConfig.h.

std::set<std::string> fwk::CentralConfig::fUsedConfigs
private

Definition at line 138 of file CentralConfig.h.


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

, generated on Tue Sep 26 2023.