24 const std::vector<EvtLibParticle>& _ps)
25 : E(_E), prod_id(_prod_id), parts(_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;
103 std::cout << std::endl;
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;
140 std::cout << std::endl;
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
RecordLoader(TTree *tree)
float px[kEvtLibMaxParts]
float Es[kEvtLibMaxParts]
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)
float py[kEvtLibMaxParts]
std::vector< EvtLibRecord > fRecs
bool operator<(const EvtLibRecord &rhs) const
Order by energy - this allows OnDemandRecordList to work efficiently.
const EvtLibRecord * GetRecord(float E) const override
float pz[kEvtLibMaxParts]
SimpleRecordList(TTree *tree, const std::string &prettyName)
int pdgs[kEvtLibMaxParts]
std::vector< std::pair< float, int > > fEnergies