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
21
namespace
o2
22
{
23
namespace
constants
24
{
25
namespace
lhc
26
{
27
// LHC Beam1 and Beam2 definitions
28
enum
BeamDirection
:
int
{
BeamA
,
// beamA = beam 0,
29
BeamC
,
// beamC = beam 1
30
NBeamDirections
,
31
InteractingBC
= -1
// as used in the BunchFilling class
32
};
33
GPUglobalconstexpr
() int LHCMaxBunches = 3564;
// max N bunches
34
GPUglobalconstexpr
()
double
LHCRFFreq = 400.789e6;
// LHC RF frequency in Hz
35
GPUglobalconstexpr
()
double
LHCBunchSpacingNS = 10 * 1.e9 / LHCRFFreq;
// bunch spacing in ns (10 RFbuckets)
36
GPUglobalconstexpr
()
double
LHCOrbitNS = LHCMaxBunches * LHCBunchSpacingNS;
// orbit duration in ns
37
GPUglobalconstexpr
()
double
LHCRevFreq = 1.e9 / LHCOrbitNS;
// revolution frequency
38
GPUglobalconstexpr
()
double
LHCBunchSpacingMUS = LHCBunchSpacingNS * 1e-3;
// bunch spacing in \mus (10 RFbuckets)
39
GPUglobalconstexpr
()
double
LHCOrbitMUS = LHCOrbitNS * 1e-3;
// orbit duration in \mus
40
GPUglobalconstexpr
()
unsigned
int
MaxNOrbits = 0xffffffff;
41
42
// Offsets of A, C beam bunches at P2
43
GPUglobalconstexpr
()
int
BunchOffsetsP2[2] = {344, 3017};
44
45
// convert LHC bunch ID to BC for 2 beam directions
46
constexpr
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
52
constexpr
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
bc
uint64_t bc
Definition
RawEventData.h:5
GPUCommonDef.h
o2::constants::lhc::GPUglobalconstexpr
GPUglobalconstexpr() int LHCMaxBunches
o2::constants::lhc::LHCBunch2P2BC
constexpr int LHCBunch2P2BC(int bunch, BeamDirection dir)
Definition
LHCConstants.h:46
o2::constants::lhc::P2BC2LHCBunch
constexpr int P2BC2LHCBunch(int bc, BeamDirection dir)
Definition
LHCConstants.h:52
o2::constants::lhc::BeamDirection
BeamDirection
Definition
LHCConstants.h:28
o2::constants::lhc::BeamC
@ BeamC
Definition
LHCConstants.h:29
o2::constants::lhc::NBeamDirections
@ NBeamDirections
Definition
LHCConstants.h:30
o2::constants::lhc::BeamA
@ BeamA
Definition
LHCConstants.h:28
o2::constants::lhc::InteractingBC
@ InteractingBC
Definition
LHCConstants.h:31
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
FlattenRestore.h:23
Common
Constants
include
CommonConstants
LHCConstants.h
Generated on Fri Sep 25 2026 13:59:00 for Project by
1.9.8