Public Member Functions | Protected Attributes | List of all members
flat::FlatCVNFeatures Class Reference

Flat encoding of SRCVNFeatures. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-28/FlatMaker/FlatCVNFeatures.h"

Public Member Functions

 FlatCVNFeatures (const std::string &prefix, TTree *tr, const IBranchPolicy *policy)
 
 ~FlatCVNFeatures ()
 
void Fill (const caf::SRCVNFeatures &sr)
 

Protected Attributes

unsigned int noutput
 
unsigned int ncomponents
 
TTree * output_tree
 
float output
 
long output_idx
 
int output_length
 
TTree * components_tree
 
float components
 
long components_idx
 
int components_length
 

Detailed Description

Flat encoding of SRCVNFeatures.

Definition at line 20 of file FlatCVNFeatures.h.

Constructor & Destructor Documentation

flat::FlatCVNFeatures::FlatCVNFeatures ( const std::string prefix,
TTree *  tr,
const IBranchPolicy policy 
)

Definition at line 264 of file FlatRecord.cxx.

References compare_h5_caf::branch, components, components_idx, components_length, components_tree, ncomponents, noutput, output, output_idx, output_length, and output_tree.

265  : output_tree(make_tree(prefix+"output", "output", tr)),
266  output(0),
267  output_idx(0), output_length(0),
268  components_tree(make_tree(prefix+"components", "components", tr)),
269  components(0),
271 {
272  branch(tr, prefix+"noutput", &noutput, policy);
273  branch(tr, prefix+"ncomponents", &ncomponents, policy);
274  branch(output_tree, prefix+"output", &output, policy);
275  if(output_tree->GetNbranches() > 0){
276  branch(tr, prefix+"output_idx", &output_idx, 0);
277  branch(tr, prefix+"output_length", &output_length, 0);
278  }
279  branch(components_tree, prefix+"components", &components, policy);
280  if(components_tree->GetNbranches() > 0){
281  branch(tr, prefix+"components_idx", &components_idx, 0);
282  branch(tr, prefix+"components_length", &components_length, 0);
283  }
284 }
const XML_Char * prefix
Definition: expat.h:380
unsigned int ncomponents
flat::FlatCVNFeatures::~FlatCVNFeatures ( )

Definition at line 286 of file FlatRecord.cxx.

References components_tree, and output_tree.

287 {
288  if(output_tree->GetNbranches() > 0) output_tree->Write();
289  delete output_tree;
290  if(components_tree->GetNbranches() > 0) components_tree->Write();
291  delete components_tree;
292 }

Member Function Documentation

void flat::FlatCVNFeatures::Fill ( const caf::SRCVNFeatures sr)

Definition at line 294 of file FlatRecord.cxx.

References caf::SRCVNFeatures::components, components, components_idx, components_length, components_tree, caf::SRCVNFeatures::ncomponents, ncomponents, caf::SRCVNFeatures::noutput, noutput, caf::SRCVNFeatures::output, output, output_idx, output_length, output_tree, and submit_syst::x.

Referenced by flat::FlatTrainingBranch::Fill().

295 {
296  noutput = sr.noutput;
298 
299  output_idx += output_length; // increment taken by previous record
300  output_length = sr.output.size();
301  for(const auto& x: sr.output){
302  output = x;
303  output_tree->Fill();
304  }
305 
306  components_idx += components_length; // increment taken by previous record
307  components_length = sr.components.size();
308  for(const auto& x: sr.components){
309  components = x;
310  components_tree->Fill();
311  }
312 }
std::vector< float > components
Principal components of output.
Definition: SRCVNFeatures.h:18
std::vector< float > output
List of net output nodes.
Definition: SRCVNFeatures.h:15
unsigned int ncomponents
Size of components vector.
Definition: SRCVNFeatures.h:19
unsigned int noutput
Number of entries in output vector.
Definition: SRCVNFeatures.h:16
unsigned int ncomponents

Member Data Documentation

float flat::FlatCVNFeatures::components
protected
long flat::FlatCVNFeatures::components_idx
protected

Definition at line 39 of file FlatCVNFeatures.h.

Referenced by Fill(), and FlatCVNFeatures().

int flat::FlatCVNFeatures::components_length
protected

Definition at line 40 of file FlatCVNFeatures.h.

Referenced by Fill(), and FlatCVNFeatures().

TTree* flat::FlatCVNFeatures::components_tree
protected

Definition at line 37 of file FlatCVNFeatures.h.

Referenced by Fill(), FlatCVNFeatures(), and ~FlatCVNFeatures().

unsigned int flat::FlatCVNFeatures::ncomponents
protected

Definition at line 30 of file FlatCVNFeatures.h.

Referenced by Fill(), and FlatCVNFeatures().

unsigned int flat::FlatCVNFeatures::noutput
protected

Definition at line 29 of file FlatCVNFeatures.h.

Referenced by Fill(), and FlatCVNFeatures().

float flat::FlatCVNFeatures::output
protected

Definition at line 33 of file FlatCVNFeatures.h.

Referenced by Fill(), and FlatCVNFeatures().

long flat::FlatCVNFeatures::output_idx
protected

Definition at line 34 of file FlatCVNFeatures.h.

Referenced by Fill(), and FlatCVNFeatures().

int flat::FlatCVNFeatures::output_length
protected

Definition at line 35 of file FlatCVNFeatures.h.

Referenced by Fill(), and FlatCVNFeatures().

TTree* flat::FlatCVNFeatures::output_tree
protected

Definition at line 32 of file FlatCVNFeatures.h.

Referenced by Fill(), FlatCVNFeatures(), and ~FlatCVNFeatures().


The documentation for this class was generated from the following files: