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

Flat encoding of SRTrackBase. More...

#include "/cvmfs/"

Public Member Functions

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

Protected Attributes

size_t ntracks
TTree * tracks_tree
FlatTrack tracks
long tracks_idx
int tracks_length

Detailed Description

Flat encoding of SRTrackBase.

Definition at line 21 of file FlatTrackBase.h.

Constructor & Destructor Documentation

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

Definition at line 3587 of file FlatRecord.cxx.

References compare_h5_caf::branch, ntracks, tracks_idx, tracks_length, and tracks_tree.

3588  : tracks_tree(make_tree(prefix+"tracks", "tracks", tr)),
3589  tracks((prefix+"tracks."), tracks_tree, policy),
3590  tracks_idx(0), tracks_length(0)
3591 {
3592  branch(tr, prefix+"ntracks", &ntracks, policy);
3593  if(tracks_tree->GetNbranches() > 0){
3594  branch(tr, prefix+"tracks_idx", &tracks_idx, 0);
3595  branch(tr, prefix+"tracks_length", &tracks_length, 0);
3596  }
3597 }
const XML_Char * prefix
Definition: expat.h:380
flat::FlatTrackBase::~FlatTrackBase ( )

Definition at line 3599 of file FlatRecord.cxx.

References tracks_tree.

3600 {
3601  if(tracks_tree->GetNbranches() > 0) tracks_tree->Write();
3602  delete tracks_tree;
3603 }

Member Function Documentation

void flat::FlatTrackBase::Fill ( const caf::SRTrackBase sr)

Definition at line 3605 of file FlatRecord.cxx.

References flat::FlatTrack::Fill(), caf::SRTrackBase::ntracks, ntracks, caf::SRTrackBase::tracks, tracks, tracks_idx, tracks_length, tracks_tree, and submit_syst::x.

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

3606 {
3607  ntracks = sr.ntracks;
3609  tracks_idx += tracks_length; // increment taken by previous record
3610  tracks_length = sr.tracks.size();
3611  for(const auto& x: sr.tracks){
3612  tracks.Fill(x);
3613  tracks_tree->Fill();
3614  }
3615 }
void Fill(const caf::SRTrack &sr)
std::vector< SRTrack > tracks
Definition: SRTrackBase.h:15

Member Data Documentation

size_t flat::FlatTrackBase::ntracks

Definition at line 30 of file FlatTrackBase.h.

Referenced by Fill(), and FlatTrackBase().

FlatTrack flat::FlatTrackBase::tracks

Definition at line 33 of file FlatTrackBase.h.

Referenced by Fill().

long flat::FlatTrackBase::tracks_idx

Definition at line 34 of file FlatTrackBase.h.

Referenced by Fill(), and FlatTrackBase().

int flat::FlatTrackBase::tracks_length

Definition at line 35 of file FlatTrackBase.h.

Referenced by Fill(), and FlatTrackBase().

TTree* flat::FlatTrackBase::tracks_tree

Definition at line 32 of file FlatTrackBase.h.

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

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