199template<
int NPart,
typename ParticleClass,
typename ParticleInfoStruct,
int NumBins = 1>
212 void add(
const ParticleInfoStruct& p)
220 std::vector<event_buffer>
part_events = std::vector<event_buffer>(NPart);
241 KVEventMixerN(
typename event_buffer::size_type number_of_events_to_mix = 10)
245 template<
typename TreatCorFunc>
255 template<
typename TreatCorFunc,
typename part_iterator,
typename... part_iterator_list>
256 void process_event(
int part_index, TreatCorFunc TreatCor, part_iterator& iter_part, part_iterator_list... part_iterators)
263 bool count_and_store =
true;
266 if (part_index > 0) {
267 for (
int i = 0; i < part_index; ++i) count_and_store &= (
n_part[i] == 1);
269 for (
auto& part : iter_part) {
270 if (count_and_store) {
287 template<
typename part_iterator,
typename... part_iterator_list>
298 for (
auto& part : iter_part) {
308 template<
typename TreatNCorFunc>
309 void recursive_decorrelation(ParticleClass& part,
int part_index,
int decor_index,
int decor_vec_index, TreatNCorFunc TreatNCor)
311 if (decor_index == NPart) {
314 else if (decor_index != part_index) {
329 template<
typename TreatNCorFunc>
333 template<
typename TreatNCorFunc,
typename part_iterator,
typename... part_iterator_list>
334 void decorrelate(
int part_index, TreatNCorFunc TreatNCor, part_iterator& iter_part, part_iterator_list... part_iterators)
341 for (
auto& part : iter_part) {
345 decorrelate(part_index, TreatNCor, part_iterators...);
348 template<
typename TreatCorFunc,
typename TreatNCorFunc,
typename part_iterator,
typename... part_iterator_list>
349 void ProcessEvent(
int bin_number, TreatCorFunc TreatCor, TreatNCorFunc TreatNCor,
const part_iterator& iter_part, part_iterator_list... part_iterators)
353 for (
int i = 0; i < NPart; ++i) {
374 for (
int i = 0; i < NPart; ++i) {
378 for (
int j = 0; j < NPart; ++j) {
379 if (j == i)
continue;
385 decorrelate(-1, TreatNCor, iter_part, part_iterators...);
388 for (
int i = 0; i < NPart; ++i) {
size_t size(const MatrixT &matrix)
winID h TVirtualViewer3D TVirtualGLPainter p
Generic event mixing algorithm for N-particle correlation studies.
KVEventMixerN(typename event_buffer::size_type number_of_events_to_mix=10)
vector of references to particles from buffers for decorrelation
void fill_all_particle_buffers(int part_index, part_iterator &iter_part, part_iterator_list... part_iterators)
std::array< int, NPart > n_part
bin number passed in current call to ProcessEvent
void decorrelate(int part_index, TreatNCorFunc TreatNCor, part_iterator &iter_part, part_iterator_list... part_iterators)
std::array< bool, NPart > buffer_ready
void process_event(int, TreatCorFunc TreatCor)
void decorrelate(int, TreatNCorFunc)
std::array< bool, NPart > mult_fixed
particle multiplicities for event being treated by ProcessEvent
void process_event(int part_index, TreatCorFunc TreatCor, part_iterator &iter_part, part_iterator_list... part_iterators)
void ProcessEvent(int bin_number, TreatCorFunc TreatCor, TreatNCorFunc TreatNCor, const part_iterator &iter_part, part_iterator_list... part_iterators)
std::array< bool, NPart > can_decorrelate
void fill_all_particle_buffers(int)
int current_bin_number
number of events used for decorrelation (event mixing)
event_buffer::size_type decor_events
KVRefVec< ParticleClass > correlated_particles
std::deque< event > event_buffer
void recursive_decorrelation(ParticleClass &part, int part_index, int decor_index, int decor_vec_index, TreatNCorFunc TreatNCor)
KVRefVec< ParticleInfoStruct > uncorrelated_particles
vector of references to particles in current event
Vector of references to objects.
std::vector< event_buffer > part_events
std::vector< ParticleInfoStruct > particles
event(const ParticleInfoStruct &p)
event(const event &)=default
void add(const ParticleInfoStruct &p)