Public Member Functions | Protected Attributes | List of all members
gibuu::RecordLoader Class Reference

Helper for SimpleRecordList and OnDemandRecordList. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-02-24/EventGenerator/GiBUU/RecordList.h"

Public Member Functions

 RecordLoader (const char *fname)
 
 ~RecordLoader ()
 
long NRecords () const
 
Record GetRecord (int i) const
 

Protected Attributes

TFile * fFile
 
TTree * fTree
 
float Enu
 
float weight
 
int prod_id
 
int nparts
 
int pdgs [1024]
 
float Es [1024]
 
float px [1024]
 
float py [1024]
 
float pz [1024]
 

Detailed Description

Helper for SimpleRecordList and OnDemandRecordList.

Definition at line 46 of file RecordList.h.

Constructor & Destructor Documentation

gibuu::RecordLoader::RecordLoader ( const char *  fname)

Definition at line 34 of file RecordList.cxx.

References ana::assert(), submit_concat_project::nparts, gibuu::Record::prod_id, and gibuu::Record::weight.

35  {
36  fFile = new TFile(fname);
37  assert(!fFile->IsZombie());
38 
39  fTree = (TTree*)fFile->Get("tr");
40  assert(fTree);
41 
42  fTree->SetBranchAddress("Enu", &Enu);
43  fTree->SetBranchAddress("weight", &weight);
44  fTree->SetBranchAddress("prod_id", &prod_id);
45 
46  fTree->SetBranchAddress("nparts", &nparts);
47 
48  fTree->SetBranchAddress("pdg", &pdgs);
49  fTree->SetBranchAddress("E", &Es);
50  fTree->SetBranchAddress("px", &px);
51  fTree->SetBranchAddress("py", &py);
52  fTree->SetBranchAddress("pz", &pz);
53  }
float pz[1024]
Definition: RecordList.h:62
float Es[1024]
Definition: RecordList.h:62
float py[1024]
Definition: RecordList.h:62
float px[1024]
Definition: RecordList.h:62
assert(nhit_max >=nhit_nbins)
gibuu::RecordLoader::~RecordLoader ( )

Definition at line 56 of file RecordList.cxx.

57  {
58  delete fFile;
59  }

Member Function Documentation

Record gibuu::RecordLoader::GetRecord ( int  i) const

Definition at line 68 of file RecordList.cxx.

References ana::assert(), calib::j, submit_concat_project::nparts, gibuu::Record::parts, gibuu::Record::prod_id, gibuu::Record::Record(), and gibuu::Record::weight.

Referenced by gibuu::OnDemandRecordList::GetRecord(), and gibuu::SimpleRecordList::SimpleRecordList().

69  {
70  fTree->GetEntry(i);
71 
72  assert(nparts <= 1024);
73  std::vector<Particle> parts(nparts);
74  for(int j = 0; j < nparts; ++j){
75  parts[j].pdg = pdgs[j];
76  parts[j].E = Es[j];
77  parts[j].px = px[j];
78  parts[j].py = py[j];
79  parts[j].pz = pz[j];
80  } // end for j
81 
82  return Record(Enu, weight, prod_id, parts);
83  }
float pz[1024]
Definition: RecordList.h:62
float Es[1024]
Definition: RecordList.h:62
float py[1024]
Definition: RecordList.h:62
const double j
Definition: BetheBloch.cxx:29
float px[1024]
Definition: RecordList.h:62
assert(nhit_max >=nhit_nbins)
long gibuu::RecordLoader::NRecords ( ) const

Definition at line 62 of file RecordList.cxx.

Referenced by gibuu::SimpleRecordList::SimpleRecordList().

63  {
64  return fTree->GetEntries();
65  }

Member Data Documentation

float gibuu::RecordLoader::Enu
protected

Definition at line 58 of file RecordList.h.

float gibuu::RecordLoader::Es[1024]
protected

Definition at line 62 of file RecordList.h.

TFile* gibuu::RecordLoader::fFile
protected

Definition at line 55 of file RecordList.h.

TTree* gibuu::RecordLoader::fTree
protected

Definition at line 56 of file RecordList.h.

int gibuu::RecordLoader::nparts
protected

Definition at line 60 of file RecordList.h.

int gibuu::RecordLoader::pdgs[1024]
protected

Definition at line 61 of file RecordList.h.

int gibuu::RecordLoader::prod_id
protected

Definition at line 59 of file RecordList.h.

float gibuu::RecordLoader::px[1024]
protected

Definition at line 62 of file RecordList.h.

Referenced by mcscore.MCParticle::__init__().

float gibuu::RecordLoader::py[1024]
protected

Definition at line 62 of file RecordList.h.

Referenced by mcscore.MCParticle::__init__().

float gibuu::RecordLoader::pz[1024]
protected

Definition at line 62 of file RecordList.h.

Referenced by mcscore.MCParticle::__init__().

float gibuu::RecordLoader::weight
protected

Definition at line 58 of file RecordList.h.


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