Project
Loading...
Searching...
No Matches
TOFFEElightConfig.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 DETECTOR_TOFFEELIGHTCONFIG_H_
13#define DETECTOR_TOFFEELIGHTCONFIG_H_
14
15#include "Rtypes.h"
16#include "TOFBase/Geo.h"
17#include <array>
18
19using namespace o2::tof;
20
21namespace o2
22{
23namespace tof
24{
25
27
28 enum EStatus_t {
29 kStatusEnabled = 0x1
30 };
31 unsigned char mStatus = 0x0; // status
32 int mMatchingWindow = 0; // matching window [ns] // can this be int32?
33 int mLatencyWindow = 0; // latency window [ns] // can this be int32?
35 bool isEnabled() const { return mStatus & kStatusEnabled; };
36
38};
39
40//_____________________________________________________________________________
41
43
44 unsigned int mStatusMap = 0; // status // can it be uint32?
46
48};
49
50//_____________________________________________________________________________
51
53
54 unsigned int mHVstat[Geo::NPLATES]; // 1 bit per strip status inside 5 modules
55 TOFFEEmapHVConfig() = default;
56
58};
59
60//_____________________________________________________________________________
61
63
64 static constexpr int NCHANNELS = 172800;
65 static constexpr int NTRIGGERMAPS = Geo::kNCrate;
66
67 int mVersion = 0; // version
68 int mRunNumber = 0; // run number
69 int mRunType = 0; // run type
70
71 // std::array<TOFFEEchannelConfig, NCHANNELS> mChannelConfig;
72 TOFFEEchannelConfig mChannelConfig[Geo::kNCrate][Geo::kNTRM - 2][Geo::kNChain][Geo::kNTdc][Geo::kNCh]; // in O2, the number of TRMs is 12, but in the FEE world it is 10
75 TOFFEElightConfig() = default;
76 const TOFFEEchannelConfig* getChannelConfig(int icrate, int itrm, int ichain, int itdc, int ich) const;
77 const TOFFEEtriggerConfig* getTriggerConfig(int idx) const { return idx < NTRIGGERMAPS ? &mTriggerConfig[idx] : nullptr; }
78 const TOFFEEmapHVConfig* getHVConfig(int isector) const { return (isector < Geo::NSECTORS) ? &mHVConfig[isector] : nullptr; }
79 unsigned int getHVConfig(int isector, int iplate) const { return (isector < Geo::NSECTORS && iplate < Geo::NPLATES) ? mHVConfig[isector].mHVstat[iplate] : 0; }
81};
82
83} // namespace tof
84} // namespace o2
85
86#endif
static constexpr Int_t NSECTORS
Definition Geo.h:120
@ kNTRM
Definition Geo.h:92
@ kNCrate
Definition Geo.h:95
@ kNTdc
Definition Geo.h:93
@ kNChain
Definition Geo.h:94
static constexpr Int_t NPLATES
Definition Geo.h:122
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
ClassDefNV(TOFFEEchannelConfig, 1)
static constexpr int NCHANNELS
unsigned int getHVConfig(int isector, int iplate) const
ClassDefNV(TOFFEElightConfig, 2)
const TOFFEEchannelConfig * getChannelConfig(int icrate, int itrm, int ichain, int itdc, int ich) const
const TOFFEEmapHVConfig * getHVConfig(int isector) const
TOFFEEchannelConfig mChannelConfig[Geo::kNCrate][Geo::kNTRM - 2][Geo::kNChain][Geo::kNTdc][Geo::kNCh]
TOFFEEtriggerConfig mTriggerConfig[NTRIGGERMAPS]
static constexpr int NTRIGGERMAPS
const TOFFEEtriggerConfig * getTriggerConfig(int idx) const
TOFFEEmapHVConfig mHVConfig[Geo::NSECTORS]
ClassDefNV(TOFFEEmapHVConfig, 1)
unsigned int mHVstat[Geo::NPLATES]
ClassDefNV(TOFFEEtriggerConfig, 1)