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

Flat encoding of SRTruthBranch. More...

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

Public Member Functions

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

Protected Attributes

short int faveidxeff
 
short int faveidxenergy
 
short int faveidxpur
 
short int faveidxeffpur
 
short int faveidxeffthenpur
 
short int nnu
 
short int ncosmic
 
short int nallnus
 
short int nallcosmics
 
FlatGlobalTruth global
 
TTree * nu_tree
 
FlatNeutrino nu
 
long nu_idx
 
int nu_length
 
TTree * cosmic_tree
 
FlatCosmic cosmic
 
long cosmic_idx
 
int cosmic_length
 
TTree * allnus_tree
 
FlatNeutrino allnus
 
long allnus_idx
 
int allnus_length
 
TTree * allcosmics_tree
 
FlatCosmic allcosmics
 
long allcosmics_idx
 
int allcosmics_length
 

Detailed Description

Flat encoding of SRTruthBranch.

Definition at line 23 of file FlatTruthBranch.h.

Constructor & Destructor Documentation

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

Definition at line 883 of file FlatRecord.cxx.

References allcosmics_idx, allcosmics_length, allcosmics_tree, allnus_idx, allnus_length, allnus_tree, compare_h5_caf::branch, cosmic_idx, cosmic_length, cosmic_tree, faveidxeff, faveidxeffpur, faveidxeffthenpur, faveidxenergy, faveidxpur, nallcosmics, nallnus, ncosmic, nnu, nu_idx, nu_length, and nu_tree.

884  : global(prefix+"global.", tr, policy),
885  nu_tree(make_tree(prefix+"nu", "nu", tr)),
886  nu((prefix+"nu."), nu_tree, policy),
887  nu_idx(0), nu_length(0),
888  cosmic_tree(make_tree(prefix+"cosmic", "cosmic", tr)),
889  cosmic((prefix+"cosmic."), cosmic_tree, policy),
890  cosmic_idx(0), cosmic_length(0),
891  allnus_tree(make_tree(prefix+"allnus", "allnus", tr)),
892  allnus((prefix+"allnus."), allnus_tree, policy),
893  allnus_idx(0), allnus_length(0),
894  allcosmics_tree(make_tree(prefix+"allcosmics", "allcosmics", tr)),
895  allcosmics((prefix+"allcosmics."), allcosmics_tree, policy),
897 {
898  branch(tr, prefix+"faveidxeff", &faveidxeff, policy);
899  branch(tr, prefix+"faveidxenergy", &faveidxenergy, policy);
900  branch(tr, prefix+"faveidxpur", &faveidxpur, policy);
901  branch(tr, prefix+"faveidxeffpur", &faveidxeffpur, policy);
902  branch(tr, prefix+"faveidxeffthenpur", &faveidxeffthenpur, policy);
903  branch(tr, prefix+"nnu", &nnu, policy);
904  branch(tr, prefix+"ncosmic", &ncosmic, policy);
905  branch(tr, prefix+"nallnus", &nallnus, policy);
906  branch(tr, prefix+"nallcosmics", &nallcosmics, policy);
907  if(nu_tree->GetNbranches() > 0){
908  branch(tr, prefix+"nu_idx", &nu_idx, 0);
909  branch(tr, prefix+"nu_length", &nu_length, 0);
910  }
911  if(cosmic_tree->GetNbranches() > 0){
912  branch(tr, prefix+"cosmic_idx", &cosmic_idx, 0);
913  branch(tr, prefix+"cosmic_length", &cosmic_length, 0);
914  }
915  if(allnus_tree->GetNbranches() > 0){
916  branch(tr, prefix+"allnus_idx", &allnus_idx, 0);
917  branch(tr, prefix+"allnus_length", &allnus_length, 0);
918  }
919  if(allcosmics_tree->GetNbranches() > 0){
920  branch(tr, prefix+"allcosmics_idx", &allcosmics_idx, 0);
921  branch(tr, prefix+"allcosmics_length", &allcosmics_length, 0);
922  }
923 }
FlatGlobalTruth global
const XML_Char * prefix
Definition: expat.h:380
flat::FlatTruthBranch::~FlatTruthBranch ( )

