List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
sdet::T2LifeROOTFileManager Class Referenceabstract

Class to manage Sd life time ROOT files. More...

#include <T2LifeROOTFileManager.h>

Inheritance diagram for sdet::T2LifeROOTFileManager:
Inheritance graph
[legend]

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
 
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...
 
 T2LifeROOTFileManager ()
 
virtual ~T2LifeROOTFileManager ()
 

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< unsigned int,
IndexEntry >::const_iterator 
ConstIndexIterator
 
typedef std::map< unsigned int,
IndexEntry
Index
 
typedef std::pair< unsigned
int, unsigned int > 
IndexEntry
 
typedef std::map< unsigned int,
IndexEntry >::iterator 
IndexIterator
 

Private Member Functions

Status GetOkFlag (int &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
 
int GetStationIndex (const IndexMap &componentIndex) const
 
bool ReadData () const
 

Private Attributes

TTree * fDataTree = nullptr
 
det::ValidityStamp fDataValidity
 
std::string fFileName
 
Index fIndex
 
std::vector< unsigned int > fStationList
 
VMANAGER_GETDATA_HANDLE_DENIED int fVerbosity
 

Static Private Attributes

static const double fgSearchMapBinning = 10000
 

Detailed Description

Class to manage Sd life time ROOT files.

Identical functionality as T2LifeFileManager, but much more user-friendly and better performance. The input data file is a single relatively small ROOT file containing a TTree, which contains an identical image of the corresponding ASCII T2-information. The needed ROOT data file can be obtained from http://augerobserver.fzk.de/fileadmin/user_upload/AugerData/UpTime/v1r0_ICRC07/T2Life.root (~64MB)
A small and simple program, which can be used for the conversion from T2 ASCII data to ROOT data looks like:

// **************************************************
//
// T2toRoot.cc
//
// converts T2 ASCII files to root tree
//
// v1.0 04/02/06 Michael.Unger@ik.fzk.de
//
// **************************************************
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <TBits.h>
#include <TFile.h>
#include <TTree.h>
using namespace std;
int main(int argc, char *argv[] ) {
if(argc<2) {
cout << "usage: T2toRoot <files>" << endl;
return 1;
}
int j=1;
string line;
ifstream * inFile;
const int kMaxStation=1600;
TBits * stationArray = new TBits(kMaxStation);
unsigned int gpsStart;
unsigned int gpsStop;
TFile rootFile("/userdata/Fabian/AugerUpTime/NewFiles/T2Life.root","RECREATE");
TTree * theTree = new TTree("T2Life","T2 lifetimes");
theTree->Branch("gpsStart",&gpsStart,"gpsStart/i");
theTree->Branch("gpsStop",&gpsStop,"gpsStop/i");
theTree->Branch("stationArray","TBits",&stationArray,16000,99);
while ( argv[j] != NULL ) {
cout << " ---> " << argv[j] << endl;
inFile = new ifstream(argv[j]);
while (getline(*inFile, line)) { // find next valid line
stationArray->ResetAllBits();
istringstream buffer;
buffer.str(line);
buffer >> gpsStart >> gpsStop;
int iStation=100;
int flag;
while ( buffer >> flag) {
if(flag)
stationArray->SetBitNumber(iStation,true);
iStation++;
}
theTree->Fill();
}
delete inFile;
j++;
}
rootFile.cd();
rootFile.Write();
rootFile.Close();
}
Author
Ralf Ulrich
Date
Wed Nov 22 00:59:29 CET 2006

Definition at line 94 of file T2LifeROOTFileManager.h.

Member Typedef Documentation

typedef std::map<unsigned int, IndexEntry>::const_iterator sdet::T2LifeROOTFileManager::ConstIndexIterator
private

Definition at line 149 of file T2LifeROOTFileManager.h.

typedef std::map<unsigned int, IndexEntry> sdet::T2LifeROOTFileManager::Index
private

Definition at line 147 of file T2LifeROOTFileManager.h.

typedef std::pair<unsigned int, unsigned int> sdet::T2LifeROOTFileManager::IndexEntry
private

Definition at line 146 of file T2LifeROOTFileManager.h.

typedef std::map<unsigned int, IndexEntry>::iterator sdet::T2LifeROOTFileManager::IndexIterator
private

Definition at line 148 of file T2LifeROOTFileManager.h.

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

Definition at line 133 of file VManager.h.

Member Enumeration Documentation

enum det::VManager::Status
inherited

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

sdet::T2LifeROOTFileManager::T2LifeROOTFileManager ( )
inline

Definition at line 97 of file T2LifeROOTFileManager.h.

virtual sdet::T2LifeROOTFileManager::~T2LifeROOTFileManager ( )
inlinevirtual

Definition at line 98 of file T2LifeROOTFileManager.h.

Member Function Documentation

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

Definition at line 347 of file VManager.h.

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

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 
)
inlinestaticinherited

