65 TMVA::MethodCompositeBase::MethodCompositeBase( const
TString& jobName,
66 Types::EMVA methodType,
71 : TMVA::MethodBase( jobName, methodType, methodTitle, theData, theOption, theTargetDir ),
72 fCurrentMethodIdx(0), fCurrentMethod(0)
81 : TMVA::
MethodBase( methodType, dsi, weightFile, theTargetDir ),
82 fCurrentMethodIdx(0), fCurrentMethod(0)
90 std::vector<IMethod*>::const_iterator itrMethod = fMethods.begin();
91 std::vector<IMethod*>::const_iterator itrMethodEnd = fMethods.end();
93 for (; itrMethod != itrMethodEnd; itrMethod++) {
105 std::vector<IMethod*>::const_iterator itrMethod = fMethods.begin()+index;
106 if (itrMethod<fMethods.end())
return *itrMethod;
117 for (
UInt_t i=0; i< fMethods.size(); i++)
142 std::vector<IMethod*>::iterator itrMethod = fMethods.begin();
143 for (; itrMethod != fMethods.end(); itrMethod++) {
144 Log() <<
kVERBOSE <<
"Delete method: " << (*itrMethod)->GetName() <<
Endl;
156 TString methodName, methodTypeName, jobName, optionString;
158 for (
UInt_t i=0;i<fMethods.size();i++)
delete fMethods[i];
160 fMethodWeight.clear();
163 for (
UInt_t i=0; i< nMethods; i++) {
164 Double_t methodWeight, methodSigCut, methodSigCutOrientation;
167 gTools().
ReadAttr( ch,
"MethodSigCutOrientation", methodSigCutOrientation);
174 if (
gTools().HasAttr( ch,
"UseMainMethodTransformation")) {
176 gTools().
ReadAttr( ch,
"UseMainMethodTransformation", rerouteString );
193 std::string(methodTypeName),jobName, methodName,DataInfo(),optionString));
195 fMethodWeight.push_back(methodWeight);
225 jobName=GetJobName(),optionString=GetOptions();
229 istr >> dummy >> methodNum;
230 Log() <<
kINFO <<
"Read " << methodNum <<
" Classifiers" <<
Endl;
231 for (
UInt_t i=0;i<fMethods.size();i++)
delete fMethods[i];
233 fMethodWeight.clear();
234 for (
UInt_t i=0; i<methodNum; i++) {
235 istr >> dummy >> methodName >> dummy >> fCurrentMethodIdx >> dummy >> methodWeight;
236 if ((
UInt_t)fCurrentMethodIdx != i) {
237 Log() <<
kFATAL <<
"Error while reading weight file; mismatch MethodIndex="
238 << fCurrentMethodIdx <<
" i=" << i
239 <<
" MethodName " << methodName
240 <<
" dummy " << dummy
241 <<
" MethodWeight= " << methodWeight
245 istr >> dummy >> jobName;
246 istr >> dummy >> methodTitle;
247 istr >> dummy >> optionString;
253 methodTitle,DataInfo(), optionString) );
254 fMethodWeight.push_back( methodWeight );
255 if(
MethodBase*
m = dynamic_cast<MethodBase*>(fMethods.back()) )
256 m->ReadWeightsFromStream(istr);
266 for (
UInt_t i=0;i< fMethods.size(); i++) mvaValue+=fMethods[i]->GetMvaValue()*fMethodWeight[i];
269 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...
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)