Definition at line 925 of file FlatRecord.cxx.

References allcosmics_tree, allnus_tree, cosmic_tree, and nu_tree.

926 {
927  if(nu_tree->GetNbranches() > 0) nu_tree->Write();
928  delete nu_tree;
929  if(cosmic_tree->GetNbranches() > 0) cosmic_tree->Write();
930  delete cosmic_tree;
931  if(allnus_tree->GetNbranches() > 0) allnus_tree->Write();
932  delete allnus_tree;
933  if(allcosmics_tree->GetNbranches() > 0) allcosmics_tree->Write();
934  delete allcosmics_tree;
935 }

Member Function Documentation

void flat::FlatTruthBranch::Fill ( const caf::SRTruthBranch sr)

Definition at line 937 of file FlatRecord.cxx.

References caf::SRTruthBranch::allcosmics, allcosmics, allcosmics_idx, allcosmics_length, allcosmics_tree, caf::SRTruthBranch::allnus, allnus, allnus_idx, allnus_length, allnus_tree, caf::SRTruthBranch::cosmic, cosmic_idx, cosmic_length, cosmic_tree, caf::SRTruthBranch::faveidxeff, faveidxeff, caf::SRTruthBranch::faveidxeffpur, faveidxeffpur, caf::SRTruthBranch::faveidxeffthenpur, faveidxeffthenpur, caf::SRTruthBranch::faveidxenergy, faveidxenergy, caf::SRTruthBranch::faveidxpur, faveidxpur, flat::FlatGlobalTruth::Fill(), flat::FlatCosmic::Fill(), flat::FlatNeutrino::Fill(), global, caf::SRTruthBranch::global, caf::SRTruthBranch::nallcosmics, nallcosmics, caf::SRTruthBranch::nallnus, nallnus, ncosmic, caf::SRTruthBranch::ncosmic, nnu, caf::SRTruthBranch::nnu, caf::SRTruthBranch::nu, nu, nu_idx, nu_length, nu_tree, and submit_syst::x.

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

938 {
939  faveidxeff = sr.faveidxeff;
941  faveidxpur = sr.faveidxpur;
944  nnu = sr.nnu;
945  ncosmic = sr.ncosmic;
946  nallnus = sr.nallnus;
948 
949  global.Fill(sr.global);
950 
951  nu_idx += nu_length; // increment taken by previous record
952  nu_length = sr.nu.size();
953  for(const auto& x: sr.nu){
954  nu.Fill(x);
955  nu_tree->Fill();
956  }
957 
958  cosmic_idx += cosmic_length; // increment taken by previous record
959  cosmic_length = sr.cosmic.size();
960  for(const auto& x: sr.cosmic){
961  cosmic.Fill(x);
962  cosmic_tree->Fill();
963  }
964 
965  allnus_idx += allnus_length; // increment taken by previous record
966  allnus_length = sr.allnus.size();
967  for(const auto& x: sr.allnus){
968  allnus.Fill(x);
969  allnus_tree->Fill();
970  }
971 
972  allcosmics_idx += allcosmics_length; // increment taken by previous record
973  allcosmics_length = sr.allcosmics.size();
974  for(const auto& x: sr.allcosmics){
975  allcosmics.Fill(x);
976  allcosmics_tree->Fill();
977  }
978 }
void Fill(const caf::SRCosmic &sr)
void Fill(const caf::SRGlobalTruth &sr)
Definition: FlatRecord.cxx:991
short ncosmic
Number of cosmics in cosmic vector (0 or 1)
Definition: SRTruthBranch.h:38
short faveidxeffthenpur
Index of favorite in allnus when neutrinos are sorted by efficiency and slices break ties by purity...
Definition: SRTruthBranch.h:35
FlatGlobalTruth global
std::vector< SRCosmic > allcosmics
vector holding all Cosmics
Definition: SRTruthBranch.h:29
short faveidxpur
Index of favorite in allnus when sorted by purity.
Definition: SRTruthBranch.h:33
short faveidxeff
Index of favorite in allnus when sorted by slicer efficiency.
Definition: SRTruthBranch.h:31
short nallcosmics
Number of cosmics in allcosmics vector.
Definition: SRTruthBranch.h:40
short faveidxeffpur
Index of favorite in allnus when sorted by product of efficiency and purity.
Definition: SRTruthBranch.h:34
SRGlobalTruth global
Definition: SRTruthBranch.h:42
Sum up livetimes from individual cosmic triggers.
short nnu
Number of neutrinos in nu vector (0 or 1)
Definition: SRTruthBranch.h:37
std::vector< SRNeutrino > allnus
vector holding all Neutrinos
Definition: SRTruthBranch.h:28
short faveidxenergy
Index of favorite in allnus when sorted by energy.
Definition: SRTruthBranch.h:32
short nallnus
Number of neutrinos in allnus vector.
Definition: SRTruthBranch.h:39
void Fill(const caf::SRNeutrino &sr)
std::vector< SRNeutrino > nu
implemented as a vector to maintain mc.nu structure, i.e. not a pointer, but with 0 or 1 entries...
Definition: SRTruthBranch.h:25
std::vector< SRCosmic > cosmic
implemented as a vector to maintain mc.cosmic structure
Definition: SRTruthBranch.h:26

