GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
genie::evtlib::SimpleRecordList Class Reference

#include <EvtLibRecordList.h>

Inheritance diagram for genie::evtlib::SimpleRecordList:
Inheritance graph
[legend]
Collaboration diagram for genie::evtlib::SimpleRecordList:
Collaboration graph
[legend]

Public Member Functions

 SimpleRecordList (TTree *tree, const std::string &prettyName)
 
virtual ~SimpleRecordList ()
 
const EvtLibRecordGetRecord (float E) const override
 
- Public Member Functions inherited from genie::evtlib::IEvtLibRecordList
virtual ~IEvtLibRecordList ()
 

Protected Attributes

std::vector< EvtLibRecordfRecs
 

Detailed Description

Definition at line 72 of file EvtLibRecordList.h.

Constructor & Destructor Documentation

genie::evtlib::SimpleRecordList::SimpleRecordList ( TTree *  tree,
const std::string &  prettyName 
)

Definition at line 91 of file EvtLibRecordList.cxx.

References fRecs, genie::evtlib::RecordLoader::GetRecord(), and genie::evtlib::RecordLoader::NRecords().

92  {
93  std::cout << "Loading " << prettyName;
94  RecordLoader loader(tree);
95 
96  const int N = loader.NRecords();
97  fRecs.reserve(N);
98  for(int i = 0; i < N; ++i){
99  if(i%(N/8) == 0) std::cout << "." << std::flush;
100 
101  fRecs.push_back(loader.GetRecord(i));
102  } // end for i
103  std::cout << std::endl;
104 
105  std::sort(fRecs.begin(), fRecs.end());
106  }
std::vector< EvtLibRecord > fRecs
virtual genie::evtlib::SimpleRecordList::~SimpleRecordList ( )
inlinevirtual

Definition at line 76 of file EvtLibRecordList.h.

76 {}

Member Function Documentation

const EvtLibRecord * genie::evtlib::SimpleRecordList::GetRecord ( float  E) const
overridevirtual

Implements genie::evtlib::IEvtLibRecordList.

Definition at line 109 of file EvtLibRecordList.cxx.

References fRecs.

110  {
111  auto it = std::lower_bound(fRecs.begin(), fRecs.end(),
112  EvtLibRecord(E, 0, {}));
113  if(it == fRecs.end()) return 0;
114  return &(*it);
115  }
std::vector< EvtLibRecord > fRecs

Member Data Documentation

std::vector<EvtLibRecord> genie::evtlib::SimpleRecordList::fRecs
protected

Definition at line 80 of file EvtLibRecordList.h.

Referenced by GetRecord(), and SimpleRecordList().


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