26 const int ntest = 100;
27 std::vector<o2::InteractionTimeRecord> records;
28 records.reserve(ntest);
30 printf(
"Testing sampler with default settings\n");
34 defSampler.generateCollisionTimes(records);
36 for (
const auto&
rec : records) {
41 printf(
"\nTesting sampler with custom bunch filling and low mu\n");
45 sampler1.getBunchFilling().setBCTrain(100, 1, 0);
47 sampler1.getBunchFilling().setBCTrain(200, 2, 200);
49 sampler1.getBunchFilling().setBC(1600);
52 sampler1.getBunchFilling().setBCTrains(5, 10, 20, 4, 700);
54 sampler1.setInteractionRate(40e3);
56 sampler1.generateCollisionTimes(records);
58 for (
const auto&
rec : records) {
64 records.reserve((
int)sampler1.getInteractionRate());
65 sampler1.generateCollisionTimes(records);
66 double dt = (records.back().getTimeNS() - records.front().getTimeNS()) * 1.e-9;
67 printf(
"\nGenerated %d collisions with time span %.3fs at IR=%e\n",
68 (
int)records.size(), dt, sampler1.getInteractionRate());
73 printf(
"\nResetting/testing sampler with same bunch filling but high mu\n");
74 sampler1.setMuPerBC(0.5);
78 for (
int i = 0;
i < ntest;
i++) {
79 auto rec = sampler1.generateCollisionTime();
86 sampler1.getBunchFilling().print();