Definition at line 322 of file VManager.h.

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

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::GetData ( double &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited

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 virtualinherited
virtual Status det::VManager::GetData ( bool &  ,
const std::string &  componentProperty,
const std::string &  componentName,
const VManager::IndexMap  
) const
inlinevirtualinherited

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 virtualinherited
virtual Status det::VManager::GetData ( std::vector< double > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( std::vector< int > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( std::vector< std::string > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( std::vector< bool > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( std::list< double > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( std::list< int > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( std::list< std::string > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
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 virtualinherited
virtual Status det::VManager::GetData ( utl::TabulatedFunction returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( std::map< int, utl::TabulatedFunction > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( utl::TabulatedFunctionComplexLgAmpPhase returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( std::map< std::string, double > &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
pure virtualinherited
virtual Status det::VManager::GetData ( std::vector< std::vector< int >> &  ,
const std::string &  componentProperty,
const std::string &  componentName,
const VManager::IndexMap  
) const
inlinevirtualinherited

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
inlinevirtualinherited

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
inlineinherited

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 det::VManager::CheckedGetData().

const std::string& det::VManager::GetName ( ) const
inlineinherited
VManager::Status T2LifeROOTFileManager::GetOkFlag ( int &  returnData,
const std::string &  componentProperty,
const std::string &  componentName,
const IndexMap componentIndex 
) const
private

Definition at line 172 of file T2LifeROOTFileManager.cc.

References WARNING.

int T2LifeROOTFileManager::GetStationIndex ( const IndexMap componentIndex) const
private

Definition at line 417 of file T2LifeROOTFileManager.cc.

References INFO_TERSE.

void T2LifeROOTFileManager::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 from det::VManager.

Definition at line 48 of file T2LifeROOTFileManager.cc.

References file, INFO, INFO_TERSE, fwk::CoordinateSystemRegistry::Init(), max, galactic::second, and WARNING.

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

Definition at line 214 of file VManager.h.

References det::VManager::fIsInitialized.

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

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

Definition at line 47 of file VManager.cc.

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

Definition at line 119 of file VManager.cc.

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

Definition at line 294 of file VManager.h.

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

Definition at line 58 of file VManager.cc.

bool T2LifeROOTFileManager::ReadData ( ) const
private

Definition at line 242 of file T2LifeROOTFileManager.cc.

References ERROR, and INFO.

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

Definition at line 332 of file VManager.h.

References det::VManager::fName.

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

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

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 det::VManager::fReportingErrors.

Member Data Documentation

std::set<std::string> det::VManager::fAvailableComponents
protectedinherited
utl::Branch det::VManager::fBranch
protectedinherited
TTree* sdet::T2LifeROOTFileManager::fDataTree = nullptr
private

Definition at line 135 of file T2LifeROOTFileManager.h.

det::ValidityStamp sdet::T2LifeROOTFileManager::fDataValidity
mutableprivate

Definition at line 141 of file T2LifeROOTFileManager.h.

std::string sdet::T2LifeROOTFileManager::fFileName
private

Definition at line 133 of file T2LifeROOTFileManager.h.

const double T2LifeROOTFileManager::fgSearchMapBinning = 10000
staticprivate

Definition at line 145 of file T2LifeROOTFileManager.h.

Index sdet::T2LifeROOTFileManager::fIndex
private

Definition at line 150 of file T2LifeROOTFileManager.h.

bool det::VManager::fIsInitialized = false
mutableprotectedinherited

Definition at line 354 of file VManager.h.

Referenced by det::VManager::IsInitialized().

bool det::VManager::fReportingErrors = false
protectedinherited
std::vector<unsigned int> sdet::T2LifeROOTFileManager::fStationList
mutableprivate

Definition at line 142 of file T2LifeROOTFileManager.h.

VMANAGER_GETDATA_HANDLE_DENIED int sdet::T2LifeROOTFileManager::fVerbosity
private

Definition at line 132 of file T2LifeROOTFileManager.h.


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

, generated on Tue Sep 26 2023.