76:
TMVA::
MethodBase( jobName, methodType, methodTitle, theData, theOption),
77 fCurrentMethodIdx(0), fCurrentMethod(0)
86 fCurrentMethodIdx(0), fCurrentMethod(0)
94 std::vector<IMethod*>::const_iterator itrMethod = fMethods.begin();
95 std::vector<IMethod*>::const_iterator itrMethodEnd = fMethods.end();
97 for (; itrMethod != itrMethodEnd; ++itrMethod) {
109 std::vector<IMethod*>::const_iterator itrMethod = fMethods.begin()+index;
110 if (itrMethod<fMethods.end())
return *itrMethod;
121 for (
UInt_t i=0; i< fMethods.size(); i++)
146 std::vector<IMethod*>::iterator itrMethod = fMethods.begin();
147 for (; itrMethod != fMethods.end(); ++itrMethod) {
148 Log() << kVERBOSE <<
"Delete method: " << (*itrMethod)->GetName() <<
Endl;
160 TString methodName, methodTypeName, jobName, optionString;
162 for (
UInt_t i=0;i<fMethods.size();i++)
delete fMethods[i];
164 fMethodWeight.clear();
167 for (
UInt_t i=0; i< nMethods; i++) {
168 Double_t methodWeight, methodSigCut, methodSigCutOrientation;
171 gTools().
ReadAttr( ch,
"MethodSigCutOrientation", methodSigCutOrientation);
178 if (
gTools().HasAttr( ch,
"UseMainMethodTransformation")) {
180 gTools().
ReadAttr( ch,
"UseMainMethodTransformation", rerouteString );
199 fMethodWeight.push_back(methodWeight);
203 Log() << kFATAL <<
"Could not read method from XML" <<
Endl;
235 jobName=GetJobName(),optionString=GetOptions();
239 istr >>
dummy >> methodNum;
240 Log() << kINFO <<
"Read " << methodNum <<
" Classifiers" <<
Endl;
241 for (
UInt_t i=0;i<fMethods.size();i++)
delete fMethods[i];
243 fMethodWeight.clear();
244 for (
UInt_t i=0; i<methodNum; i++) {
245 istr >>
dummy >> methodName >>
dummy >> fCurrentMethodIdx >>
dummy >> methodWeight;
246 if ((
UInt_t)fCurrentMethodIdx != i) {
247 Log() << kFATAL <<
"Error while reading weight file; mismatch MethodIndex="
248 << fCurrentMethodIdx <<
" i=" << i
249 <<
" MethodName " << methodName
250 <<
" dummy " <<
dummy
251 <<
" MethodWeight= " << methodWeight
255 istr >>
dummy >> jobName;
256 istr >>
dummy >> methodTitle;
257 istr >>
dummy >> optionString;
264 fMethodWeight.push_back( methodWeight );
266 m->ReadWeightsFromStream(istr);
276 for (
UInt_t i=0;i< fMethods.size(); i++) mvaValue+=fMethods[i]->GetMvaValue()*fMethodWeight[i];
279 NoErrorCalc(err, errUpper);
static RooMathCoreReg dummy
char * Form(const char *fmt,...)
IMethod * Create(const std::string &name, const TString &job, const TString &title, DataSetInfo &dsi, const TString &option)
creates the method if needed based on the method name using the creator function the factory has stor...
static ClassifierFactory & Instance()
access to the ClassifierFactory singleton creates the instance if needed
virtual void ParseOptions()
options parser
const TString & GetOptions() const
void SetMsgType(EMsgType t)
Class that contains all the data information.
virtual const char * GetName() const
Returns name of object.
Interface for all concrete MVA method implementations.
Virtual base Class for all MVA method.
TransformationHandler * fTransformationPointer
void SetSilentFile(Bool_t status)
void SetWeightFileDir(TString fileDir)
set directory of weight file
TString GetMethodTypeName() const
virtual void ReadWeightsFromXML(void *wghtnode)=0
const TString & GetJobName() const
void SetupMethod()
setup of methods
friend class MethodCompositeBase
const TString & GetMethodName() const
void ProcessSetup()
process all options the "CheckForUnusedOptions" is done in an independent call, since it may be overr...
void RerouteTransformationHandler(TransformationHandler *fTargetTransformation)
DataSetInfo & DataInfo() const
virtual void AddWeightsXMLTo(void *parent) const =0
Double_t GetSignalReferenceCutOrientation() const
void SetSignalReferenceCut(Double_t cut)
void SetSignalReferenceCutOrientation(Double_t cutOrientation)
void SetModelPersistence(Bool_t status)
Double_t GetSignalReferenceCut() const
virtual void CheckSetup()
check may be overridden by derived class (sometimes, eg, fitters are used which can only be implement...
Class for boosting a TMVA method.
Virtual base class for combining several TMVA method.
void ReadWeightsFromStream(std::istream &istr)
text streamer
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
return composite MVA response
virtual ~MethodCompositeBase(void)
delete methods
IMethod * GetMethod(const TString &title) const
returns pointer to MVA that corresponds to given method title
void ReadWeightsFromXML(void *wghtnode)
XML streamer.
void AddWeightsXMLTo(void *parent) const
static Types & Instance()
the the single instance of "Types" if existing already, or create it (Singleton)
Types::EMVA GetMethodType(const TString &method) const
returns the method type (enum) for a given method (string)
void ToLower()
Change string to lower-case.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
std::string GetMethodName(TCppMethod_t)
Abstract ClassifierFactory template that handles arbitrary types.
MsgLogger & Endl(MsgLogger &ml)