22 #include <gsl/gsl_histogram.h>
50 void fill(std::vector<double> &p) {
74 bool getPart(
size_t n,
int bin, std::vector<double> &p);
144 return h_m !=
nullptr;
165 std::unique_ptr<gsl_histogram>
h_m;
179 bool operator()(
const std::vector<double>& first_part,
const std::vector<double>& second_part) {
191 bool operator()(
const std::vector<double>& first_part,
const std::vector<double>& second_part) {
198 #endif // OPAL_Bins_HH
void resetBins()
If the bunch object rebins we need to call resetBins()
bool operator()(const std::vector< double > &first_part, const std::vector< double > &second_part)
std::unique_ptr< size_t[]> nDelBin_m
size_t getTotalNumPerBin(int b)
How many particles are in the bin b.
bool operator()(const std::vector< double > &first_part, const std::vector< double > &second_part)
AscendingLocationSort(int direction=0)
std::ostream & operator<<(std::ostream &os, const Attribute &attr)
void setGamma(double gamma)
std::unique_ptr< double[]> xbinmax_m
void resetPartInBin_cyc(size_t newPartNum[], int binID)
size_t getNp()
get the number of particles in the temporary particle structure used for binning
DescendingLocationSort(int direction=0)
void setBinEmitted(int bin)
void setPartNum(int bin, long long num)
void fill(std::vector< double > &p)
Add a particle to the temporary container.
std::unique_ptr< double[]> xbinmin_m
bool isEmitted(int n, int)
size_t getTotalNum()
How many particles are in all the bins.
std::vector< std::vector< double > > tmppart_m
bool doEmission()
Is true if we still have particles to emit.
std::vector< bool > isEmitted_m
std::unique_ptr< size_t[]> nBin_m
void updatePartInBin_cyc(size_t countLost[])
virtual bool weHaveBins()
std::unique_ptr< bool[]> binsEmitted_m
Inform & print(Inform &os)
PartBins(int bins, int sbins)
std::unique_ptr< gsl_histogram > h_m
bool getPart(size_t n, int bin, std::vector< double > &p)