forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimeDeadMap.h
More file actions
87 lines (69 loc) · 2.55 KB
/
TimeDeadMap.h
File metadata and controls
87 lines (69 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file TimeDeadMap.h
/// \brief Definition of the ITSMFT time-dependend dead map
#ifndef ALICEO2_ITSMFT_TIMEDEADMAP_H
#define ALICEO2_ITSMFT_TIMEDEADMAP_H
#include <Rtypes.h>
#include <cstdint>
#include <map>
#include <string>
#include <vector>
namespace o2
{
namespace itsmft
{
class NoiseMap;
class TimeDeadMap
{
public:
// Constructor
TimeDeadMap(std::map<unsigned long, std::vector<uint16_t>>& deadmap)
{
mEvolvingDeadMap.swap(deadmap);
}
/// Constructor
TimeDeadMap() = default;
/// Destructor
~TimeDeadMap() = default;
void fillMap(unsigned long firstOrbit, const std::vector<uint16_t>& deadVect)
{
mEvolvingDeadMap[firstOrbit] = deadVect;
};
void fillMap(const std::vector<uint16_t>& deadVect)
{
mStaticDeadMap = deadVect;
}
void clear()
{
mEvolvingDeadMap.clear();
mStaticDeadMap.clear();
}
void decodeMap(NoiseMap& noisemap) const;
void decodeMap(unsigned long orbit, o2::itsmft::NoiseMap& noisemap, bool includeStaticMap = true, long orbitGapAllowed = 330000) const;
std::string getMapVersion() const { return mMAP_VERSION; };
unsigned long getEvolvingMapSize() const { return mEvolvingDeadMap.size(); };
std::vector<unsigned long> getEvolvingMapKeys() const;
void getStaticMap(std::vector<uint16_t>& mmap) const { mmap = mStaticDeadMap; };
long getMapAtOrbit(unsigned long orbit, std::vector<uint16_t>& mmap) const;
void setMapVersion(std::string version) { mMAP_VERSION = version; };
bool isDefault() const { return mIsDefaultObject; };
void setAsDefault(bool isdef = true) { mIsDefaultObject = isdef; };
private:
bool mIsDefaultObject = false;
std::string mMAP_VERSION = "3";
std::map<unsigned long, std::vector<uint16_t>> mEvolvingDeadMap; ///< Internal dead chip map representation. key = orbit
std::vector<uint16_t> mStaticDeadMap; ///< To store map valid for every orbit. Filled starting from version = 4.
ClassDefNV(TimeDeadMap, 2);
};
} // namespace itsmft
} // namespace o2
#endif /* ALICEO2_ITSMFT_TIMEDEADMAP_H */