00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef RAR_CONFIG
00011 #define RAR_CONFIG
00012
00013 #include "TList.h"
00014 #include "TString.h"
00015 #include "TObject.h"
00016
00017 #include "RooRarFit/rarStrParser.hh"
00018
00019 class rarBasePdf;
00020 class rarDatasets;
00021
00027 class rarConfig : public TNamed {
00028
00029 public:
00030 rarConfig();
00031 rarConfig(const char*configFile, const char*configSec, const char*configStr,
00032 const char *name, const char *title);
00033 virtual ~rarConfig();
00034
00037 static void setMasterSec(TString masterSec) {_masterSec=masterSec;}
00038
00041 TString getMasterSec() const {return _masterSec;}
00042
00045 static void setRunSec(TString runSec) {_runSec=runSec;}
00046
00049 TString getRunSec() const {return _runSec;}
00050
00058 virtual TString getVarSec() {return _configSec;}
00059
00062 virtual RooArgSet *getFullObs() const {return _fullObs;}
00063
00069 virtual RooArgSet *getPrimaryObs() {return 0;}
00070
00076 virtual RooArgSet *getAddOnCols() {return 0;}
00077
00084 virtual RooDataSet *getData(const char * ) {return 0;}
00085
00091 virtual rarDatasets *getDatasets() const {return 0;}
00092
00094 virtual RooArgSet *getCats() {return &_rarCats;}
00095
00101 virtual TString getPdfType() {return "";}
00102
00103 protected:
00104 virtual void init();
00105 virtual TString readConfStr(const char *name, const char *val,
00106 const char *secName=0);
00107 virtual void setConfStr(const char *name, const char *val=0,
00108 const char *secName=0);
00109 virtual void addToConfStr(const char *name, const char *val=0,
00110 const char *secName=0);
00111 virtual TString readConfStrCnA(TString configStr, TString defVal);
00112 virtual Bool_t isNumber(TString numStr);
00113 virtual Bool_t isVarType(TString typeStr);
00114 virtual void writeToStr(RooArgSet &aSet, string &aStr);
00115 virtual void readFromStr(RooArgSet &aSet, string &aStr);
00116
00117 virtual rarStrParser getVarTNTU(TString varStr, TString option,
00118 TString *fullName=0, TString *fullTitle=0,
00119 TString *varType=0,
00120 TString *Name=0, TString *Title=0,
00121 TString *Unit=0);
00122 virtual TString getFullVarName(TString nameStr);
00123 virtual TString getFullVarName(TString nameStr,
00124 TString varStr, TString option="");
00125
00126 virtual RooAbsReal *createAbsReal(const char *name, const char *title,
00127 const Double_t val,
00128 const Double_t min, const Double_t max,
00129 const char *unit=0);
00130 virtual RooAbsReal *createAbsReal(const char *name, const char *title,
00131 const Double_t val=0, const char *unit=0);
00132
00138 virtual void addToParams(RooRealVar * ) {return;}
00139
00145 virtual void addToObs(RooRealVar * ) {return;}
00146
00152 virtual RooArgList *getFormulaArgs(rarStrParser ) {return 0;}
00153 virtual RooAbsArg *createAbsVar(const char *varStr, const char *option="");
00154 virtual RooAbsArg *createAbsVars(TString configName="Coeffs",
00155 RooAbsCollection *argCollA=0,
00156 RooAbsCollection *argCollB=0);
00157 virtual RooAbsArg *getAbsVar(TString varName);
00158
00159 virtual void setColLimits(RooDataSet *data, Bool_t setLimits=kTRUE);
00160 virtual void addColumns(RooDataSet *data, Bool_t addColmns=kTRUE,
00161 Bool_t setLimits=kFALSE);
00162 virtual RooDataSet *createDataSet(const char *dsStr, Bool_t &isUB, TString wgtVarName);
00163 virtual void computeCorrelations(RooArgList varList, const RooDataSet *data);
00164
00165 virtual rarBasePdf *createPdf(const char *configStr);
00166
00167 TString getFullFileName(const TString dir, const TString aType, const TString name,
00168 const TString dsName="", const TString msName="",
00169 const TString cfName="");
00170 TString getFileName(const TString name) const;
00171
00172 TString _configFile;
00173 TString _configSec;
00174
00175
00176
00177 TString _configStr;
00178 RooArgSet _configStrSet;
00179
00186 Bool_t _createFundamental;
00187 RooArgSet *_fullObs;
00188 static TList _rarPdfs;
00189 static TList _rarVars;
00190 static TList _rarOVars;
00191 static RooArgSet _rarCats;
00192 static TString _masterSec;
00193 static TString _runSec;
00194 TString _fullNameSchema;
00195
00196 private:
00197 rarConfig(const rarConfig&);
00198 ClassDef(rarConfig, 0)
00199 ;
00200 };
00201
00202 #endif