-
Notifications
You must be signed in to change notification settings - Fork 499
Expand file tree
/
Copy pathStrip.h
More file actions
107 lines (84 loc) · 2.96 KB
/
Strip.h
File metadata and controls
107 lines (84 loc) · 2.96 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// 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.
//
// TOF strip class: it will be used to store the digits at TOF that
// fall in the same strip
//
#ifndef ALICEO2_TOF_STRIP_H_
#define ALICEO2_TOF_STRIP_H_
#include <TOFBase/Digit.h>
#include <TObject.h>
#include <exception>
#include <map>
#include <sstream>
#include <vector>
#include "MathUtils/Cartesian.h"
namespace o2
{
namespace tof
{
/// @class Strip
/// @brief Container for similated points connected to a given TOF strip
/// This will be used in order to allow a more efficient clusterization
/// that can happen only between digits that belong to the same strip
///
class Strip
{
public:
/// Default constructor
Strip() = default;
/// Destructor
~Strip() = default;
/// Main constructor
/// @param stripindex Index of the strip
/// @param mat Transformation matrix
Strip(Int_t index);
/// Copy constructor
/// @param ref Reference for the copy
Strip(const Strip& ref) = default;
/// Empties the point container
/// @param option unused
void clear() { mDigits.clear(); }
/// Change the chip index
/// @param index New chip index
void setStripIndex(Int_t index) { mStripIndex = index; }
void init(Int_t index)
//, const o2::math_utils::Transform3D* mat)
{
mStripIndex = index;
//mMat = mat;
}
/// Get the chip index
/// @return Index of the chip
Int_t getStripIndex() const { return mStripIndex; }
/// Get the number of point assigned to the chip
/// @return Number of points assigned to the chip
Int_t getNumberOfDigits() const { return mDigits.size(); }
/// reset points container
o2::tof::Digit* findDigit(ULong64_t key);
Int_t addDigit(Int_t channel, Int_t tdc, Int_t tot, uint64_t bc, Int_t lbl = 0, uint32_t triggerorbit = 0, uint16_t triggerbunch = 0, float geanttime = 0, double t0 = 0); // returns the MC label
void fillOutputContainer(std::vector<o2::tof::Digit>& digits);
static int mDigitMerged;
std::map<ULong64_t, o2::tof::Digit>& getDigitMap() { return mDigits; }
protected:
Int_t mStripIndex = -1; ///< Strip ID
std::map<ULong64_t, o2::tof::Digit> mDigits; ///< Map of fired digits, possibly in multiple frames
ClassDefNV(Strip, 1);
};
inline o2::tof::Digit* Strip::findDigit(ULong64_t key)
{
// finds the digit corresponding to global key
auto digitentry = mDigits.find(key);
return digitentry != mDigits.end() ? &(digitentry->second) : nullptr;
}
} // namespace tof
} // namespace o2
#endif /* defined(ALICEO2_TOF_STRIP_H_) */