| Factory.h | | Factory.h | |
|
| // @(#)root/tmva $Id: Factory.h 40005 2011-06-27 15:29:10Z stelzer $ | | // @(#)root/mathcore:$Id: Factory.h 37448 2010-12-09 20:20:56Z moneta $ | |
| // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss, Ka | | // Author: L. Moneta Fri Dec 22 14:43:33 2006 | |
| i Voss, Eckhard von Toerne, Jan Therhaag | | | |
| | | | |
|
| /************************************************************************** | | /********************************************************************** | |
| ******** | | * * | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis | | * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT * | |
| * | | * * | |
| * Package: TMVA | | * * | |
| * | | **********************************************************************/ | |
| * Class : Factory | | | |
| * | | // Header file for class Factory | |
| * Web : http://tmva.sourceforge.net | | | |
| * | | #ifndef ROOT_Math_Factory | |
| * | | #define ROOT_Math_Factory | |
| * | | | |
| * Description: | | | |
| * | | | |
| * This is the main MVA steering class: it creates (books) all MVA met | | | |
| hods, * | | | |
| * and guides them through the training, testing and evaluation phases | | | |
| . * | | | |
| * | | | |
| * | | | |
| * Authors (alphabetical): | | | |
| * | | | |
| * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland | | | |
| * | | | |
| * Joerg Stelzer <stelzer@cern.ch> - DESY, Germany | | | |
| * | | | |
| * Peter Speckmayer <peter.speckmayer@cern.ch> - CERN, Switzerland | | | |
| * | | | |
| * Jan Therhaag <Jan.Therhaag@cern.ch> - U of Bonn, Germany | | | |
| * | | | |
| * Eckhard v. Toerne <evt@uni-bonn.de> - U of Bonn, Germany | | | |
| * | | | |
| * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, German | | | |
| y * | | | |
| * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada | | | |
| * | | | |
| * | | | |
| * | | | |
| * Copyright (c) 2005-2011: | | | |
| * | | | |
| * CERN, Switzerland | | | |
| * | | | |
| * U. of Victoria, Canada | | | |
| * | | | |
| * MPI-K Heidelberg, Germany | | | |
| * | | | |
| * U. of Bonn, Germany | | | |
| * | | | |
| * | | | |
| * | | | |
| * Redistribution and use in source and binary forms, with or without | | | |
| * | | | |
| * modification, are permitted according to the terms listed in LICENSE | | | |
| * | | | |
| * (http://tmva.sourceforge.net/LICENSE) | | | |
| * | | | |
| ************************************************************************** | | | |
| ********/ | | | |
| | | | |
| #ifndef ROOT_TMVA_Factory | | | |
| #define ROOT_TMVA_Factory | | | |
| | | | |
| ////////////////////////////////////////////////////////////////////////// | | | |
| // // | | | |
| // Factory // | | | |
| // // | | | |
| // This is the main MVA steering class: it creates all MVA methods, // | | | |
| // and guides them through the training, testing and evaluation // | | | |
| // phases // | | | |
| // // | | | |
| ////////////////////////////////////////////////////////////////////////// | | | |
| | | | |
| #include <string> | | #include <string> | |
|
| #include <vector> | | | |
| #include <map> | | | |
| #ifndef ROOT_TCut | | | |
| #include "TCut.h" | | | |
| #endif | | | |
| | | | |
| #ifndef ROOT_TMVA_Configurable | | | |
| #include "TMVA/Configurable.h" | | | |
| #endif | | | |
| #ifndef ROOT_TMVA_Types | | | |
| #include "TMVA/Types.h" | | | |
| #endif | | | |
| #ifndef ROOT_TMVA_DataSet | | | |
| #include "TMVA/DataSet.h" | | | |
| #endif | | | |
| | | | |
| class TFile; | | | |
| class TTree; | | | |
| class TDirectory; | | | |
| | | | |
| namespace TMVA { | | | |
| | | | |
| class IMethod; | | | |
| class MethodBase; | | | |
| class DataInputHandler; | | | |
| class DataSetInfo; | | | |
| class DataSetManager; | | | |
| class VariableTransformBase; | | | |
| | | | |
| class Factory : public Configurable { | | | |
| public: | | | |
| | | | |
| typedef std::vector<IMethod*> MVector; | | | |
| | | | |
| // no default constructor | | | |
| Factory( TString theJobName, TFile* theTargetFile, TString theOption | | | |
| = "" ); | | | |
| | | | |
| // default destructor | | | |
| virtual ~Factory(); | | | |
| | | | |
| virtual const char* GetName() const { return "Factory"; } | | | |
| | | | |
| // add events to training and testing trees | | | |
| void AddSignalTrainingEvent ( const std::vector<Double_t>& event, | | | |
| Double_t weight = 1.0 ); | | | |
| void AddBackgroundTrainingEvent( const std::vector<Double_t>& event, | | | |
| Double_t weight = 1.0 ); | | | |
| void AddSignalTestEvent ( const std::vector<Double_t>& event, | | | |
| Double_t weight = 1.0 ); | | | |
| void AddBackgroundTestEvent ( const std::vector<Double_t>& event, | | | |
| Double_t weight = 1.0 ); | | | |
| void AddTrainingEvent( const TString& className, const std::vector<Do | | | |
| uble_t>& event, Double_t weight ); | | | |
| void AddTestEvent ( const TString& className, const std::vector<Do | | | |
| uble_t>& event, Double_t weight ); | | | |
| void AddEvent ( const TString& className, Types::ETreeType tt, | | | |
| const std::vector<Double_t>& event, Double_t weight ); | | | |
| Bool_t UserAssignEvents(UInt_t clIndex); | | | |
| TTree* CreateEventAssignTrees( const TString& name ); | | | |
| | | | |
| DataSetInfo& AddDataSet( DataSetInfo& ); | | | |
| DataSetInfo& AddDataSet( const TString& ); | | | |
| | | | |
| // special case: signal/background | | | |
| | | | |
| // Data input related | | | |
| void SetInputTrees( const TString& signalFileName, const TString& bac | | | |
| kgroundFileName, | | | |
| Double_t signalWeight=1.0, Double_t backgroundWei | | | |
| ght=1.0 ); | | | |
| void SetInputTrees( TTree* inputTree, const TCut& SigCut, const TCut& | | | |
| BgCut ); | | | |
| // Set input trees at once | | | |
| void SetInputTrees( TTree* signal, TTree* background, | | | |
| Double_t signalWeight=1.0, Double_t backgroundWei | | | |
| ght=1.0) ; | | | |
| | | | |
| void AddSignalTree( TTree* signal, Double_t weight=1.0, Types::ETr | | | |
| eeType treetype = Types::kMaxTreeType ); | | | |
| void AddSignalTree( TString datFileS, Double_t weight=1.0, Types::ETr | | | |
| eeType treetype = Types::kMaxTreeType ); | | | |
| void AddSignalTree( TTree* signal, Double_t weight, const TString& tr | | | |
| eetype ); | | | |
| | | | |
| // ... depreciated, kept for backwards compatibility | | | |
| void SetSignalTree( TTree* signal, Double_t weight=1.0); | | | |
| | | | |
| void AddBackgroundTree( TTree* background, Double_t weight=1.0, Types | | | |
| ::ETreeType treetype = Types::kMaxTreeType ); | | | |
| void AddBackgroundTree( TString datFileB, Double_t weight=1.0, Types | | | |
| ::ETreeType treetype = Types::kMaxTreeType ); | | | |
| void AddBackgroundTree( TTree* background, Double_t weight, const TSt | | | |
| ring & treetype ); | | | |
| | | | |
| // ... depreciated, kept for backwards compatibility | | | |
| void SetBackgroundTree( TTree* background, Double_t weight=1.0 ); | | | |
| | | | |
| void SetSignalWeightExpression( const TString& variable ); | | | |
| void SetBackgroundWeightExpression( const TString& variable ); | | | |
| | | | |
| // special case: regression | | | |
| void AddRegressionTree( TTree* tree, Double_t weight = 1.0, | | | |
| Types::ETreeType treetype = Types::kMaxTreeTy | | | |
| pe ) { | | | |
| AddTree( tree, "Regression", weight, "", treetype ); | | | |
| } | | | |
| | | | |
| // general | | | |
| | | | |
| // Data input related | | | |
| void SetTree( TTree* tree, const TString& className, Double_t weight | | | |
| ); // depreciated | | | |
| void AddTree( TTree* tree, const TString& className, Double_t weight= | | | |
| 1.0, | | | |
| const TCut& cut = "", | | | |
| Types::ETreeType tt = Types::kMaxTreeType ); | | | |
| void AddTree( TTree* tree, const TString& className, Double_t weight, | | | |
| const TCut& cut, const TString& treeType ); | | | |
| | | | |
| // set input variable | | | |
| void SetInputVariables ( std::vector<TString>* theVariables ); // de | | | |
| preciated | | | |
| void AddVariable ( const TString& expression, const TString& t | | | |
| itle, const TString& unit, | | | |
| char type='F', Double_t min = 0, Double_t m | | | |
| ax = 0 ); | | | |
| void AddVariable ( const TString& expression, char type='F', | | | |
| Double_t min = 0, Double_t max = 0 ); | | | |
| void AddTarget ( const TString& expression, const TString& t | | | |
| itle = "", const TString& unit = "", | | | |
| Double_t min = 0, Double_t max = 0 ); | | | |
| void AddRegressionTarget( const TString& expression, const TString& t | | | |
| itle = "", const TString& unit = "", | | | |
| Double_t min = 0, Double_t max = 0 ) | | | |
| { | | | |
| AddTarget( expression, title, unit, min, max ); | | | |
| } | | | |
| void AddSpectator ( const TString& expression, const TString& | | | |
| title = "", const TString& unit = "", | | | |
| Double_t min = 0, Double_t max = 0 ); | | | |
| | | | |
| // set weight for class | | | |
| void SetWeightExpression( const TString& variable, const TString& cla | | | |
| ssName = "" ); | | | |
| | | | |
| // set cut for class | | | |
| void SetCut( const TString& cut, const TString& className = "" ); | | | |
| void SetCut( const TCut& cut, const TString& className = "" ); | | | |
| void AddCut( const TString& cut, const TString& className = "" ); | | | |
| void AddCut( const TCut& cut, const TString& className = "" ); | | | |
| | | | |
| // prepare input tree for training | | | |
| void PrepareTrainingAndTestTree( const TCut& cut, const TString& spli | | | |
| tOpt ); | | | |
| void PrepareTrainingAndTestTree( TCut sigcut, TCut bkgcut, const TStr | | | |
| ing& splitOpt ); | | | |
| | | | |
| // ... deprecated, kept for backwards compatibility | | | |
| void PrepareTrainingAndTestTree( const TCut& cut, Int_t Ntrain, Int_t | | | |
| Ntest = -1 ); | | | |
| | | | |
| void PrepareTrainingAndTestTree( const TCut& cut, Int_t NsigTrain, In | | | |
| t_t NbkgTrain, Int_t NsigTest, Int_t NbkgTest, | | | |
| const TString& otherOpt="SplitMode=R | | | |
| andom:!V" ); | | | |
| | | | |
| MethodBase* BookMethod( TString theMethodName, TString methodTitle, T | | | |
| String theOption = "" ); | | | |
| MethodBase* BookMethod( Types::EMVA theMethod, TString methodTitle, | | | |
| TString theOption = "" ); | | | |
| MethodBase* BookMethod( TMVA::Types::EMVA /*theMethod*/, | | | |
| TString /*methodTitle*/, | | | |
| TString /*methodOption*/, | | | |
| TMVA::Types::EMVA /*theCommittee*/, | | | |
| TString /*committeeOption = ""*/ ) { return 0 | | | |
| ; } | | | |
| | | | |
| // optimize all booked methods (well, if desired by the method) | | | |
| void OptimizeAllMethods (TString fomType="ROCIntegral | | | |
| ", TString fitType="FitGA"); | | | |
| void OptimizeAllMethodsForClassification(TString fomType="ROCIntegral | | | |
| ", TString fitType="FitGA") { OptimizeAllMethods(fomType,fitType); } | | | |
| void OptimizeAllMethodsForRegression (TString fomType="ROCIntegral | | | |
| ", TString fitType="FitGA") { OptimizeAllMethods(fomType,fitType); } | | | |
| | | | |
| // training for all booked methods | | | |
| void TrainAllMethods (); | | | |
| void TrainAllMethodsForClassification( void ) { TrainAllMethods(); } | | | |
| void TrainAllMethodsForRegression ( void ) { TrainAllMethods(); } | | | |
| | | | |
| // testing | | | |
| void TestAllMethods(); | | | |
| | | | |
| // performance evaluation | | | |
| void EvaluateAllMethods( void ); | | | |
| void EvaluateAllVariables( TString options = "" ); | | | |
| | | | |
| // delete all methods and reset the method vector | | | |
| void DeleteAllMethods( void ); | | | |
| | | | |
| // accessors | | | |
| IMethod* GetMethod( const TString& title ) const; | | | |
| | | | |
| Bool_t Verbose( void ) const { return fVerbose; } | | | |
| void SetVerbose( Bool_t v=kTRUE ); | | | |
| | | | |
| // make ROOT-independent C++ class for classifier response | | | |
| // (classifier-specific implementation) | | | |
| // If no classifier name is given, help messages for all booked | | | |
| // classifiers are printed | | | |
| virtual void MakeClass( const TString& methodTitle = "" ) const; | | | |
| | | | |
| // prints classifier-specific hepl messages, dedicated to | | | |
| // help with the optimisation and configuration options tuning. | | | |
| // If no classifier name is given, help messages for all booked | | | |
| // classifiers are printed | | | |
| void PrintHelpMessage( const TString& methodTitle = "" ) const; | | | |
| | | | |
| static TDirectory* RootBaseDir() { return (TDirectory*)fgTargetFile; | | | |
| } | | | |
| | | | |
| private: | | | |
| | | | |
| // the beautiful greeting message | | | |
| void Greetings(); | | | |
| | | | |
| void WriteDataInformation(); | | | |
| | | | |
| DataInputHandler& DataInput() { return *fDataInputHandler; } | | | |
| DataSetInfo& DefaultDataSetInfo(); | | | |
| void SetInputTreesFromEventAssignTrees(); | | | |
| | | | |
| private: | | | |
| | | | |
| // data members | | | |
| | | | |
| DataSetManager* fDataSetManager; // DSMTEST | | | |
| | | | |
| static TFile* fgTargetFile; //! ROOT | | | |
| output file | | | |
| | | | |
| DataInputHandler* fDataInputHandler; | | | |
| | | | |
| std::vector<TMVA::VariableTransformBase*> fDefaultTrfs; //! list | | | |
| of transformations on default DataSet | | | |
| | | | |
| // cd to local directory | | | |
| TString fOptions; //! optio | | | |
| n string given by construction (presently only "V") | | | |
| TString fTransformations; //! List | | | |
| of transformations to test | | | |
| Bool_t fVerbose; //! verbo | | | |
| se mode | | | |
| | | | |
| MVector fMethods; //! all M | | | |
| VA methods | | | |
| TString fJobName; //! jobna | | | |
| me, used as extension in weight file names | | | |
| | | | |
| // flag determining the way training and test data are assigned to Fa | | | |
| ctory | | | |
| enum DataAssignType { kUndefined = 0, | | | |
| kAssignTrees, | | | |
| kAssignEvents }; | | | |
| DataAssignType fDataAssignType; //! flags | | | |
| for data assigning | | | |
| std::vector<TTree*> fTrainAssignTree; //! for e | | | |
| ach class: tmp tree if user wants to assign the events directly | | | |
| std::vector<TTree*> fTestAssignTree; //! for e | | | |
| ach class: tmp tree if user wants to assign the events directly | | | |
| | | | |
| Int_t fATreeType; // typ | | | |
| e of event (=classIndex) | | | |
| Float_t fATreeWeight; // wei | | | |
| ght of the event | | | |
| Float_t* fATreeEvent; // eve | | | |
| nt variables | | | |
| | | | |
| Types::EAnalysisType fAnalysisType; //! the t | | | |
| raining type | | | |
| | | | |
|
| protected: | | namespace ROOT { | |
| | | | |
| | | namespace Math { | |
| | | | |
| | | class Minimizer; | |
| | | class DistSampler; | |
| | | | |
| | | //_________________________________________________________________________ | |
| | | __ | |
| | | /** | |
| | | Factory class holding static functions to create the interfaces like RO | |
| | | OT::Math::Minimizer | |
| | | via the Plugin Manager | |
| | | */ | |
| | | class Factory { | |
| | | public: | |
| | | | |
| | | /** | |
| | | static method to create the corrisponding Minimizer given the string | |
| | | Supported Minimizers types are: | |
| | | Minuit (TMinuit), Minuit2, GSLMultiMin, GSLMultiFit, GSLSimAn, Linear | |
| | | , Fumili, Genetic | |
| | | If no name is given use default values defined in MinimizerOptions | |
| | | */ | |
| | | static ROOT::Math::Minimizer * CreateMinimizer(const std::string & minim | |
| | | izerType = "", const std::string & algoType = ""); | |
| | | | |
| | | /** | |
| | | static method to create the distribution sampler class given a string | |
| | | specifying the type | |
| | | Supported sampler types are: | |
| | | Unuran, Foam | |
| | | If no name is given use default values defined in DistSamplerOptions | |
| | | */ | |
| | | static ROOT::Math::DistSampler * CreateDistSampler(const std::string & s | |
| | | amplerType =""); | |
| | | | |
| | | }; | |
| | | | |
|
| ClassDef(Factory,0) // The factory creates all MVA methods, and perf | | } // end namespace Fit | |
| orms their training and testing | | | |
| }; | | | |
| | | | |
|
| } // namespace TMVA | | } // end namespace ROOT | |
| | | | |
|
| #endif | | #endif /* ROOT_Fit_MinimizerFactory */ | |
| | | | |
End of changes. 7 change blocks. |
| 360 lines changed or deleted | | 53 lines changed or added | |
|
| ParamHistFunc.h | | ParamHistFunc.h | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 50 | |
| //ParamHistFunc(const char *name, const char *title, const RooRealVar& va
r, const RooArgList& paramSet, const RooAbsReal& nominal ); | | //ParamHistFunc(const char *name, const char *title, const RooRealVar& va
r, const RooArgList& paramSet, const RooAbsReal& nominal ); | |
| virtual ~ParamHistFunc() ; | | virtual ~ParamHistFunc() ; | |
| | | | |
| ParamHistFunc(const ParamHistFunc& other, const char* name = 0); | | ParamHistFunc(const ParamHistFunc& other, const char* name = 0); | |
| virtual TObject* clone(const char* newname) const { return new ParamHistF
unc(*this, newname); } | | virtual TObject* clone(const char* newname) const { return new ParamHistF
unc(*this, newname); } | |
| | | | |
| // void printMetaArgs(ostream& os) const ; | | // void printMetaArgs(ostream& os) const ; | |
| | | | |
| const RooArgList& paramList() const { return _paramSet ; } | | const RooArgList& paramList() const { return _paramSet ; } | |
| | | | |
|
| virtual Bool_t forceAnalyticalInt(const RooAbsArg&) const { return kTRUE
; } | | Int_t numBins() const { return _dataSet.numEntries(); } // Number of bins
(called numEntries in RooDataHist) | |
| | | | |
|
| Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, co | | void setParamConst( Int_t, Bool_t=kTRUE ); | |
| nst RooArgSet* normSet,const char* rangeName=0) const ; | | | |
| Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const | | | |
| char* rangeName=0) const ; | | | |
| | | | |
|
| Int_t getCurrentBin() const ; | | | |
| RooRealVar& getParameter( Int_t ) const ; | | | |
| RooRealVar& getParameter() const ; | | RooRealVar& getParameter() const ; | |
|
| | | RooRealVar& getParameter( Int_t masterIdx ) const ; | |
| | | | |
|
| void setParamConst( Int_t, Bool_t=kTRUE ); | | const RooArgSet* get(Int_t masterIdx) const { return _dataSet.get( master | |
| | | Idx ) ; } | |
| | | const RooArgSet* get(const RooArgSet& coord) const { return _dataSet.get( | |
| | | coord ) ; } | |
| | | | |
| | | virtual Bool_t forceAnalyticalInt(const RooAbsArg&) const { return kTRUE | |
| | | ; } | |
| | | | |
| | | Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, co | |
| | | nst RooArgSet* normSet,const char* rangeName=0) const ; | |
| | | Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const | |
| | | char* rangeName=0) const ; | |
| | | | |
| static RooArgList createParamSet(RooWorkspace& w, const std::string&, con
st RooArgList& Vars); | | static RooArgList createParamSet(RooWorkspace& w, const std::string&, con
st RooArgList& Vars); | |
| static RooArgList createParamSet(RooWorkspace& w, const std::string&, con
st RooArgList& Vars, Double_t, Double_t); | | static RooArgList createParamSet(RooWorkspace& w, const std::string&, con
st RooArgList& Vars, Double_t, Double_t); | |
| static RooArgList createParamSet(const std::string&, Int_t, Double_t, Dou
ble_t); | | static RooArgList createParamSet(const std::string&, Int_t, Double_t, Dou
ble_t); | |
| | | | |
| virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Dou
ble_t /*xlo*/, Double_t /*xhi*/) const ; | | virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Dou
ble_t /*xlo*/, Double_t /*xhi*/) const ; | |
| virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Doub
le_t xlo, Double_t xhi) const ; | | virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Doub
le_t xlo, Double_t xhi) const ; | |
| virtual Bool_t isBinnedDistribution(const RooArgSet& /*obs*/) const {retu
rn kTRUE;} | | virtual Bool_t isBinnedDistribution(const RooArgSet& /*obs*/) const {retu
rn kTRUE;} | |
| | | | |
| protected: | | protected: | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 105 | |
| RooListProxy _paramSet ; // interpolation parameters | | RooListProxy _paramSet ; // interpolation parameters | |
| //RooAbsBinning* _binning; // Holds the binning of the dataVar (at const
ruction time) | | //RooAbsBinning* _binning; // Holds the binning of the dataVar (at const
ruction time) | |
| | | | |
| Int_t _numBins; | | Int_t _numBins; | |
| mutable std::map<Int_t, Int_t> _binMap; | | mutable std::map<Int_t, Int_t> _binMap; | |
| mutable RooDataHist _dataSet; | | mutable RooDataHist _dataSet; | |
| | | | |
| // std::vector< Double_t > _nominalVals; // The nominal vals when gamma =
1.0 ( = 1.0 by default) | | // std::vector< Double_t > _nominalVals; // The nominal vals when gamma =
1.0 ( = 1.0 by default) | |
| RooArgList _ownedList ; // List of owned components | | RooArgList _ownedList ; // List of owned components | |
| | | | |
|
| | | Int_t getCurrentBin() const ; | |
| Int_t addVarSet( const RooArgList& vars ); | | Int_t addVarSet( const RooArgList& vars ); | |
| Int_t addParamSet( const RooArgList& params ); | | Int_t addParamSet( const RooArgList& params ); | |
| static Int_t GetNumBins( const RooArgSet& vars ); | | static Int_t GetNumBins( const RooArgSet& vars ); | |
| Double_t evaluate() const; | | Double_t evaluate() const; | |
| | | | |
| ClassDef(ParamHistFunc,4) // Sum of RooAbsReal objects | | ClassDef(ParamHistFunc,4) // Sum of RooAbsReal objects | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 8 lines changed or deleted | | 16 lines changed or added | |
|
| TXNetSystem.h | | TXNetSystem.h | |
|
| // @(#)root/netx:$Id: TXNetSystem.h 41574 2011-10-25 13:42:03Z ganis $ | | // @(#)root/netx:$Id: TXNetSystem.h 43298 2012-03-08 15:11:51Z ganis $ | |
| // Author: Frank Winklmeier, Fabrizio Furano | | // Author: Frank Winklmeier, Fabrizio Furano | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 40 | | skipping to change at line 40 | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOT_Rtypes | | #ifndef ROOT_Rtypes | |
| #include "Rtypes.h" | | #include "Rtypes.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOT_TString | | #ifndef ROOT_TString | |
| #include "TString.h" | | #include "TString.h" | |
| #endif | | #endif | |
| | | | |
|
| #include "XrdProofdXrdVers.h" | | | |
| | | | |
| #if ROOTXRDVERS >= ROOT_OldXrdLocate | | | |
| #ifndef ROOT_THashList | | #ifndef ROOT_THashList | |
| #include "THashList.h" | | #include "THashList.h" | |
| #endif | | #endif | |
|
| #endif | | | |
| | | | |
| #include "XrdOuc/XrdOucString.hh" | | #include "XrdOuc/XrdOucString.hh" | |
| #include "XrdClient/XrdClientVector.hh" | | #include "XrdClient/XrdClientVector.hh" | |
| | | | |
| class XrdClientAdmin; | | class XrdClientAdmin; | |
| class TCollection; | | class TCollection; | |
| class TXNetSystemConnectGuard; | | class TXNetSystemConnectGuard; | |
| | | | |
| typedef XrdClientVector<XrdOucString> vecString; | | typedef XrdClientVector<XrdOucString> vecString; | |
| typedef XrdClientVector<bool> vecBool; | | typedef XrdClientVector<bool> vecBool; | |
| | | | |
|
| #if ROOTXRDVERS >= ROOT_OldXrdLocate | | | |
| class TXrdClientAdminWrapper : public TNamed { | | class TXrdClientAdminWrapper : public TNamed { | |
| public: | | public: | |
| TXrdClientAdminWrapper(const char *key, XrdClientAdmin *ca) : TNamed(key
,""), fXCA(ca) { } | | TXrdClientAdminWrapper(const char *key, XrdClientAdmin *ca) : TNamed(key
,""), fXCA(ca) { } | |
| virtual ~TXrdClientAdminWrapper(); | | virtual ~TXrdClientAdminWrapper(); | |
| XrdClientAdmin *fXCA; | | XrdClientAdmin *fXCA; | |
| }; | | }; | |
|
| #endif | | | |
| | | | |
| class TXNetSystem : public TNetSystem { | | class TXNetSystem : public TNetSystem { | |
| | | | |
| friend class TXNetSystemConnectGuard; | | friend class TXNetSystemConnectGuard; | |
| | | | |
| private: | | private: | |
| Bool_t fIsRootd; // Nature of remote file server | | Bool_t fIsRootd; // Nature of remote file server | |
| Bool_t fIsXRootd; // Nature of remote file server | | Bool_t fIsXRootd; // Nature of remote file server | |
| TString fDir; // Current directory | | TString fDir; // Current directory | |
| void *fDirp; // Directory pointer | | void *fDirp; // Directory pointer | |
| | | | |
| skipping to change at line 88 | | skipping to change at line 82 | |
| TString fDirEntry; // Last dir entry | | TString fDirEntry; // Last dir entry | |
| TString fUrl; // Initial url | | TString fUrl; // Initial url | |
| | | | |
| static Bool_t fgInitDone; // Avoid initializing more than once | | static Bool_t fgInitDone; // Avoid initializing more than once | |
| static Bool_t fgRootdBC; // Control rootd backward compatibility | | static Bool_t fgRootdBC; // Control rootd backward compatibility | |
| | | | |
| XrdClientAdmin *Connect(const char *url); // Connect to server | | XrdClientAdmin *Connect(const char *url); // Connect to server | |
| void *GetDirPtr() const { return fDirp; } | | void *GetDirPtr() const { return fDirp; } | |
| void InitXrdClient(); | | void InitXrdClient(); | |
| | | | |
|
| #if ROOTXRDVERS >= ROOT_OldXrdLocate | | | |
| static THashList fgAddrFQDN; // Cross-table address<->FQDN | | static THashList fgAddrFQDN; // Cross-table address<->FQDN | |
| static THashList fgAdminHash; // List of existing XrdClientAdmin | | static THashList fgAdminHash; // List of existing XrdClientAdmin | |
| static XrdClientAdmin *GetClientAdmin(const char *url); | | static XrdClientAdmin *GetClientAdmin(const char *url); | |
| static TString GetKey(const char *url); | | static TString GetKey(const char *url); | |
|
| #endif | | | |
| | | | |
| public: | | public: | |
| TXNetSystem(Bool_t owner = kTRUE); | | TXNetSystem(Bool_t owner = kTRUE); | |
| TXNetSystem(const char *url, Bool_t owner = kTRUE); | | TXNetSystem(const char *url, Bool_t owner = kTRUE); | |
| virtual ~TXNetSystem() { } | | virtual ~TXNetSystem() { } | |
| | | | |
| Bool_t AccessPathName(const char *path, EAccessMode mode); | | Bool_t AccessPathName(const char *path, EAccessMode mode); | |
| virtual Bool_t ConsistentWith(const char *path, void *dirptr); | | virtual Bool_t ConsistentWith(const char *path, void *dirptr); | |
| virtual void FreeDirectory(void *dirp); | | virtual void FreeDirectory(void *dirp); | |
| virtual const char *GetDirEntry(void *dirp); | | virtual const char *GetDirEntry(void *dirp); | |
| | | | |
End of changes. 7 change blocks. |
| 9 lines changed or deleted | | 1 lines changed or added | |
|