Project
Loading...
Searching...
No Matches
TimeDeadMap.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
14#ifndef ALICEO2_ITSMFT_TIMEDEADMAP_H
15#define ALICEO2_ITSMFT_TIMEDEADMAP_H
16
17#include <Rtypes.h>
18
19#include <cstdint>
20#include <map>
21#include <string>
22#include <vector>
23
24namespace o2
25{
26
27namespace itsmft
28{
29
30class NoiseMap;
31
33{
34 public:
35 // Constructor
36 TimeDeadMap(std::map<unsigned long, std::vector<uint16_t>>& deadmap)
37 {
38 mEvolvingDeadMap.swap(deadmap);
39 }
40
42 TimeDeadMap() = default;
44 ~TimeDeadMap() = default;
45
46 void fillMap(unsigned long firstOrbit, const std::vector<uint16_t>& deadVect)
47 {
48 mEvolvingDeadMap[firstOrbit] = deadVect;
49 };
50
51 void fillMap(const std::vector<uint16_t>& deadVect)
52 {
53 mStaticDeadMap = deadVect;
54 }
55
56 void clear()
57 {
58 mEvolvingDeadMap.clear();
59 mStaticDeadMap.clear();
60 }
61
62 void decodeMap(NoiseMap& noisemap) const;
63 void decodeMap(unsigned long orbit, o2::itsmft::NoiseMap& noisemap, bool includeStaticMap = true, long orbitGapAllowed = 330000) const;
64 std::string getMapVersion() const { return mMAP_VERSION; };
65
66 unsigned long getEvolvingMapSize() const { return mEvolvingDeadMap.size(); };
67 std::vector<unsigned long> getEvolvingMapKeys() const;
68 void getStaticMap(std::vector<uint16_t>& mmap) const { mmap = mStaticDeadMap; };
69 long getMapAtOrbit(unsigned long orbit, std::vector<uint16_t>& mmap) const;
70 void setMapVersion(std::string version) { mMAP_VERSION = version; };
71
72 bool isDefault() const { return mIsDefaultObject; };
73 void setAsDefault(bool isdef = true) { mIsDefaultObject = isdef; };
74
75 private:
76 bool mIsDefaultObject = false;
77 std::string mMAP_VERSION = "3";
78 std::map<unsigned long, std::vector<uint16_t>> mEvolvingDeadMap;
79 std::vector<uint16_t> mStaticDeadMap;
80
81 ClassDefNV(TimeDeadMap, 2);
82};
83
84} // namespace itsmft
85} // namespace o2
86
87#endif /* ALICEO2_ITSMFT_TIMEDEADMAP_H */
uint64_t orbit
Definition RawEventData.h:6
uint32_t version
Definition RawData.h:8
NoiseMap class for the ITS and MFT.
Definition NoiseMap.h:39
void fillMap(const std::vector< uint16_t > &deadVect)
Definition TimeDeadMap.h:51
long getMapAtOrbit(unsigned long orbit, std::vector< uint16_t > &mmap) const
std::vector< unsigned long > getEvolvingMapKeys() const
TimeDeadMap(std::map< unsigned long, std::vector< uint16_t > > &deadmap)
Definition TimeDeadMap.h:36
void fillMap(unsigned long firstOrbit, const std::vector< uint16_t > &deadVect)
Definition TimeDeadMap.h:46
void setMapVersion(std::string version)
Definition TimeDeadMap.h:70
unsigned long getEvolvingMapSize() const
Definition TimeDeadMap.h:66
void decodeMap(NoiseMap &noisemap) const
TimeDeadMap()=default
Constructor.
~TimeDeadMap()=default
Destructor.
void setAsDefault(bool isdef=true)
Definition TimeDeadMap.h:73
void getStaticMap(std::vector< uint16_t > &mmap) const
Definition TimeDeadMap.h:68
std::string getMapVersion() const
Definition TimeDeadMap.h:64
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...