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

Flat encoding of SRTrainingBranch. More...

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

Public Member Functions

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

Protected Attributes

bool cvnmapsfilled
 
FlatCVNFeatures cvnfeatures
 
TTree * cvnmaps_tree
 
FlatPixelObjMap cvnmaps
 
long cvnmaps_idx
 
int cvnmaps_length
 
TTree * slicemaps_tree
 
FlatSliceMap slicemaps
 
long slicemaps_idx
 
int slicemaps_length
 
TTree * trainingdata_tree
 
FlatTrainingData trainingdata
 
long trainingdata_idx
 
int trainingdata_length
 

Detailed Description

Flat encoding of SRTrainingBranch.

Definition at line 24 of file FlatTrainingBranch.h.

Constructor & Destructor Documentation

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

Definition at line 49 of file FlatRecord.cxx.

References compare_h5_caf::branch, cvnmaps_idx, cvnmaps_length, cvnmaps_tree, cvnmapsfilled, slicemaps_idx, slicemaps_length, slicemaps_tree, trainingdata_idx, trainingdata_length, and trainingdata_tree.

50  : cvnfeatures(prefix+"cvnfeatures.", tr, policy),
51  cvnmaps_tree(make_tree(prefix+"cvnmaps", "cvnmaps", tr)),
52  cvnmaps((prefix+"cvnmaps."), cvnmaps_tree, policy),
54  slicemaps_tree(make_tree(prefix+"slicemaps", "slicemaps", tr)),
55  slicemaps((prefix+"slicemaps."), slicemaps_tree, policy),
57  trainingdata_tree(make_tree(prefix+"trainingdata", "trainingdata", tr)),
58  trainingdata((prefix+"trainingdata."), trainingdata_tree, policy),
60 {
61  branch(tr, prefix+"cvnmapsfilled", &cvnmapsfilled, policy);
62  if(cvnmaps_tree->GetNbranches() > 0){
63  branch(tr, prefix+"cvnmaps_idx", &cvnmaps_idx, 0);
64  branch(tr, prefix+"cvnmaps_length", &cvnmaps_length, 0);
65  }
66  if(slicemaps_tree->GetNbranches() > 0){
67  branch(tr, prefix+"slicemaps_idx", &slicemaps_idx, 0);
68  branch(tr, prefix+"slicemaps_length", &slicemaps_length, 0);
69  }
70  if(trainingdata_tree->GetNbranches() > 0){
71  branch(tr, prefix+"trainingdata_idx", &trainingdata_idx, 0);
72  branch(tr, prefix+"trainingdata_length", &trainingdata_length, 0);
73  }
74 }
FlatTrainingData trainingdata
const XML_Char * prefix
Definition: expat.h:380
flat::FlatTrainingBranch::~FlatTrainingBranch ( )

Definition at line 76 of file FlatRecord.cxx.

References cvnmaps_tree, slicemaps_tree, and trainingdata_tree.

77 {
78  if(cvnmaps_tree->GetNbranches() > 0) cvnmaps_tree->Write();
79  delete cvnmaps_tree;
80  if(slicemaps_tree->GetNbranches() > 0) slicemaps_tree->Write();
81  delete slicemaps_tree;
82  if(trainingdata_tree->GetNbranches() > 0) trainingdata_tree->Write();
83  delete trainingdata_tree;
84 }

Member Function Documentation

void flat::FlatTrainingBranch::Fill ( const caf::SRTrainingBranch sr)

Definition at line 86 of file FlatRecord.cxx.

References caf::SRTrainingBranch::cvnfeatures, cvnfeatures, caf::SRTrainingBranch::cvnmaps, cvnmaps, cvnmaps_idx, cvnmaps_length, cvnmaps_tree, caf::SRTrainingBranch::cvnmapsfilled, cvnmapsfilled, flat::FlatCVNFeatures::Fill(), flat::FlatSliceMap::Fill(), flat::FlatTrainingData::Fill(), flat::FlatPixelObjMap::Fill(), caf::SRTrainingBranch::slicemaps, slicemaps, slicemaps_idx, slicemaps_length, slicemaps_tree, caf::SRTrainingBranch::trainingdata, trainingdata, trainingdata_idx, trainingdata_length, trainingdata_tree, and submit_syst::x.

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

