63 const std::vector< const Node * >& nodes )
68 , fCoefficient ( 0.0 )
70 , fImportanceRef ( 1.0 )
71 , fRuleEnsemble ( re )
145 doneLoop = (found || (i==nvars));
171 if (mindist<0) useCutValue=
kFALSE;
174 if (useCutValue) rval = ( (!(d<0)) && (d<mindist) );
175 else rval = (!(d<0));
210 while ((equal) && (in<nvars)) {
228 smin = ( rms>0 ? (vminA-vminB)/rms : 0 );
230 smax = ( rms>0 ? (vmaxA-vmaxB)/rms : 0 );
231 sumdc2 += smin*smin + smax*smax;
237 if (!useCutValue) sumdc2 = (equal ? 0.0:-1.0);
238 else sumdc2 = (equal ?
sqrt(sumdc2) : -1.0);
301 if (nvars<1) os <<
" *** WARNING - <EMPTY RULE> ***" << std::endl;
308 os <<
" Support = " <<
Form(
"%1.4f",
fSupport) << std::endl;
309 os <<
" S/(S+B) = " <<
Form(
"%1.4f",
fSSB) << std::endl;
311 for (
UInt_t i=0; i<nvars; i++) {
317 os <<
Form(
"* Cut %2d",i+1) <<
" : " << std::flush;
319 else os <<
" " << std::flush;
322 else os <<
" " << std::flush;
342 for (
UInt_t i=0; i<nvars; i++) {
364 Int_t dp = os.precision();
367 << std::setprecision(10)
377 os <<
"N(cuts): " << nvars << std::endl;
378 for (
UInt_t i=0; i<nvars; i++) {
379 os <<
"Cut " << i <<
" : " << std::flush;
381 << std::setprecision(10)
388 os << std::setprecision(dp);
408 for (
UInt_t i=0; i<nvars; i++) {
426 if (nodeName !=
"Rule")
Log() <<
kFATAL <<
"<ReadFromXML> Unexpected node name: " << nodeName <<
Endl;
466 if (i != nvars)
Log() <<
kFATAL <<
"<ReadFromXML> Mismatch in number of cuts: " << i <<
" != " << nvars <<
Endl;
486 istr >> dummy >> nvars;
494 for (
UInt_t i=0; i<nvars; i++) {
495 istr >> dummy >> idum;
497 istr >> sel >> cutmin >> cutmax >> bA >> bB;
Rule()
the simple constructor
std::string GetName(const std::string &scope_name)
void SetCoefficient(Double_t v)
const TString & GetVarName(Int_t i) const
returns the name of a rule
MsgLogger & Endl(MsgLogger &ml)
void SetCutMax(Int_t i, Double_t v)
Double_t GetSigma() const
Double_t GetImportanceRef() const
void PrintLogger(const char *title=0) const
print function
Bool_t operator==(const Rule &other) const
comparison operator ==
Bool_t ContainsVariable(UInt_t iv) const
check if variable in node
bool equal(double d1, double d2, double stol=10000)
const RuleEnsemble * GetRuleEnsemble() const
Double_t GetPurity() const
const RuleCut * GetRuleCut() const
Double_t GetCutMin(Int_t is) const
const TString & GetInputLabel(Int_t i) const
void PrintRaw(std::ostream &os) const
extensive print function used to print info for the weight file
void SetCutMin(Int_t i, Double_t v)
Char_t GetCutDoMin(Int_t is) const
void * AddXMLTo(void *parent) const
void SetSigma(Double_t v)
void SetCutDoMin(Int_t i, Bool_t v)
void SetMinType(EMsgType minType)
void SetSelector(Int_t i, UInt_t s)
Char_t GetCutDoMax(Int_t is) const
Double_t RuleDist(const Rule &other, Bool_t useCutValue) const
Returns: -1.0 : rules are NOT equal, i.e, variables and/or cut directions are wrong >=0: rules are eq...
const MethodBase * GetMethodBase() const
void ReadFromXML(void *wghtnode)
read rule from XML
Double_t GetCoefficient() const
char * Form(const char *fmt,...)
void ReadRaw(std::istream &os)
read function (format is the same as written by PrintRaw)
const RuleFit * GetRuleFit() const
void Copy(const Rule &other)
copy function
std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)
print the tree recursinvely using the << operator
void SetImportanceRef(Double_t v)
void SetSupport(Double_t v)
void SetNorm(Double_t norm)
void SetCutDoMax(Int_t i, Bool_t v)
static RooMathCoreReg dummy
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
const MethodBase * GetMethodBase() const
Get a pointer to the original MethodRuleFit.
void Print(std::ostream &os) const
print function
UInt_t GetSelector(Int_t is) const
Double_t GetRMS(Int_t ivar) const
Bool_t operator<(const Rule &other) const
comparison operator <
Double_t GetImportance() const
void SetMsgType(EMsgType t)
Double_t GetCutMax(Int_t is) const
MsgLogger & Log() const
message logger
virtual ~Rule()
destructor
void SetRuleEnsemble(const RuleEnsemble *re)
Double_t GetCutNeve() const
Double_t GetSSBNeve() const
Double_t GetSupport() const
const RuleEnsemble * fRuleEnsemble
Bool_t Equal(const Rule &other, Bool_t useCutValue, Double_t maxdist) const
Compare two rules.