69 Types::EMVA methodType,
73 : TMVA::
MethodBase( jobName, methodType, methodTitle, theData, theOption),
74 fCurrentMethodIdx(0), fCurrentMethod(0)
82 : TMVA::
MethodBase( methodType, dsi, weightFile),
83 fCurrentMethodIdx(0), fCurrentMethod(0)
91 std::vector<IMethod*>::const_iterator itrMethod = fMethods.begin();
92 std::vector<IMethod*>::const_iterator itrMethodEnd = fMethods.end();
94 for (; itrMethod != itrMethodEnd; itrMethod++) {
106 std::vector<IMethod*>::const_iterator itrMethod = fMethods.begin()+index;
107 if (itrMethod<fMethods.end())
return *itrMethod;
118 for (
UInt_t i=0; i< fMethods.size(); i++)
143 std::vector<IMethod*>::iterator itrMethod = fMethods.begin();
144 for (; itrMethod != fMethods.end(); itrMethod++) {
145 Log() <<
kVERBOSE <<
"Delete method: " << (*itrMethod)->GetName() <<
Endl;
157 TString methodName, methodTypeName, jobName, optionString;
159 for (
UInt_t i=0;i<fMethods.size();i++)
delete fMethods[i];
161 fMethodWeight.clear();
164 for (
UInt_t i=0; i< nMethods; i++) {
165 Double_t methodWeight, methodSigCut, methodSigCutOrientation;
168 gTools().
ReadAttr( ch,
"MethodSigCutOrientation", methodSigCutOrientation);
175 if (
gTools().HasAttr( ch,
"UseMainMethodTransformation")) {
177 gTools().
ReadAttr( ch,
"UseMainMethodTransformation", rerouteString );
194 std::string(methodTypeName),jobName, methodName,DataInfo(),optionString));
196 fMethodWeight.push_back(methodWeight);
232 jobName=GetJobName(),optionString=GetOptions();
236 istr >> dummy >> methodNum;
237 Log() <<
kINFO <<
"Read " << methodNum <<
" Classifiers" <<
Endl;
238 for (
UInt_t i=0;i<fMethods.size();i++)
delete fMethods[i];
240 fMethodWeight.clear();
241 for (
UInt_t i=0; i<methodNum; i++) {
242 istr >> dummy >> methodName >> dummy >> fCurrentMethodIdx >> dummy >> methodWeight;
243 if ((
UInt_t)fCurrentMethodIdx != i) {
244 Log() <<
kFATAL <<
"Error while reading weight file; mismatch MethodIndex="
245 << fCurrentMethodIdx <<
" i=" << i
246 <<
" MethodName " << methodName
247 <<
" dummy " << dummy
248 <<
" MethodWeight= " << methodWeight
252 istr >> dummy >> jobName;
253 istr >> dummy >> methodTitle;
254 istr >> dummy >> optionString;
260 methodTitle,DataInfo(), optionString) );
261 fMethodWeight.push_back( methodWeight );
262 if(
MethodBase*
m = dynamic_cast<MethodBase*>(fMethods.back()) )
263 m->ReadWeightsFromStream(istr);
273 for (
UInt_t i=0;i< fMethods.size(); i++) mvaValue+=fMethods[i]->GetMvaValue()*fMethodWeight[i];
276 NoErrorCalc(err, errUpper);
static ClassifierFactory & Instance()
access to the ClassifierFactory singleton creates the instance if needed
MethodCompositeBase(const TString &jobName, Types::EMVA methodType, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
void SetModelPersistence(Bool_t status)
void SetMsgType(EMsgType t)
MsgLogger & Endl(MsgLogger &ml)
void ReadWeightsFromXML(void *wghtnode)
XML streamer.
TString & ReplaceAll(const TString &s1, const TString &s2)
static Types & Instance()
the the single instance of "Types" if existin already, or create it (Signleton)
TransformationHandler * fTransformationPointer
void SetSignalReferenceCutOrientation(Double_t cutOrientation)
void ToLower()
Change string to lower-case.
void SetSilentFile(Bool_t status)
void ReadWeightsFromStream(std::istream &istr)
text streamer
void AddWeightsXMLTo(void *parent) const
const TString & GetMethodName() const
virtual const char * GetName() const
Returns name of object.
virtual ~MethodCompositeBase(void)
delete methods
std::vector< std::vector< double > > Data
virtual void ParseOptions()
options parser
void SetupMethod()
setup of methods
virtual void AddWeightsXMLTo(void *parent) const =0
virtual void ReadWeightsFromXML(void *wghtnode)=0
std::string GetMethodName(TCppMethod_t)
IMethod * GetMethod(const TString &title) const
returns pointer to MVA that corresponds to given method title
char * Form(const char *fmt,...)
virtual void CheckSetup()
check may be overridden by derived class (sometimes, eg, fitters are used which can only be implement...
void RerouteTransformationHandler(TransformationHandler *fTargetTransformation)
static RooMathCoreReg dummy
DataSetInfo & DataInfo() const
Double_t GetSignalReferenceCutOrientation() const
void ProcessSetup()
process all options the "CheckForUnusedOptions" is done in an independent call, since it may be overr...
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
return composite MVA response
const TString & GetJobName() const
const TString & GetOptions() const
void SetWeightFileDir(TString fileDir)
set directory of weight file
Double_t GetSignalReferenceCut() const
TString GetMethodTypeName() const
void SetSignalReferenceCut(Double_t cut)