Member Data Documentation

FlatCosmic flat::FlatTruthBranch::allcosmics
protected

Definition at line 60 of file FlatTruthBranch.h.

Referenced by Fill().

long flat::FlatTruthBranch::allcosmics_idx
protected

Definition at line 61 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

int flat::FlatTruthBranch::allcosmics_length
protected

Definition at line 62 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

TTree* flat::FlatTruthBranch::allcosmics_tree
protected

Definition at line 59 of file FlatTruthBranch.h.

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

FlatNeutrino flat::FlatTruthBranch::allnus
protected

Definition at line 55 of file FlatTruthBranch.h.

Referenced by Fill().

long flat::FlatTruthBranch::allnus_idx
protected

Definition at line 56 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

int flat::FlatTruthBranch::allnus_length
protected

Definition at line 57 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

TTree* flat::FlatTruthBranch::allnus_tree
protected

Definition at line 54 of file FlatTruthBranch.h.

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

FlatCosmic flat::FlatTruthBranch::cosmic
protected

Definition at line 50 of file FlatTruthBranch.h.

long flat::FlatTruthBranch::cosmic_idx
protected

Definition at line 51 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

int flat::FlatTruthBranch::cosmic_length
protected

Definition at line 52 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

TTree* flat::FlatTruthBranch::cosmic_tree
protected

Definition at line 49 of file FlatTruthBranch.h.

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

short int flat::FlatTruthBranch::faveidxeff
protected

Definition at line 32 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

short int flat::FlatTruthBranch::faveidxeffpur
protected

Definition at line 35 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

short int flat::FlatTruthBranch::faveidxeffthenpur
protected

Definition at line 36 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

short int flat::FlatTruthBranch::faveidxenergy
protected

Definition at line 33 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

short int flat::FlatTruthBranch::faveidxpur
protected

Definition at line 34 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

FlatGlobalTruth flat::FlatTruthBranch::global
protected

Definition at line 42 of file FlatTruthBranch.h.

Referenced by Fill().

short int flat::FlatTruthBranch::nallcosmics
protected

Definition at line 40 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

short int flat::FlatTruthBranch::nallnus
protected

Definition at line 39 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

short int flat::FlatTruthBranch::ncosmic
protected

Definition at line 38 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

short int flat::FlatTruthBranch::nnu
protected
FlatNeutrino flat::FlatTruthBranch::nu
protected
long flat::FlatTruthBranch::nu_idx
protected

Definition at line 46 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

int flat::FlatTruthBranch::nu_length
protected

Definition at line 47 of file FlatTruthBranch.h.

Referenced by Fill(), and FlatTruthBranch().

TTree* flat::FlatTruthBranch::nu_tree
protected

Definition at line 44 of file FlatTruthBranch.h.

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


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