87 {
89 
91 
92  cvnmaps_idx += cvnmaps_length; // increment taken by previous record
93  cvnmaps_length = sr.cvnmaps.size();
94  for(const auto& x: sr.cvnmaps){
95  cvnmaps.Fill(x);
96  cvnmaps_tree->Fill();
97  }
98 
99  slicemaps_idx += slicemaps_length; // increment taken by previous record
100  slicemaps_length = sr.slicemaps.size();
101  for(const auto& x: sr.slicemaps){
102  slicemaps.Fill(x);
103  slicemaps_tree->Fill();
104  }
105 
106  trainingdata_idx += trainingdata_length; // increment taken by previous record
107  trainingdata_length = sr.trainingdata.size();
108  for(const auto& x: sr.trainingdata){
110  trainingdata_tree->Fill();
111  }
112 }
void Fill(const caf::SRSliceMap &sr)
Definition: FlatRecord.cxx:168
void Fill(const caf::SRTrainingData &sr)
Definition: FlatRecord.cxx:134
FlatTrainingData trainingdata
std::vector< SRTrainingData > trainingdata
Collection of labels associated with the Pixel maps.
void Fill(const caf::SRCVNFeatures &sr)
Definition: FlatRecord.cxx:294
bool cvnmapsfilled
Bool to show if CVN Maps are filled for this slice.
SRCVNFeatures cvnfeatures
Features extracted by the convolutional part of the CVN ID.
std::vector< SRSliceMap > slicemaps
Full detector sized maps used for CVN training or other slice hit level studies.
void Fill(const caf::SRPixelObjMap &sr)
Definition: FlatRecord.cxx:229
std::vector< SRPixelObjMap > cvnmaps
Pixel maps used in CVN evaluation and training 80 cells x 100 planes in each view.

Member Data Documentation

FlatCVNFeatures flat::FlatTrainingBranch::cvnfeatures
protected

Definition at line 35 of file FlatTrainingBranch.h.

Referenced by Fill().

FlatPixelObjMap flat::FlatTrainingBranch::cvnmaps
protected

Definition at line 38 of file FlatTrainingBranch.h.

Referenced by Fill().

long flat::FlatTrainingBranch::cvnmaps_idx
protected

Definition at line 39 of file FlatTrainingBranch.h.

Referenced by Fill(), and FlatTrainingBranch().

int flat::FlatTrainingBranch::cvnmaps_length
protected

Definition at line 40 of file FlatTrainingBranch.h.

Referenced by Fill(), and FlatTrainingBranch().

TTree* flat::FlatTrainingBranch::cvnmaps_tree
protected

Definition at line 37 of file FlatTrainingBranch.h.

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

bool flat::FlatTrainingBranch::cvnmapsfilled
protected

Definition at line 33 of file FlatTrainingBranch.h.

Referenced by Fill(), and FlatTrainingBranch().

FlatSliceMap flat::FlatTrainingBranch::slicemaps
protected

Definition at line 43 of file FlatTrainingBranch.h.

Referenced by Fill().

long flat::FlatTrainingBranch::slicemaps_idx
protected

Definition at line 44 of file FlatTrainingBranch.h.

Referenced by Fill(), and FlatTrainingBranch().

int flat::FlatTrainingBranch::slicemaps_length
protected

Definition at line 45 of file FlatTrainingBranch.h.

Referenced by Fill(), and FlatTrainingBranch().

TTree* flat::FlatTrainingBranch::slicemaps_tree
protected

Definition at line 42 of file FlatTrainingBranch.h.

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

FlatTrainingData flat::FlatTrainingBranch::trainingdata
protected

Definition at line 48 of file FlatTrainingBranch.h.

Referenced by Fill().

long flat::FlatTrainingBranch::trainingdata_idx
protected

Definition at line 49 of file FlatTrainingBranch.h.

Referenced by Fill(), and FlatTrainingBranch().

int flat::FlatTrainingBranch::trainingdata_length
protected

Definition at line 50 of file FlatTrainingBranch.h.

Referenced by Fill(), and FlatTrainingBranch().

TTree* flat::FlatTrainingBranch::trainingdata_tree
protected

Definition at line 47 of file FlatTrainingBranch.h.

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


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