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_ITSMFTALPIDEPARAM_H_
13#define ALICEO2_ITSMFTALPIDEPARAM_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 // get ROF length for any layer
52 int getROFDelayInBC(int layer) const noexcept { return roFrameLayerDelayInBC[layer] ? roFrameLayerDelayInBC[layer] : 0; }
53
54 // boilerplate stuff + make principal key
56
57 private:
58 static constexpr std::string_view ParamName[2] = {"ITSAlpideParam", "MFTAlpideParam"};
59
60 static constexpr int DEFROFLengthBC()
61 {
62 // default ROF length in BC for continuous mode
63 // allowed values: 1,2,3,4,6,9,11,12,18,22,27,33,36
65 }
66 static constexpr float DEFROFLengthTrig()
67 {
68 // length of RO frame in ns for triggered mode
69 return N == o2::detectors::DetID::ITS ? 6000. : 6000.;
70 }
71
72 static constexpr int DEFROFBiasInBC()
73 {
74 // default ROF length bias in MC, see https://github.com/AliceO2Group/AliceO2/pull/11108 for ITS
75 return N == o2::detectors::DetID::ITS ? 64 : 60;
76 }
77
78 static_assert(N == o2::detectors::DetID::ITS || N == o2::detectors::DetID::MFT, "only DetID::ITS orDetID:: MFT are allowed");
79 static_assert(o2::constants::lhc::LHCMaxBunches % DEFROFLengthBC() == 0); // make sure ROF length is divisor of the orbit
80};
81
82template <int N>
83DPLAlpideParam<N> DPLAlpideParam<N>::sInstance;
84
85} // namespace itsmft
86
87namespace framework
88{
89template <typename T>
90struct is_messageable;
91template <>
92struct is_messageable<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>> : std::true_type {
93};
94template <typename T>
95struct is_messageable;
96template <>
97struct is_messageable<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::MFT>> : std::true_type {
98};
99
100} // namespace framework
101
102} // namespace o2
103
104#endif
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 ...
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
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