Project
Loading...
Searching...
No Matches
DPLAlpideParam.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
12#ifndef ALICEO2_ITSMFTDPLBASEPARAM_H_
13#define ALICEO2_ITSMFTDPLBASEPARAM_H_
14
19#include <string_view>
20
21namespace o2
22{
23namespace itsmft
24{
25constexpr float DEFStrobeDelay = o2::constants::lhc::LHCBunchSpacingNS * 4; // ~100 ns delay
26
27template <int N>
28struct DPLAlpideParam : public o2::conf::ConfigurableParamHelper<DPLAlpideParam<N>> {
29 static constexpr int getNLayers()
30 {
31 return N == o2::detectors::DetID::ITS ? 7 : 10;
32 }
33
34 static constexpr std::string_view getParamName()
35 {
36 return N == o2::detectors::DetID::ITS ? ParamName[0] : ParamName[1];
37 }
38
39 int roFrameLengthInBC = DEFROFLengthBC();
40 float roFrameLengthTrig = DEFROFLengthTrig();
42 float strobeLengthCont = -1.;
43 float strobeLengthTrig = 100.;
44 int roFrameBiasInBC = DEFROFBiasInBC();
48
49 static constexpr bool supportsStaggering() noexcept { return (N == o2::detectors::DetID::ITS) ? false : false; }
50 // test if staggering is on
51 bool withStaggering() const noexcept
52 {
53 if constexpr (!supportsStaggering()) {
54 return false;
55 }
56 for (int i{0}; i < getNLayers(); ++i) {
57 if (roFrameLayerLengthInBC[i] != 0) {
58 return true;
59 }
60 }
61 return false;
62 }
63 // get ROF length for any layer
65 int getROFBiasInBC(int layer) const noexcept { return (withStaggering()) ? roFrameLayerBiasInBC[layer] : roFrameBiasInBC; }
66 int getROFDelayInBC(int layer) const noexcept { return (withStaggering()) ? roFrameLayerDelayInBC[layer] : 0; }
67
68 // boilerplate stuff + make principal key
70
71 private:
72 static constexpr std::string_view ParamName[2] = {"ITSAlpideParam", "MFTAlpideParam"};
73
74 static constexpr int DEFROFLengthBC()
75 {
76 // default ROF length in BC for continuous mode
77 // allowed values: 1,2,3,4,6,9,11,12,18,22,27,33,36
79 }
80 static constexpr float DEFROFLengthTrig()
81 {
82 // length of RO frame in ns for triggered mode
83 return N == o2::detectors::DetID::ITS ? 6000. : 6000.;
84 }
85
86 static constexpr int DEFROFBiasInBC()
87 {
88 // default ROF length bias in MC, see https://github.com/AliceO2Group/AliceO2/pull/11108 for ITS
89 return N == o2::detectors::DetID::ITS ? 64 : 60;
90 }
91
92 static_assert(N == o2::detectors::DetID::ITS || N == o2::detectors::DetID::MFT, "only DetID::ITS orDetID:: MFT are allowed");
93 static_assert(o2::constants::lhc::LHCMaxBunches % DEFROFLengthBC() == 0); // make sure ROF length is divisor of the orbit
94};
95
96template <int N>
97DPLAlpideParam<N> DPLAlpideParam<N>::sInstance;
98
99} // namespace itsmft
100
101namespace framework
102{
103template <typename T>
104struct is_messageable;
105template <>
106struct is_messageable<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>> : std::true_type {
107};
108template <typename T>
109struct is_messageable;
110template <>
111struct is_messageable<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::MFT>> : std::true_type {
112};
113
114} // namespace framework
115
116} // namespace o2
117
118#endif
int32_t i
Header to collect LHC related constants.
static constexpr ID ITS
Definition DetID.h:63
static constexpr ID MFT
Definition DetID.h:71
GLboolean * data
Definition glcorearb.h:298
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
constexpr int LHCMaxBunches
constexpr double LHCBunchSpacingNS
constexpr float DEFStrobeDelay
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
bool withStaggering() const noexcept
int roFrameBiasInBC
bias of the start of ROF wrt orbit start: t_irof = (irof*roFrameLengthInBC + roFrameBiasInBC)*BClengt...
int roFrameLayerLengthInBC[getNLayers()]
staggering ROF length in BC for continuous mode per layer
float strobeDelay
strobe start (in ns) wrt ROF start
int roFrameLayerDelayInBC[getNLayers()]
staggering ROF delay in BC for continuous mode per layer
static constexpr std::string_view getParamName()
static constexpr int getNLayers()
int getROFLengthInBC(int layer) const noexcept
int roFrameLengthInBC
ROF length in BC for continuous mode.
float strobeLengthCont
if < 0, full ROF length - delay
static constexpr bool supportsStaggering() noexcept
int getROFDelayInBC(int layer) const noexcept
O2ParamDef(DPLAlpideParam, getParamName().data())
int roFrameLayerBiasInBC[getNLayers()]
staggering ROF bias in BC for continuous mode per layer
float strobeLengthTrig
length of the strobe in ns (sig. over threshold checked in this window only)
float roFrameLengthTrig
length of RO frame in ns for triggered mode
int getROFBiasInBC(int layer) const noexcept