13#include <fairlogger/Logger.h>
24 LOG(warning) <<
"No bunch filling provided, impose default one";
30 LOG(warning) <<
"No IR or muBC is provided, setting default IR";
36 LOG(info) <<
"Deducing IR=" <<
mIntRate <<
"Hz from " << nBCSet <<
" BCs at mu=" <<
mMuBC;
39 LOG(info) <<
"Deducing mu=" <<
mMuBC <<
" per BC from IR=" <<
mIntRate <<
" with " << nBCSet <<
" BCs";
59 while ((
n = gRandom->Poisson(mu)) == 0) {
88 LOG(error) <<
"not yet initialized";
91 LOG(info) <<
"InteractionSampler with " <<
mInteractingBCs.size() <<
" colliding BCs, mu(BC)= "
124 for (
int i = ncoll;
i--;) {
128 std::sort(
mTimeInBC.begin(),
mTimeInBC.end(), [](
const float a,
const float b) { return a > b; });
142 LOG(fatal) <<
"Failed to load bunch filling from " << bcFillingFile;
int getNBunches(int dir=-1) const
bool testBC(int bcID, int dir=-1) const
static BunchFilling * loadFrom(const std::string &fileName, const std::string &objName="")
void initialize(const RandomType randomType=RandomType::Gaus)
o2::InteractionTimeRecord mFirstIR
static constexpr float DefIntRate
default interaction rate
float getInteractionRate() const
int simulateInteractingBC()
std::vector< uint16_t > mInteractingBCs
o2::BunchFilling mBCFilling
patter of active BCs
o2::math_utils::RandomRing< 10000 > mBCJumpGenerator
float mBCTimeRMS
BC time spread in NANOSECONDS.
double mMuBC
interaction probability per BC
o2::math_utils::RandomRing< 1000 > mNCollBCGenerator
o2::math_utils::RandomRing< 1000 > mCollTimeGenerator
void nextCollidingBC(int n)
std::vector< float > mTimeInBC
interaction times within single BC
int mCurrBCIdx
counter for current interacting bunch
const o2::InteractionTimeRecord & generateCollisionTime()
o2::InteractionTimeRecord mIR
void setBunchFilling(const BunchFilling &bc)
float mIntRate
total interaction rate in Hz
int mIntBCCache
N interactions left for current BC.
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
constexpr int LHCMaxBunches
constexpr double LHCBunchSpacingNS
constexpr double LHCRevFreq
uint16_t bc
bunch crossing ID of interaction
double timeInBCNS
time in NANOSECONDS relative to orbit/bc
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"