24 const std::vector<EvtLibParticle>& _ps)
39 fTree->SetBranchAddress(
"Enu", &
Enu);
45 fTree->SetBranchAddress(
"E", &
Es);
46 fTree->SetBranchAddress(
"px", &
px);
47 fTree->SetBranchAddress(
"py", &
py);
48 fTree->SetBranchAddress(
"pz", &
pz);
59 return fTree->GetEntries();
78 std::vector<EvtLibParticle> parts(
nparts);
79 for(
int j = 0; j <
nparts; ++j){
80 parts[j].pdg =
pdgs[j];
93 std::cout <<
"Loading " << prettyName;
98 for(
int i = 0; i <
N; ++i){
99 if(i%(N/8) == 0) std::cout <<
"." <<
std::flush;
105 std::sort(fRecs.begin(), fRecs.end());
111 auto it = std::lower_bound(fRecs.begin(), fRecs.end(),
113 if(it == fRecs.end())
return 0;
119 :
fTree(tree), fPrettyName(prettyName), fLoader(0)
129 fTree->SetBranchAddress(
"Enu", &Enu);
131 const int N =
fTree->GetEntries();
134 for(
int i = 0; i <
N; ++i){
135 if(i%(N/8) == 0) std::cout <<
"." <<
std::flush;
157 std::make_pair(E, 0));
const int kEvtLibMaxParts
Maximum number of particles supported in a single library event record.
EvtLibRecord GetRecord(int i) const
THE MAIN GENIE PROJECT NAMESPACE
std::vector< EvtLibParticle > parts
RecordLoader(TTree *tree)
float px[kEvtLibMaxParts]
float Es[kEvtLibMaxParts]
const EvtLibRecord * GetRecord(float E) const override
const EvtLibRecord * GetRecord(float E) const override
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
OnDemandRecordList(TTree *tree, const std::string &prettyName)
QTextStream & flush(QTextStream &s)
Helper for SimpleRecordList and OnDemandRecordList.
float py[kEvtLibMaxParts]
bool operator<(const EvtLibRecord &rhs) const
Order by energy - this allows OnDemandRecordList to work efficiently.
float pz[kEvtLibMaxParts]
SimpleRecordList(TTree *tree, const std::string &prettyName)
int pdgs[kEvtLibMaxParts]
std::vector< std::pair< float, int > > fEnergies
QTextStream & endl(QTextStream &s)