SFrame 3.6
core/include/SCycleConfig.h
Go to the documentation of this file.
00001 // Dear emacs, this is -*- c++ -*-
00002 // $Id: SCycleConfig.h 331 2012-11-20 17:12:44Z krasznaa $
00003 /***************************************************************************
00004  * @Project: SFrame - ROOT-based analysis framework for ATLAS
00005  * @Package: Core
00006  *
00007  * @author Stefan Ask       <Stefan.Ask@cern.ch>           - Manchester
00008  * @author David Berge      <David.Berge@cern.ch>          - CERN
00009  * @author Johannes Haller  <Johannes.Haller@cern.ch>      - Hamburg
00010  * @author A. Krasznahorkay <Attila.Krasznahorkay@cern.ch> - CERN/Debrecen
00011  *
00012  ***************************************************************************/
00013 
00014 #ifndef SFRAME_CORE_SCycleConfig_H
00015 #define SFRAME_CORE_SCycleConfig_H
00016 
00017 // STL include(s):
00018 #include <vector>
00019 //#include <bits/stl_pair.h> // I have to include <map> here, because rootcint can't
00020 #include <map>               // understand <bits/stl_pair.h> in Athena for some reason...
00021 
00022 // ROOT include(s):
00023 #include <TNamed.h>
00024 #include <TString.h>
00025 
00026 // Local include(s):
00027 #include "SInputData.h"
00028 #include "SError.h"
00029 #include "SMsgType.h"
00030 
00042 class SCycleConfig : public TNamed {
00043 
00044 public:
00046    SCycleConfig( const char* name = "SCycleConfig" );
00047 
00049    const TString& GetCycleName() const;
00051    void SetCycleName( const TString& name );
00052 
00054 
00059    enum RunMode {
00060       LOCAL, 
00061       PROOF  
00062    };
00064    typedef std::vector< std::pair< std::string, std::string > > property_type;
00066    typedef std::vector< SInputData > id_type;
00067 
00069    RunMode GetRunMode() const;
00071    void SetRunMode( RunMode mode );
00072 
00074    const TString& GetProofServer() const;
00076    void SetProofServer( const TString& server );
00077 
00079    const Int_t& GetProofNodes() const;
00081    void SetProofNodes( const Int_t nodes );
00082 
00084    const TString& GetProofWorkDir() const;
00086    void SetProofWorkDir( const TString& workdir );
00087 
00089    const property_type& GetProperties() const;
00091    void SetProperty( const std::string& name, const std::string& value );
00092 
00094    const id_type& GetInputData() const;
00096    void AddInputData( const SInputData& id );
00097 
00099 
00108    void SetTargetLumi( Double_t targetlumi ) { m_targetLumi = targetlumi; }
00110 
00113    Double_t GetTargetLumi() const { return m_targetLumi; }
00114 
00116    void SetOutputDirectory( const TString& outDir );
00118    const TString& GetOutputDirectory() const;
00119 
00121    void SetPostFix( const TString& postFix );
00123    const TString& GetPostFix() const;
00124 
00126    void SetMsgLevel( SMsgType level );
00128    SMsgType GetMsgLevel() const;
00129 
00131    void SetUseTreeCache( Bool_t status = kTRUE );
00133    Bool_t GetUseTreeCache() const;
00134 
00136    void SetCacheSize( Long64_t size );
00138    Long64_t GetCacheSize() const;
00139 
00141    void SetCacheLearnEntries( Int_t entries );
00143    Int_t GetCacheLearnEntries() const;
00144 
00146    void SetProcessOnlyLocal( Bool_t flag );
00148    Bool_t GetProcessOnlyLocal() const;
00149 
00151    void PrintConfig() const;
00153 
00157    void ArrangeInputData() throw ( SError );
00159 
00165    void ValidateInput();
00166 
00168    TString GetStringConfig( const SInputData* id = 0 ) const;
00169 
00171    void ClearConfig();
00172 
00173 private:
00174    TString       m_cycleName; 
00175    RunMode       m_mode; 
00176    TString       m_server; 
00177    TString       m_workdir; 
00178    Int_t         m_nodes; 
00179    property_type m_properties; 
00180    id_type       m_inputData; 
00181    Double_t      m_targetLumi; 
00182    TString       m_outputDirectory; 
00183    TString       m_postFix; 
00184    SMsgType      m_msgLevel; 
00185    Bool_t        m_useTreeCache; 
00186    Long64_t      m_cacheSize; 
00187    Int_t         m_cacheLearnEntries; 
00188    Bool_t        m_processOnlyLocal; 
00189 
00190 #ifndef DOXYGEN_IGNORE
00191    ClassDef( SCycleConfig, 1 );
00192 #endif // DOXYGEN_IGNORE
00193 
00194 }; // class SCycleConfig
00195 
00196 #endif // SFRAME_CORE_SCycleConfig_H