GENIEGenerator
Loading...
Searching...
No Matches
genie::CacheBranchNtp Class Reference

A simple cache branch storing the cached data in a TNtuple. More...

#include <CacheBranchNtp.h>

Inheritance diagram for genie::CacheBranchNtp:
[legend]
Collaboration diagram for genie::CacheBranchNtp:
[legend]

Public Member Functions

 CacheBranchNtp ()
 CacheBranchNtp (string name, string brdef)
 ~CacheBranchNtp ()
TNtupleD * Ntuple (void) const
void CreateNtuple (string name, string branch_def)
void Reset (void)
void Print (ostream &stream) const
TNtupleD * operator() (void) const
Public Member Functions inherited from genie::CacheBranchI
virtual ~CacheBranchI ()

Private Member Functions

void Init (void)
void CleanUp (void)

Private Attributes

TNtupleD * fNtp

Friends

ostream & operator<< (ostream &stream, const CacheBranchNtp &cbntp)

Additional Inherited Members

Protected Member Functions inherited from genie::CacheBranchI
 CacheBranchI ()

Detailed Description

A simple cache branch storing the cached data in a TNtuple.

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n November 26, 2004
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 35 of file CacheBranchNtp.h.

Constructor & Destructor Documentation

◆ CacheBranchNtp() [1/2]

CacheBranchNtp::CacheBranchNtp ( void )

Definition at line 29 of file CacheBranchNtp.cxx.

29 :
31{
32 this->Init();
33}

References genie::CacheBranchI::CacheBranchI(), and Init().

Referenced by operator<<.

◆ CacheBranchNtp() [2/2]

CacheBranchNtp::CacheBranchNtp ( string name,
string brdef )

Definition at line 35 of file CacheBranchNtp.cxx.

35 :
37{
38 this->Init();
39 this->CreateNtuple(name, branch_def);
40}
void CreateNtuple(string name, string branch_def)

References genie::CacheBranchI::CacheBranchI(), CreateNtuple(), and Init().

◆ ~CacheBranchNtp()

CacheBranchNtp::~CacheBranchNtp ( )

Definition at line 42 of file CacheBranchNtp.cxx.

43{
44 this->CleanUp();
45}

References CleanUp().

Member Function Documentation

◆ CleanUp()

void CacheBranchNtp::CleanUp ( void )
private

Definition at line 52 of file CacheBranchNtp.cxx.

53{
54 if(fNtp) delete fNtp;
55}

References fNtp.

Referenced by Reset(), and ~CacheBranchNtp().

◆ CreateNtuple()

void CacheBranchNtp::CreateNtuple ( string name,
string branch_def )

Definition at line 63 of file CacheBranchNtp.cxx.

64{
65 this->Reset();
66
67 fNtp = new TNtupleD(name.c_str(), "CacheBranchNtp", branch_def.c_str());
68 fNtp->SetDirectory(0);
69 fNtp->SetCircular(1600000);
70}

References fNtp, and Reset().

Referenced by CacheBranchNtp().

◆ Init()

void CacheBranchNtp::Init ( void )
private

Definition at line 47 of file CacheBranchNtp.cxx.

48{
49 fNtp = 0;
50}

References fNtp.

Referenced by CacheBranchNtp(), CacheBranchNtp(), and Reset().

◆ Ntuple()

TNtupleD * genie::CacheBranchNtp::Ntuple ( void ) const
inline

Definition at line 44 of file CacheBranchNtp.h.

44{ return fNtp; }

References fNtp.

Referenced by operator()().

◆ operator()()

TNtupleD * CacheBranchNtp::operator() ( void ) const

Definition at line 81 of file CacheBranchNtp.cxx.

82{
83 return this->Ntuple();
84}
TNtupleD * Ntuple(void) const

References Ntuple().

◆ Print()

void CacheBranchNtp::Print ( ostream & stream) const

Definition at line 72 of file CacheBranchNtp.cxx.

73{
74 if(fNtp) {
75 stream << "type: [CacheBranchNtp] - nentries: " << fNtp->GetEntries();
76 } else {
77 stream << " *** NULL ***";
78 }
79}

References fNtp.

Referenced by operator<<.

◆ Reset()

void CacheBranchNtp::Reset ( void )

Definition at line 57 of file CacheBranchNtp.cxx.

58{
59 this->CleanUp();
60 this->Init();
61}

References CleanUp(), and Init().

Referenced by CreateNtuple().

◆ operator<<

ostream & operator<< ( ostream & stream,
const CacheBranchNtp & cbntp )
friend

Definition at line 22 of file CacheBranchNtp.cxx.

23 {
24 cbntp.Print(stream);
25 return stream;
26 }
void Print(ostream &stream) const

References CacheBranchNtp(), and Print().

Member Data Documentation

◆ fNtp

TNtupleD* genie::CacheBranchNtp::fNtp
private

Definition at line 58 of file CacheBranchNtp.h.

Referenced by CleanUp(), CreateNtuple(), Init(), Ntuple(), and Print().


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