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
20#include <string_view>
21
22namespace o2
23{
24namespace itsmft
25{
26constexpr float DEFStrobeDelay = o2::constants::lhc::LHCBunchSpacingNS * 4; // ~100 ns delay
27
28template <int N>
29struct DPLAlpideParam : public o2::conf::ConfigurableParamHelper<DPLAlpideParam<N>> {
30 static constexpr int getNLayers()
31 {
32 return N == o2::detectors::DetID::ITS ? 7 : 10;
33 }
34
35 static constexpr std::string_view getParamName()
36 {
37 return N == o2::detectors::DetID::ITS ? ParamName[0] : ParamName[1];
38 }
39
40 int roFrameLengthInBC = DEFROFLengthBC();
41 float roFrameLengthTrig = DEFROFLengthTrig();
43 float strobeLengthCont = -1.;
44 float strobeLengthTrig = 100.;
45 int roFrameBiasInBC = DEFROFBiasInBC();
49
50 // get ROF length for any layer
53 int getROFDelayInBC(int layer) const noexcept { return roFrameLayerDelayInBC[layer] ? roFrameLayerDelayInBC[layer] : 0; }
54
55 // boilerplate stuff + make principal key
57
58 private:
59 static constexpr std::string_view ParamName[2] = {"ITSAlpideParam", "MFTAlpideParam"};
60
61 static constexpr int DEFROFLengthBC()
62 {
63 // default ROF length in BC for continuous mode
64 // allowed values: 1,2,3,4,6,9,11,12,18,22,27,33,36
65 return N == o2::detectors::DetID::ITS ? o2::constants::lhc::LHCMaxBunches / 4 : o2::constants::lhc::LHCMaxBunches / 18;
66 }
67 static constexpr float DEFROFLengthTrig()
68 {
69 // length of RO frame in ns for triggered mode
70 return N == o2::detectors::DetID::ITS ? 6000. : 6000.;
71 }
72
73 static constexpr int DEFROFBiasInBC()
74 {
75 // default ROF length bias in MC, see https://github.com/AliceO2Group/AliceO2/pull/11108 for ITS
76 return N == o2::detectors::DetID::ITS ? 64 : 60;
77 }
78
79 static_assert(N == o2::detectors::DetID::ITS || N == o2::detectors::DetID::MFT, "only DetID::ITS orDetID:: MFT are allowed");
80 // the per-layer clusters are referred to by the composed ID of ClusterID.h, whose layer field must
81 // match the number of layers of this detector, see composeClusID
82 static_assert(getNLayers() == (N == o2::detectors::DetID::ITS ? MaxITSClusLayers : MaxMFTClusLayers),
83 "layers count mismatch between DPLAlpideParam and the composed cluster ID encoding of ClusterID.h");
84 static_assert(o2::constants::lhc::LHCMaxBunches % DEFROFLengthBC() == 0); // make sure ROF length is divisor of the orbit
85};
86
87template <int N>
88DPLAlpideParam<N> DPLAlpideParam<N>::sInstance;
89
90} // namespace itsmft
91
92namespace framework
93{
94template <typename T>
95struct is_messageable;
96template <>
97struct is_messageable<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>> : std::true_type {
98};
99template <typename T>
100struct is_messageable;
101template <>
102struct is_messageable<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::MFT>> : std::true_type {
103};
104
105} // namespace framework
106
107} // namespace o2
108
109#endif
Composition/decomposition of the ITS/MFT cluster IDs referring to per-layer cluster arrays.
Header to collect LHC related constants.
GLboolean * data
Definition glcorearb.h:298
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
constexpr int MaxITSClusLayers
Definition ClusterID.h:23
constexpr int MaxMFTClusLayers
Definition ClusterID.h:24
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