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

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

Inheritance diagram for gibuu::SimpleRecordList:
gibuu::IRecordList

Public Member Functions

 SimpleRecordList (const char *fname)
 
virtual ~SimpleRecordList ()
 
const RecordGetRecord (float E) const override
 

Protected Attributes

std::vector< RecordfRecs
 

Detailed Description

Definition at line 66 of file RecordList.h.

Constructor & Destructor Documentation

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

Definition at line 86 of file RecordList.cxx.

References om::cout, allTimeWatchdog::endl, plot_validation_datamc::fname, gibuu::RecordLoader::GetRecord(), MECModelEnuComparisons::i, demo0::loader, gibuu::RecordLoader::NRecords(), and r().

87  {
88  std::cout << "Loading " << fname;
89  RecordLoader loader(fname);
90 
91  const int N = loader.NRecords();
92  fRecs.reserve(N);
93  for(int i = 0; i < N; ++i){
94  if(i%(N/8) == 0) std::cout << "." << std::flush;
95 
96  fRecs.push_back(loader.GetRecord(i));
97  } // end for i
99 
100  std::sort(fRecs.begin(), fRecs.end());
101 
102  // TODO - This should really happen in convert.C
103  for(Record& r: fRecs) r.weight *= fRecs.size();
104  }
loader
Definition: demo0.py:10
OStream cout
Definition: OStream.cxx:6
TRandom3 r(0)
std::vector< Record > fRecs
Definition: RecordList.h:74
virtual gibuu::SimpleRecordList::~SimpleRecordList ( )
inlinevirtual

Definition at line 70 of file RecordList.h.

References gibuu::Particle::E.

70 {}

Member Function Documentation

const Record * gibuu::SimpleRecordList::GetRecord ( float  E) const
overridevirtual

Implements gibuu::IRecordList.

Definition at line 107 of file RecordList.cxx.

References it, and gibuu::Record::Record().

108  {
109  auto it = std::lower_bound(fRecs.begin(), fRecs.end(), Record(E, 0, 0, {}));
110  if(it == fRecs.end()) return 0;
111  return &(*it);
112  }
set< int >::iterator it
Float_t E
Definition: plot.C:20
std::vector< Record > fRecs
Definition: RecordList.h:74

Member Data Documentation

std::vector<Record> gibuu::SimpleRecordList::fRecs
protected

Definition at line 74 of file RecordList.h.


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