62 TMVA::MethodCompositeBase::MethodCompositeBase( const
TString& jobName,
63 Types::EMVA methodType,
68 :
TMVA::MethodBase( jobName, methodType, methodTitle, theData, theOption, theTargetDir ),
69 fCurrentMethodIdx(0), fCurrentMethod(0)
79 fCurrentMethodIdx(0), fCurrentMethod(0)
87 std::vector<IMethod*>::const_iterator itrMethod = fMethods.begin();
88 std::vector<IMethod*>::const_iterator itrMethodEnd = fMethods.end();
90 for (; itrMethod != itrMethodEnd; itrMethod++) {
102 std::vector<IMethod*>::const_iterator itrMethod = fMethods.begin()+index;
103 if (itrMethod<fMethods.end())
return *itrMethod;
114 for (
UInt_t i=0; i< fMethods.size(); i++)
139 std::vector<IMethod*>::iterator itrMethod = fMethods.begin();
140 for (; itrMethod != fMethods.end(); itrMethod++) {
141 Log() <<
kVERBOSE <<
"Delete method: " << (*itrMethod)->GetName() <<
Endl;
153 TString methodName, methodTypeName, jobName, optionString;
155 for (
UInt_t i=0;i<fMethods.size();i++)
delete fMethods[i];
157 fMethodWeight.clear();
160 for (
UInt_t i=0; i< nMethods; i++) {
161 Double_t methodWeight, methodSigCut, methodSigCutOrientation;
164 gTools().
ReadAttr( ch,
"MethodSigCutOrientation", methodSigCutOrientation);
171 if (
gTools().HasAttr( ch,
"UseMainMethodTransformation")) {
173 gTools().
ReadAttr( ch,
"UseMainMethodTransformation", rerouteString );
190 std::string(methodTypeName),jobName, methodName,DataInfo(),optionString));
192 fMethodWeight.push_back(methodWeight);
222 jobName=GetJobName(),optionString=GetOptions();
226 istr >> dummy >> methodNum;
227 Log() <<
kINFO <<
"Read " << methodNum <<
" Classifiers" <<
Endl;
228 for (
UInt_t i=0;i<fMethods.size();i++)
delete fMethods[i];
230 fMethodWeight.clear();
231 for (
UInt_t i=0; i<methodNum; i++) {
232 istr >> dummy >> methodName >> dummy >> fCurrentMethodIdx >> dummy >> methodWeight;
233 if ((
UInt_t)fCurrentMethodIdx != i) {
234 Log() <<
kFATAL <<
"Error while reading weight file; mismatch MethodIndex="
235 << fCurrentMethodIdx <<
" i=" << i
236 <<
" MethodName " << methodName
237 <<
" dummy " << dummy
238 <<
" MethodWeight= " << methodWeight
242 istr >> dummy >> jobName;
243 istr >> dummy >> methodTitle;
244 istr >> dummy >> optionString;
250 methodTitle,DataInfo(), optionString) );
251 fMethodWeight.push_back( methodWeight );
252 if(
MethodBase*
m = dynamic_cast<MethodBase*>(fMethods.back()) )
253 m->ReadWeightsFromStream(istr);
263 for (
UInt_t i=0;i< fMethods.size(); i++) mvaValue+=fMethods[i]->GetMvaValue()*fMethodWeight[i];
266 NoErrorCalc(err, errUpper);
static ClassifierFactory & Instance()
access to the ClassifierFactory singleton creates the instance if needed
void SetMsgType(EMsgType t)
MsgLogger & Endl(MsgLogger &ml)
void ReadWeightsFromXML(void *wghtnode)
XML streamer.
TString & ReplaceAll(const TString &s1, const TString &s2)
TransformationHandler * fTransformationPointer
void SetSignalReferenceCutOrientation(Double_t cutOrientation)
void ToLower()
Change string to lower-case.
void ReadWeightsFromStream(std::istream &istr)
text streamer
void AddWeightsXMLTo(void *parent) const
const TString & GetMethodName() const
MethodCompositeBase(const TString &jobName, Types::EMVA methodType, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="", TDirectory *theTargetDir=NULL)
static Types & Instance()
the the single instance of "Types" if existin already, or create it (Signleton)
ClassImp(TMVA::MethodCompositeBase) TMVA
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)
Describe directory structure in memory.
static RooMathCoreReg dummy
Double_t GetSignalReferenceCutOrientation() const
void ProcessSetup()
process all options the "CheckForUnusedOptions" is done in an independent call, since it may be overr...
Abstract ClassifierFactory template that handles arbitrary types.
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
return composite MVA response
const TString & GetJobName() const
const TString & GetOptions() const
Double_t GetSignalReferenceCut() const
TString GetMethodTypeName() const
void SetSignalReferenceCut(Double_t cut)