Project
Loading...
Searching...
No Matches
LHCConstants.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef ALICEO2_LHCCONSTANTS_H_
17#define ALICEO2_LHCCONSTANTS_H_
18
19#include "GPUCommonDef.h"
20
21namespace o2
22{
23namespace constants
24{
25namespace lhc
26{
27// LHC Beam1 and Beam2 definitions
28enum BeamDirection : int { BeamA, // beamA = beam 0,
29 BeamC, // beamC = beam 1
31 InteractingBC = -1 // as used in the BunchFilling class
32};
33GPUglobalconstexpr() int LHCMaxBunches = 3564; // max N bunches
34GPUglobalconstexpr() double LHCRFFreq = 400.789e6; // LHC RF frequency in Hz
35GPUglobalconstexpr() double LHCBunchSpacingNS = 10 * 1.e9 / LHCRFFreq; // bunch spacing in ns (10 RFbuckets)
36GPUglobalconstexpr() double LHCOrbitNS = LHCMaxBunches * LHCBunchSpacingNS; // orbit duration in ns
37GPUglobalconstexpr() double LHCRevFreq = 1.e9 / LHCOrbitNS; // revolution frequency
38GPUglobalconstexpr() double LHCBunchSpacingMUS = LHCBunchSpacingNS * 1e-3; // bunch spacing in \mus (10 RFbuckets)
39GPUglobalconstexpr() double LHCOrbitMUS = LHCOrbitNS * 1e-3; // orbit duration in \mus
40GPUglobalconstexpr() unsigned int MaxNOrbits = 0xffffffff;
41
42// Offsets of A, C beam bunches at P2
43GPUglobalconstexpr() int BunchOffsetsP2[2] = {344, 3017};
44
45// convert LHC bunch ID to BC for 2 beam directions
46constexpr int LHCBunch2P2BC(int bunch, BeamDirection dir)
47{
48 return (bunch + BunchOffsetsP2[int(dir)]) % LHCMaxBunches;
49}
50
51// convert BC at P2 to LHC bunch ID for 2 beam directions
52constexpr int P2BC2LHCBunch(int bc, BeamDirection dir)
53{
54 int bunch = bc - BunchOffsetsP2[int(dir)];
55 return bunch < 0 ? bunch + LHCMaxBunches : bunch;
56}
57
58} // namespace lhc
59} // namespace constants
60} // namespace o2
61
62#endif
uint64_t bc
Definition RawEventData.h:5
GPUglobalconstexpr() int LHCMaxBunches
constexpr int LHCBunch2P2BC(int bunch, BeamDirection dir)
constexpr int P2BC2LHCBunch(int bc, BeamDirection dir)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...