Skip to content

Commit f366356

Browse files
committed
Fix C/A beam assignment (0,1) and P2 offsets
1 parent 2d6844a commit f366356

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

Common/Constants/include/CommonConstants/LHCConstants.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ namespace constants
2323
namespace lhc
2424
{
2525
// LHC Beam1 and Beam2 definitions
26-
enum BeamDirection : int { BeamClockWise,
27-
BeamAntiClockWise,
28-
NBeamDirections };
26+
enum BeamDirection : int { BeamClockWise, // beamC = beam 1,
27+
BeamAntiClockWise, // beamA = beam 2
28+
NBeamDirections,
29+
InteractingBC = -1 // as used in the BunchFilling class
30+
};
2931
constexpr int LHCMaxBunches = 3564; // max N bunches
3032
constexpr double LHCRFFreq = 400.789e6; // LHC RF frequency in Hz
3133
constexpr double LHCBunchSpacingNS = 10 * 1.e9 / LHCRFFreq; // bunch spacing in ns (10 RFbuckets)
@@ -36,7 +38,7 @@ constexpr double LHCOrbitMUS = LHCOrbitNS * 1e-3; // orbit durati
3638
constexpr unsigned int MaxNOrbits = 0xffffffff;
3739

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

4143
// convert LHC bunch ID to BC for 2 beam directions
4244
constexpr int LHCBunch2P2BC(int bunch, BeamDirection dir)

DataFormats/common/include/CommonDataFormat/BunchFilling.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ class BunchFilling
4141
// get interacting bunches pattern (B)
4242
const auto& getBCPattern() const { return mPattern; }
4343

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

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

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

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

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

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

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

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

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

9999
ClassDefNV(BunchFilling, 2);
100100
};

0 commit comments

Comments
 (0)