1#ifndef AMPGEN_EVENTLIST2_H
2#define AMPGEN_EVENTLIST2_H
35 std::vector<real_v> m_weights{};
36 std::vector<real_v> m_genPDF{};
56 const auto &
store()
const {
return m_data; }
58 const real_v *
block(
const unsigned &p)
const {
return m_data.data() + p * m_data.nFields(); }
59 real_v *
block(
const unsigned &p) {
return m_data.data() + p * m_data.nFields(); }
62 const auto nFields()
const {
return m_data.nFields(); }
68 void resize(
const unsigned nEvents) {
74 std::array<Event, utils::size<real_v>::value>
scatter(
unsigned)
const;
83 size_t eventSize()
const {
return m_data.nFields(); }
84 size_t size()
const {
return m_data.size(); }
85 size_t nBlocks()
const {
return m_data.nBlocks(); }
92 TTree *
tree(
const std::string &name,
const std::vector<std::string> &extraBranches = {})
const;
100 size_t nBins = argPack.getArg<PlotOptions::Bins>(100);
105 template <
typename... ARGS> std::vector<TH1D *>
makeProjections(
const std::vector<Projection> &projections,
const ARGS &...args) {
109 template <
typename... ARGS,
typename = std::enable_if_t<!std::is_same<
zeroType<ARGS...>,
ArgumentPack>::value>>
114 template <
typename... ARGS,
typename = std::enable_if_t<!std::is_same<
zeroType<ARGS...>,
ArgumentPack>::value>>
120 for(
auto &event : *
this)
fcn(event);
124 std::vector<real_v> rt(event.
size());
125 for(
unsigned i = 0; i != event.
size(); ++i) rt[i] = event[i];
Container for a set of arguments Contains a set of arguments packed from a variadic constructor,...
Base class for compiled expressions, i.e.
Encapsulates the final state particles of a single event.
void resize(const unsigned nEvents)
EventListSIMD & transform(functor &&fcn)
const Event at(const unsigned &p) const
TH2D * makeProjection(const Projection2D &projection, const ARGS &...args)
EventListSIMD(const std::vector< std::string > &fname, const EventType &evtType, const ARGS &...args)
std::vector< TH1D * > makeDefaultProjections(const ARGS &...args)
EventListSIMD(const EventList &other)
const Event operator[](const size_t &) const
const auto & store() const
real_v genPDF(const unsigned &p) const
void gather(const std::array< Event, utils::size< real_v >::value > &, unsigned)
TH2D * makeProjection(const Projection2D &projection, const ArgumentPack &args=ArgumentPack()) const
EventType eventType() const
TH1D * makeProjection(const Projection &projection, const ARGS &...args) const
TH1D * makeProjection(const Projection &projection, const ArgumentPack &args=ArgumentPack()) const
EventListSIMD(const std::string &fname, const ARGS &...args)
void loadFromFile(const std::string &fname, const ArgumentPack &args)
std::array< Event, utils::size< real_v >::value > scatter(unsigned) const
EventListSIMD(TTree *tree, const EventType &evtType, const ARGS &...args)
std::vector< TH1D * > makeProjections(const std::vector< Projection > &projections, const ArgumentPack &args)
void add(const EventListSIMD &evts)
real_v weight(const unsigned &p) const
EventListSIMD(const EventType &type)
size_t aligned_size() const
void loadFromTree(TTree *tree, const ArgumentPack &args)
void setEventType(const EventType &type)
std::vector< TH1D * > makeProjections(const std::vector< Projection > &projections, const ARGS &...args)
const real_v * data() const
static std::vector< real_v > makeEvent(const Event &event)
EventListSIMD(const std::string &fname, const EventType &evtType, const ARGS &...args)
TTree * tree(const std::string &name, const std::vector< std::string > &extraBranches={}) const
const auto nFields() const
void setGenPDF(const unsigned &block, const real_v &g)
void setWeight(const unsigned &block, const real_v &w, const real_v &g=1.f)
const real_v * block(const unsigned &p) const
real_v * block(const unsigned &p)
Deals with final state configuration of events, specifically dealing with the ordering of particles i...
std::vector< Projection > defaultProjections(const unsigned &nBins=100, const std::string &var="mass2") const
typename detail::zeroType< args... >::type zeroType
auto make_scatter_iterator(const unsigned &pos, store_type *store)
static constexpr unsigned value