CMS 3D CMS Logo

SprTrainedBagger.cc File Reference

#include "PhysicsTools/StatPatternRecognition/interface/SprExperiment.hh"
#include "PhysicsTools/StatPatternRecognition/interface/SprTrainedBagger.hh"
#include "PhysicsTools/StatPatternRecognition/interface/SprUtils.hh"
#include "PhysicsTools/StatPatternRecognition/interface/SprDefs.hh"
#include <stdio.h>
#include <cassert>

Go to the source code of this file.

Functions

const SprTrainedBagger operator+ (const SprTrainedBagger &l, const SprTrainedBagger &r)


Function Documentation

const SprTrainedBagger operator+ ( const SprTrainedBagger &  l,
const SprTrainedBagger &  r 
)

Definition at line 139 of file SprTrainedBagger.cc.

References i.

00141 {
00142   // check variable list
00143   assert( l.vars_.size() == r.vars_.size() );
00144   for( int i=0;i<l.vars_.size();i++ )
00145     assert( l.vars_[i] == r.vars_[i] );
00146 
00147   // add classifiers
00148   vector<pair<const SprAbsTrainedClassifier*,bool> > trained;
00149   for( int i=0;i<l.trained_.size();i++ ) {
00150     trained.push_back(pair<const SprAbsTrainedClassifier*,
00151                       bool>(l.trained_[i].first->clone(),true));
00152   }
00153   
00154   for( int i=0;i<r.trained_.size();i++ ) {
00155     trained.push_back(pair<const SprAbsTrainedClassifier*,
00156                       bool>(r.trained_[i].first->clone(),true));
00157   }
00158 
00159   // add discrete
00160   assert( l.discrete_ == r.discrete_ );
00161 
00162   // make bagger and set cut
00163   SprTrainedBagger newBagger(trained,l.discrete_);
00164   newBagger.setCut(SprUtils::lowerBound(0.5));
00165 
00166   // exit
00167   return newBagger;
00168 }


Generated on Tue Jun 9 17:55:01 2009 for CMSSW by  doxygen 1.5.4