emcDataStorageMap Class Reference
[Tower calibration]

#include <emcDataStorageMap.h>

List of all members.


Detailed Description

Small utility class to gather calibration data storage sources or destinations.

Definition at line 20 of file emcDataStorageMap.h.

Public Member Functions

 emcDataStorageMap (emcManageable::EStorage def=emcManageable::kDB_Pg)
 The ctor param will be the default storage returned when using the storage() method.
void clear ()
 Make this object empty.
bool empty () const
 Whether this object is empty or not.
bool parse (const std::string &str)
 Fill this object by parsing the given string str.
emcManageable::EStorage storage () const
 Return the default storage, irrespective of calib. data type.
emcManageable::EStorage storage (const std::string &what) const
 Return the storage for calib. data type = what.
bool storage (const std::string &what, const std::string &storagename)
 Set the storage source/destination of calib.
std::vector< std::string > knownStorages () const
 Return the list of storages for which we have sources/destinations.
void print (std::ostream &out=std::cout) const
emcManageable::EStorage storage (const char *what) const
 For access from CINT, same as above, but with const char* instead of std::string.
bool storage (const char *what, const char *storagename)

Private Types

typedef std::map< const std::string,
emcManageable::EStorage
TMAP

Private Attributes

emcManageable::EStorage fDefaultStorage
TMAP fMap


Member Typedef Documentation

typedef std::map<const std::string, emcManageable::EStorage> emcDataStorageMap::TMAP [private]
 

Definition at line 78 of file emcDataStorageMap.h.


Constructor & Destructor Documentation

emcDataStorageMap::emcDataStorageMap emcManageable::EStorage  def = emcManageable::kDB_Pg  ) 
 

The ctor param will be the default storage returned when using the storage() method.

Definition at line 46 of file emcDataStorageMap.C.


Member Function Documentation

void emcDataStorageMap::clear  ) 
 

Make this object empty.

Definition at line 53 of file emcDataStorageMap.C.

References fMap.

Referenced by emcBadModulesv1::Reset().

bool emcDataStorageMap::empty  )  const
 

Whether this object is empty or not.

By empty we mean that the internal map is empty, i.e. storage(what,source) has never been called for instance.

Definition at line 60 of file emcDataStorageMap.C.

References fMap.

Referenced by mEmcCalibratorModulev2::mEmcCalibratorModulev2(), and storage().

std::vector< std::string > emcDataStorageMap::knownStorages  )  const
 

Return the list of storages for which we have sources/destinations.

Definition at line 67 of file emcDataStorageMap.C.

References fMap.

Referenced by mEmcCalibratorModulev2::mEmcCalibratorModulev2().

bool emcDataStorageMap::parse const std::string &  str  ) 
 

Fill this object by parsing the given string str.

where str is of the form "what1:source1,what2:source2,...", e.g. "Pedestals5:None,Gains:Pg,HLRatios:ASCII File". For the list of valid source strings, please see class emcManageable.

Returns:
true if str is well formed (in which case the internal map is replaced with the content of str). or false otherwise (in which case the object will be unchanged).

Definition at line 82 of file emcDataStorageMap.C.

References error(), and split().

void emcDataStorageMap::print std::ostream &  out = std::cout  )  const
 

Definition at line 179 of file emcDataStorageMap.C.

References fMap, and emcManageable::GetStorageName().

Referenced by operator<<().

bool emcDataStorageMap::storage const char *  what,
const char *  storagename
 

Definition at line 172 of file emcDataStorageMap.C.

References storage().

emcManageable::EStorage emcDataStorageMap::storage const char *  what  )  const
 

For access from CINT, same as above, but with const char* instead of std::string.

Definition at line 138 of file emcDataStorageMap.C.

References storage().

bool emcDataStorageMap::storage const std::string &  what,
const std::string &  storagename
 

Set the storage source/destination of calib.

type = what. Please note that we're picky on the storage name syntax. See emcManageable class.

Definition at line 145 of file emcDataStorageMap.C.

References fMap, and emcManageable::GetStorage().

emcManageable::EStorage emcDataStorageMap::storage const std::string &  what  )  const
 

Return the storage for calib. data type = what.

Definition at line 121 of file emcDataStorageMap.C.

References empty(), fDefaultStorage, and fMap.

emcManageable::EStorage emcDataStorageMap::storage  )  const
 

Return the default storage, irrespective of calib. data type.

Definition at line 114 of file emcDataStorageMap.C.

References fDefaultStorage.

Referenced by emcBadModulesv1::CollectOnlineQA(), emcBadModulesv1::CollectPhysicsQA(), emcBadModulesv1::ComputeMaps(), mEmcCalibratorModulev2::mEmcCalibratorModulev2(), and storage().


Member Data Documentation

emcManageable::EStorage emcDataStorageMap::fDefaultStorage [private]
 

Definition at line 77 of file emcDataStorageMap.h.

Referenced by storage().

TMAP emcDataStorageMap::fMap [private]
 

Definition at line 79 of file emcDataStorageMap.h.

Referenced by clear(), empty(), knownStorages(), print(), and storage().


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