14#ifndef ALICEO2_EVENTGEN_BOX
15#define ALICEO2_EVENTGEN_BOX
47 bool sampleYAndPt =
false) : mPDG{pdgid}, mMult{mult}
60 :
BoxGenerator(config.pdg, config.number, config.eta[0], config.eta[1],
61 config.prange[0], config.prange[1], config.phirange[0], config.phirange[1], config.sampleYAndPt)
65 void SetPRange(Double32_t pmin = 0, Double32_t pmax = 10)
70 mPtRangeIsSet =
false;
73 void SetPtRange(Double32_t ptmin = 0, Double32_t ptmax = 10)
91 mEtaRangeIsSet =
true;
101 mEtaRangeIsSet =
false;
111 for (
int i = 0;
i < mMult; ++
i) {
119 std::copy(mEvent.begin(), mEvent.end(), std::back_insert_iterator(
mParticles));
121 auto statusCode = particle.GetStatusCode();
135 eventHeader->
putInfo<std::string>(Key::generator,
"o2::eventgen::BoxGenerator");
140 double mPtMin{0.}, mPtMax{0.};
141 double mPhiMin{0.}, mPhiMax{360.};
142 double mEtaMin{0.}, mEtaMax{0.};
143 double mYMin{0.}, mYMax{0.};
144 double mPMin{0.}, mPMax{0.};
145 double mThetaMin{0.}, mThetaMax{0.};
146 double mEkinMin{0.}, mEkinMax{0.};
151 bool mEtaRangeIsSet{
false};
152 bool mYRangeIsSet{
false};
153 bool mThetaRangeIsSet{
false};
154 bool mCosThetaIsSet{
false};
156 bool mPtRangeIsSet{
false};
157 bool mPRangeIsSet{
false};
158 bool mEkinRangeIsSet{
false};
160 std::vector<TParticle> mEvent;
o2::monitoring::tags::Key Key
BoxGenerator(int pdgid, int mult, double etamin, double etamax, double pmin, double pmax, double phimin, double phimax, bool sampleYAndPt=false)
With sampleYAndPt, eta bounds specify rapidity and p bounds specify pT.
void updateHeader(o2::dataformats::MCEventHeader *eventHeader) override
TParticle sampleParticle() const
generates a single particle conforming to particle gun parameters
void SetPtRange(Double32_t ptmin=0, Double32_t ptmax=10)
void SetEtaRange(double etamin=-5, double etamax=5)
bool generateEvent() override
implements the main O2 generator interfaces
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
bool importParticles() override
void SetPhiRange(double phimin=0, double phimax=360)
void SetYRange(double ymin=-5, double ymax=5)
Sample rapidity uniformly; requires a transverse momentum range.
BoxGenerator(int pdgid, int mult=1)
BoxGenerator(BoxGenConfig const &config)
std::vector< TParticle > mParticles
int getHepMCStatusCode(MCGenStatusEncoding enc)
bool isEncoded(MCGenStatusEncoding statusCode)