GENIEGenerator
Loading...
Searching...
No Matches
CacheBranchNtp.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Costas Andreopoulos <c.andreopoulos \at cern.ch>
7 University of Liverpool
8*/
9//____________________________________________________________________________
10
11#include <TNtupleD.h>
12
14
15using namespace genie;
16
18
19//____________________________________________________________________________
20namespace genie
21{
22 ostream & operator << (ostream & stream, const CacheBranchNtp & cbntp)
23 {
24 cbntp.Print(stream);
25 return stream;
26 }
27}
28//____________________________________________________________________________
31{
32 this->Init();
33}
34//____________________________________________________________________________
35CacheBranchNtp::CacheBranchNtp(string name, string branch_def) :
37{
38 this->Init();
39 this->CreateNtuple(name, branch_def);
40}
41//____________________________________________________________________________
46//____________________________________________________________________________
48{
49 fNtp = 0;
50}
51//____________________________________________________________________________
53{
54 if(fNtp) delete fNtp;
55}
56//____________________________________________________________________________
58{
59 this->CleanUp();
60 this->Init();
61}
62//____________________________________________________________________________
63void CacheBranchNtp::CreateNtuple(string name, string branch_def)
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}
71//____________________________________________________________________________
72void CacheBranchNtp::Print(ostream & stream) const
73{
74 if(fNtp) {
75 stream << "type: [CacheBranchNtp] - nentries: " << fNtp->GetEntries();
76 } else {
77 stream << " *** NULL ***";
78 }
79}
80//____________________________________________________________________________
81TNtupleD * CacheBranchNtp::operator () (void) const
82{
83 return this->Ntuple();
84}
85//____________________________________________________________________________
ClassImp(CacheBranchNtp)
A simple cache branch storing the cached data in a TNtuple.
TNtupleD * Ntuple(void) const
void CreateNtuple(string name, string branch_def)
TNtupleD * operator()(void) const
void Print(ostream &stream) const
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)