Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Common/Constants/include/CommonConstants/LHCConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ namespace constants
namespace lhc
{
// LHC Beam1 and Beam2 definitions
enum BeamDirection : int { BeamClockWise,
BeamAntiClockWise,
NBeamDirections };
enum BeamDirection : int { BeamClockWise, // beamC = beam 1,
BeamAntiClockWise, // beamA = beam 2
NBeamDirections,
InteractingBC = -1 // as used in the BunchFilling class
};
constexpr int LHCMaxBunches = 3564; // max N bunches
constexpr double LHCRFFreq = 400.789e6; // LHC RF frequency in Hz
constexpr double LHCBunchSpacingNS = 10 * 1.e9 / LHCRFFreq; // bunch spacing in ns (10 RFbuckets)
Expand All @@ -36,7 +38,7 @@ constexpr double LHCOrbitMUS = LHCOrbitNS * 1e-3; // orbit durati
constexpr unsigned int MaxNOrbits = 0xffffffff;

// Offsets of clockwise and anticlockwise beam bunches at P2
constexpr int BunchOffsetsP2[2] = {346, 3019};
constexpr int BunchOffsetsP2[2] = {3017, 344};

// convert LHC bunch ID to BC for 2 beam directions
constexpr int LHCBunch2P2BC(int bunch, BeamDirection dir)
Expand Down
12 changes: 6 additions & 6 deletions DataFormats/common/include/CommonDataFormat/BunchFilling.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ class BunchFilling
// get interacting bunches pattern (B)
const auto& getBCPattern() const { return mPattern; }

// get pattern or clockwise (0, A) and anticlockwise (1, C) beams at P2
// get pattern or clockwise (1, A) and anticlockwise (0, C) beams at P2
const auto& getBeamPattern(int beam) const { return mBeamAC[beam]; }

// get pattern of interacting BCs (-1) or beams filled BCs at P2 (0,1)
const auto& getPattern(int dir = -1) const { return dir < 0 ? getBCPattern() : getBeamPattern(dir); }

// get number of interacting bunches (-1) and number of filled bunches for clockwise (0, A) and anticlockwise (1, C) beams
// get number of interacting bunches (-1) and number of filled bunches for clockwise (1, A) and anticlockwise (0, C) beams
int getNBunches(int dir = -1) const { return dir < 0 ? mPattern.count() : mBeamAC[dir].count(); }

// test interacting bunch
Expand All @@ -56,10 +56,10 @@ class BunchFilling
// test bean bunch
bool testBeamBunch(int bcID, int dir) const { return mBeamAC[dir][bcID]; }

// test interacting (-1) or clockwise (0, A) and anticlockwise (1, C) beams bunch
// test interacting (-1) or clockwise (1, A) and anticlockwise (0, C) beams bunch
bool testBC(int bcID, int dir = -1) const { return dir < 0 ? testInteractingBC(bcID) : testBeamBunch(bcID, dir); }

// BC setters, dir=-1 is for interacting bunches pattern, 0,1 for clockwise (A) and anticlockwise (C) beams
// BC setters, dir=-1 is for interacting bunches pattern, 0, 1 for clockwise (C) and anticlockwise (A) beams
void setBC(int bcID, bool active = true, int dir = -1);
void setBCTrain(int nBC, int bcSpacing, int firstBC, int dir = -1);
void setBCTrains(int nTrains, int trainSpacingInBC, int nBC, int bcSpacing, int firstBC, int dir = -1);
Expand All @@ -72,7 +72,7 @@ class BunchFilling
int getFirstFilledBC(int dir = -1) const;
int getLastFilledBC(int dir = -1) const;

// print pattern of bunches, dir=0,1: for A,C beams, dir=-1: for interacting BCs, otherwise: all
// print pattern of bunches, dir=0,1: for C,A beams, dir=-1: for interacting BCs, otherwise: all
void print(int dir = -2, int bcPerLine = 100) const;

// set BC filling a la TPC TDR, 12 50ns trains of 48 BCs
Expand All @@ -94,7 +94,7 @@ class BunchFilling
static bool parsePattern(const unsigned char*& input, Pattern& patt, int& ibit, int& level);

Pattern mPattern{}; // Pattern of interacting BCs at P2
std::array<Pattern, o2::constants::lhc::NBeamDirections> mBeamAC{}; // pattern of 2 beam bunches at P2
std::array<Pattern, o2::constants::lhc::NBeamDirections> mBeamAC{}; // pattern of 2 beam bunches at P2, 0 for C, 1 for A beam

ClassDefNV(BunchFilling, 2);
};
Expand Down