List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
det::VManager Class Referenceabstract

Interface for detector managers. More...

#include "det/VManager.h"

Inheritance diagram for det::VManager:
Inheritance graph
[legend]

Classes

class  Handle
 

Public Types

typedef std::map< std::string,
std::string > 
IndexMap
 
enum  Status { eFound, eNotFound }
 Specifies success or (eventually) various possible failure modes. More...
 

Public Member Functions

virtual Status GetData (double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (int &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (bool &, const std::string &componentProperty, const std::string &componentName, const VManager::IndexMap &) const
 
virtual Status GetData (std::string &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::vector< double > &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::vector< int > &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::vector< std::string > &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::vector< bool > &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::list< double > &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::list< int > &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::list< std::string > &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::list< std::pair< int, int >> &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (utl::TabulatedFunction &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::map< int, utl::TabulatedFunction > &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (utl::TabulatedFunctionComplexLgAmpPhase &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::map< std::string, double > &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
 
virtual Status GetData (std::vector< std::vector< int >> &, const std::string &componentProperty, const std::string &componentName, const VManager::IndexMap &) const
 
virtual Status GetData (std::map< unsigned int, int > &, const std::string &componentProperty, const std::string &componentName, const VManager::IndexMap &) const
 
Status GetData (Handle &returnData, const std::string &component, const std::string &property, const IndexMap &index=IndexMap()) const
 new data accessor More...
 
const std::string & GetName () const
 
virtual void Init (const std::string &configLink)
 Manager Initialization. configLink is the CentralConfig hook for the configuration file. More...
 
bool IsInitialized () const
 
void SetName (const std::string &name)
 
void SetReportingErrors (const bool flag=true)
 Generic data accessors. More...
 
 VManager ()
 
 VManager (const std::string &name)
 
virtual ~VManager ()
 

Static Public Member Functions

template<typename T >
static T FindComponent (const std::string &componentName, const IndexMap &componentIndex)
 
template<typename T , typename U >
static T FindComponent (const std::string &componentName, const U &defaultValue, const IndexMap &componentIndex)
 
static std::string QueryInfoMessage (const Handle &returnData, const std::string &component)
 
static std::string QueryInfoMessage (const Handle &returnData, const std::string &component, const std::string &property, const IndexMap &index)
 
static std::string QueryInfoMessage (const std::string &componentProperty, const std::string &componentName)
 
static std::string QueryInfoMessage (const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex)
 

Protected Member Functions

template<typename T >
void AddAvailability (const std::string &component)
 
void FindConfig (const std::string &configLink)
 Locate the configuration file in CentralConfig and make a Reader for it. More...
 
bool IsReportingErrors () const
 
std::string NotImplementedMessage (const std::string &type, const std::string &componentProperty, const std::string &componentName) const
 

Protected Attributes

std::set< std::string > fAvailableComponents
 
utl::Branch fBranch
 
bool fIsInitialized = false
 
bool fReportingErrors = false
 

Private Types

typedef std::map< std::string,
ComponentSet
AvailabilityMap
 
typedef std::set< std::string > ComponentSet
 

Private Member Functions

void AddAvailability (const std::string &typeIdName, const std::string &component)
 
bool CanAnswer (const Handle &returnData, const std::string &component) const
 
Status CheckedGetData (Handle &returnData, const std::string &component, const std::string &property, const IndexMap &index) const
 
virtual Status GenericGetData (Handle &returnData, const std::string &component, const std::string &property, const IndexMap &index) const =0
 

Private Attributes

AvailabilityMap fAvailability
 
std::string fName
 

Detailed Description

Interface for detector managers.

This protocol class provides a common interface for all detector managers and manager registers. Any property of any component in the detector is assumed to be identifiable by two strings representing the component property and component name, together with an arbitrarily large map of (index type, index number) which identifies the instance of the component. The interface defines the format for passing this information between the detector interface and either a detector manager or a detector manager register.

Author
T. Paul
D. Veberic
Date
03 Feb 2003
12 Jan 2007 DV update

Definition at line 115 of file VManager.h.

Member Typedef Documentation

typedef std::map<std::string, ComponentSet> det::VManager::AvailabilityMap
private

Definition at line 414 of file VManager.h.

typedef std::set<std::string> det::VManager::ComponentSet
private

Definition at line 413 of file VManager.h.

typedef std::map<std::string, std::string> det::VManager::IndexMap

Definition at line 133 of file VManager.h.

Member Enumeration Documentation

Specifies success or (eventually) various possible failure modes.

Various failure modes to be specified (for example, failure to connect to db, faiure to find db record, failure to find table name, etc

Enumerator
eFound 
eNotFound 

Definition at line 127 of file VManager.h.

Constructor & Destructor Documentation

det::VManager::VManager ( )
inline

Definition at line 117 of file VManager.h.

det::VManager::VManager ( const std::string &  name)
inline

Definition at line 119 of file VManager.h.

virtual det::VManager::~VManager ( )
inlinevirtual

Definition at line 121 of file VManager.h.

Member Function Documentation

template<typename T >
void det::VManager::AddAvailability ( const std::string &  component)
inlineprotected

Definition at line 347 of file VManager.h.

void det::VManager::AddAvailability ( const std::string &  typeIdName,
const std::string &  component 
)
inlineprivate

Definition at line 365 of file VManager.h.

References fAvailability.

bool det::VManager::CanAnswer ( const Handle returnData,
const std::string &  component 
) const
private

Definition at line 78 of file VManager.cc.

References det::VManager::Handle::GetTypeIdName(), INFO, and WARNING.

Referenced by CheckedGetData().

Status det::VManager::CheckedGetData ( Handle returnData,
const std::string &  component,
const std::string &  property,
const IndexMap index 
) const
inlineprivate

Definition at line 371 of file VManager.h.

References CanAnswer(), eFound, eNotFound, GenericGetData(), GetName(), IsReportingErrors(), QueryInfoMessage(), and WARNING.

Referenced by GetData().

template<typename T >
static T det::VManager::FindComponent ( const std::string &  componentName,
const IndexMap componentIndex 
)
inlinestatic

Definition at line 307 of file VManager.h.

References ERROR.

template<typename T , typename U >
static T det::VManager::FindComponent ( const std::string &  componentName,
const U defaultValue,
const IndexMap componentIndex 
)
inlinestatic

Definition at line 322 of file VManager.h.

void det::VManager::FindConfig ( const std::string &  configLink)
protected

Locate the configuration file in CentralConfig and make a Reader for it.

Definition at line 25 of file VManager.cc.

References ERROR, and WARNING.

virtual Status det::VManager::GenericGetData ( Handle returnData,
const std::string &  component,
const std::string &  property,
const IndexMap index 
) const
privatepure virtual

In the new interface, every manager has to implement only this method Since the reference to the return data is passed around with a void pointer, for easier identification of the wanted object typeIdName string is also passed around. In the manager code you can easily identifiy with what object the public templated GetData (above) was called with e.g.

if (returnData.Is<TPCInfo>()) {
TPCInfo& tpcInfo = returnData.Get<TPCInfo>();
... fill tpcInfo ...
return eFound;
} else
return eNotFound;

Implemented in det::ManagerRegister, sdet::SModelsXMLManager, cdet::CModelsXMLManager, and rdet::RBadStationSQLManager.

Referenced by CheckedGetData().

virtual Status det::VManager::GetData ( double &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual

Implemented in det::ManagerRegister, fdet::FdUpTimeFileManager, fdet::FdUpTimeSQLManager, and fwk::TestSQLManager.

Referenced by atm::AerosolDB::AerosolDB(), atm::MolecularZone::CacheLayers(), fdet::Telescope::CachePixelCloudData(), atm::VZone::CacheSlices(), atm::AerosolDB::CacheZones(), atm::LidarDB::CacheZones(), atm::MolecularDB::CacheZones(), cdet::CDetector::FetchStationGroups(), atm::GOESDB::GetAllCloudProbabilities(), rdet::AntennaType::GetAntennaData(), fdet::Camera::GetCameraChannelData(), fdet::Camera::GetCameraData(), fdet::Camera::GetCameraDataDiaphragm(), fdet::Camera::GetCameraPixelData(), fdet::Channel::GetChannelData(), rdet::Channel::GetChannelData(), atm::LidarZone::GetCloudData(), fdet::Corrector::GetCorrectorData(), rdet::RDetector::GetDetectorData(), fdet::Diaphragm::GetDiaphragmData(), fdet::Eye::GetEyeData(), fdet::FDetector::GetFDetectorData(), fdet::Filter::GetFilterData(), fdet::FDetector::GetFullEyeList(), rdet::RDetector::GetFullStationList(), cdet::CDetector::GetFullStationList(), atm::VZoneSlice::GetLambdaSliceData(), atm::MolecularLayer::GetLayerData(), fdet::Mirror::GetMirrorData(), fdet::MirrorSegment::GetMirrorSegmentData(), fdet::Pixel::GetPixelData(), fdet::Pixel::GetPixelDataDiaphragm(), cdet::Station::GetRPCData(), sdet::Scintillator::GetScintillatorData(), atm::VZoneSlice::GetSliceData(), rdet::RSimulationStationListManager::GetSourceType(), cdet::CDetector::GetStation(), rdet::Station::GetStationData(), cdet::Station::GetStationData(), fdet::Telescope::GetTelescopeData(), atm::GOESDB::HasData(), atm::LidarDB::LidarDB(), atm::LidarZone::LidarZone(), atm::MolecularDB::MolecularDB(), atm::MolecularZone::MolecularZone(), rdet::Station::SetListOfChannelIds(), and det::ComponentGroup< P, C, Creator, ManagerProvider >::Update().

virtual Status det::VManager::GetData ( int &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( bool &  ,
const std::string &  componentProperty,
const std::string &  componentName,
const VManager::IndexMap  
) const
inlinevirtual

Definition at line 241 of file VManager.h.

virtual Status det::VManager::GetData ( std::string &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::vector< double > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::vector< int > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::vector< std::string > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::vector< bool > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::list< double > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::list< int > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::list< std::string > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::list< std::pair< int, int >> &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( utl::TabulatedFunction returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::map< int, utl::TabulatedFunction > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( utl::TabulatedFunctionComplexLgAmpPhase returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::map< std::string, double > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtual
virtual Status det::VManager::GetData ( std::vector< std::vector< int >> &  ,
const std::string &  componentProperty,
const std::string &  componentName,
const VManager::IndexMap  
) const
inlinevirtual

Definition at line 255 of file VManager.h.

virtual Status det::VManager::GetData ( std::map< unsigned int, int > &  ,
const std::string &  componentProperty,
const std::string &  componentName,
const VManager::IndexMap  
) const
inlinevirtual

Definition at line 256 of file VManager.h.

Status det::VManager::GetData ( Handle returnData,
const std::string &  component,
const std::string &  property,
const IndexMap index = IndexMap() 
) const
inline

new data accessor

Any property of the detector is supposed to be accessible through this interface. Interface specifies the name of the property and the component to which it belongs, together with a map of (index name, index value) identifying the specific instance of the component. For example, to request the quantum efficiency of PMT 3 in station 57, one would have

  • component = "PMT"
  • property = "quantumEfficiency"
  • index["stationId"] = "57"
  • index["PMT"] = "3"

Definition at line 275 of file VManager.h.

References CheckedGetData().

const std::string& det::VManager::GetName ( ) const
inline
void det::VManager::Init ( const std::string &  configLink)
virtual

Manager Initialization. configLink is the CentralConfig hook for the configuration file.

This method instructs the manager to initialize itself. In the case of a manager which fetches data from an XML file, configuration involves getting the link to the appropriate configuration file from the CentralConfig and parsing the file to create a DOM or some other representation of the data in memory. For a manager which uses a MySQL database, configuration involves getting the link to the appropriate configuration file from the CentralConfig, then using the instructions in that file to establish a connection to the relevant database.

Note that one might initially think it makes more sense to just initialize managers automatically in their constructors so that developers don't need to remember to explicitly invoke the Init() method. (In fact it worked like this in an earlier version.) The rationale for not having automatic configuration via the constructors is that the configuration can now be delayed until the time that the user specifically requests a particular manager, rather than doing it at the time that the Detector object constructs the Managers. For example, when the user declares his set of desired managers in the ManagerRegister configuration, only those particular Managers will get initialized (though all available Managers will be constructed!). Consider someone who wants to test only the Fluorescence portion of the detector. By requiring explicit invocation of Init() one avoids providing hooks to all the SD related configuration files and databases which aren't even going to be used. Though the SD Managers will be constructed, no attempt will be made to Initialize them until the user specifically requests them by, for example, specifying them in the configuration file for the appropriate ManagerRegister.

Reimplemented in fdet::FdUpTimeFileManager, sdet::T2LifeROOTFileManager, sdet::T2LifeFileManager, rdet::RChannelSQLManager, fdet::FdUpTimeSQLManager, rdet::RBadStationSQLManager, fdet::FdChannelMappingManager, det::ManagerRegister, det::VSQLManager, det::VSQLManager, rdet::RBeaconSQLManager, sdet::SDenseStationListXMLManager, rdet::RModelsXMLManager, rdet::RSimulationStationListManager, sdet::T2StatFileManager, fdet::EventPointingManager, fdet::FCalibSQLManager, rdet::RAntennaTypeXMLManager, rdet::RHardwareProfileXMLManager, rdet::MonitoringSQLManager, sdet::SModelsXMLManager, fdet::FModelsXMLManager, cdet::CModelsXMLManager, rdet::RStationListSQLManager, fdet::FOpticalEfficiencyLossSQLManager, cdet::CStationListXMLManager, rdet::RStationListXMLManager, fdet::FFixCalibManager, fdet::FSimulationCalibManager, sdet::EventStationPositionsManager, sdet::SStationListSQLManager, sdet::SStationListXMLManager, fdet::FFixOpticalEfficiencyLossManager, fdet::FParametricOpticalEfficiencyLossManager, and fdet::FdAlwaysUpManager.

Definition at line 16 of file VManager.cc.

Referenced by sdet::T2LifeFileManager::Init(), and det::ManagerRegister::InterpretXML().

bool det::VManager::IsInitialized ( ) const
inline

Definition at line 214 of file VManager.h.

References fIsInitialized.

Referenced by det::ManagerRegister::InterpretXML().

bool det::VManager::IsReportingErrors ( ) const
inlineprotected
string det::VManager::NotImplementedMessage ( const std::string &  type,
const std::string &  componentProperty,
const std::string &  componentName 
) const
protected

Definition at line 47 of file VManager.cc.

string det::VManager::QueryInfoMessage ( const Handle returnData,
const std::string &  component 
)
static
string det::VManager::QueryInfoMessage ( const Handle returnData,
const std::string &  component,
const std::string &  property,
const IndexMap index 
)
static

Definition at line 119 of file VManager.cc.

static std::string det::VManager::QueryInfoMessage ( const std::string &  componentProperty,
const std::string &  componentName 
)
inlinestatic

Definition at line 294 of file VManager.h.

string det::VManager::QueryInfoMessage ( const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
)
static

Definition at line 58 of file VManager.cc.

void det::VManager::SetName ( const std::string &  name)
inline

Definition at line 332 of file VManager.h.

References fName.

Referenced by det::ManagerRegister::InterpretXML().

void det::VManager::SetReportingErrors ( const bool  flag = true)
inline

Generic data accessors.

Any property of the detector is supposed to be accessible through this interface. Interface specifies the name of the property and the component to which it belongs, together with a map of (index name, index value) identifying the specific instance of the component. For example, to request the quantum efficiency of PMT 3 in station 57, one would have

  • componentProperty = "quantumEfficiency"
  • componentName = "PMT"
  • componentIndex["stationId"] = "57"
  • componentIndex["PMT"] = "3"

Definition at line 231 of file VManager.h.

References fReportingErrors.

Member Data Documentation

AvailabilityMap det::VManager::fAvailability
private

Definition at line 415 of file VManager.h.

Referenced by AddAvailability().

std::set<std::string> det::VManager::fAvailableComponents
protected
utl::Branch det::VManager::fBranch
protected
bool det::VManager::fIsInitialized = false
mutableprotected

Definition at line 354 of file VManager.h.

Referenced by IsInitialized().

std::string det::VManager::fName
private

Definition at line 411 of file VManager.h.

Referenced by GetName(), and SetName().

bool det::VManager::fReportingErrors = false
protected

Definition at line 356 of file VManager.h.

Referenced by IsReportingErrors(), and SetReportingErrors().


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

, generated on Tue Sep 26 2023.