Project
Loading...
Searching...
No Matches
Chip.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//
13// TOF Chip class: it will be used to store the digits at TOF that
14// fall in the same Chip
15//
16
18// To put in O2/Detectors/Upgrades/ALICE3/IOTOF/base/include/IOTOFBase/Chip.h
19
20#ifndef ALICEO2_IOTOF_CHIP_H_
21#define ALICEO2_IOTOF_CHIP_H_
22
24#include <TObject.h>
25#include <exception>
26#include <map>
27#include <sstream>
28#include <vector>
29#include "MathUtils/Cartesian.h"
30
31namespace o2::iotof
32{
33
39
40class Chip
41{
42
43 public:
45 Chip() = default;
46
48 ~Chip() = default;
49
53 Chip(Int_t index);
54
57 Chip(const Chip& ref) = default;
58
61 void clear() { mDigits.clear(); }
62
63 std::map<DigitKey, o2::iotof::LabeledDigit>& getDigits() { return mDigits; }
64 bool isEmpty() const { return mDigits.empty(); }
65
67 Int_t getChipIndex() const { return mChipIndex; }
68
69 void disable(bool disable) { mDisabled = disable; }
70 bool isDisabled() const { return mDisabled; }
71
74 Int_t getNumberOfDigits() const { return mDigits.size(); }
75
78
80 void resizeTDCStates(int const size) { mTDCStates.resize(size); }
81 std::vector<std::array<double, 2>>& getTDCStates() { return mTDCStates; }
82
83 void addDigit(UShort_t row, UShort_t col, Int_t charge, double time, ULong64_t bc, Int_t tdc, o2::MCCompLabel label);
84
85 protected:
86 Int_t mChipIndex = -1;
87 bool mDisabled = false;
88 std::map<DigitKey, o2::iotof::LabeledDigit> mDigits;
89 std::vector<std::array<double, 2>> mTDCStates;
90
92};
93
95{
96 // finds the digit corresponding to global key
97 auto digitentry = mDigits.find(key);
98 return digitentry != mDigits.end() ? &(digitentry->second) : nullptr;
99}
100
101} // namespace o2::iotof
102
103#endif /* defined(ALICEO2_IOTOF_CHIP_H_) */
Definition of IOTOF digit class.
int16_t charge
Definition RawEventData.h:5
uint64_t bc
Definition RawEventData.h:5
int16_t time
Definition RawEventData.h:4
uint32_t col
Definition RawData.h:4
StringRef key
Container for similated points connected to a given TOF Chip This will be used in order to allow a mo...
Definition Chip.h:41
void clear()
Definition Chip.h:61
std::vector< std::array< double, 2 > > & getTDCStates()
Definition Chip.h:81
ClassDefNV(Chip, 1)
void addDigit(UShort_t row, UShort_t col, Int_t charge, double time, ULong64_t bc, Int_t tdc, o2::MCCompLabel label)
Definition Chip.cxx:35
bool mDisabled
Flag to indicate if the chip is disabled (e.g. due to dead channels)
Definition Chip.h:87
Chip(const Chip &ref)=default
void resizeTDCStates(int const size)
Resize the vector of tdc states.
Definition Chip.h:80
Chip()=default
Default constructor.
Int_t getNumberOfDigits() const
Definition Chip.h:74
void disable(bool disable)
Definition Chip.h:69
std::map< DigitKey, o2::iotof::LabeledDigit > mDigits
Map of fired digits, possibly in multiple frames.
Definition Chip.h:88
void setChipIndex(Int_t index)
Definition Chip.h:66
Int_t getChipIndex() const
Definition Chip.h:67
~Chip()=default
Destructor.
bool isDisabled() const
Definition Chip.h:70
bool isEmpty() const
Definition Chip.h:64
std::vector< std::array< double, 2 > > mTDCStates
Vector of the last times the TDC pairs went busy.
Definition Chip.h:89
Int_t mChipIndex
Chip ID.
Definition Chip.h:86
std::map< DigitKey, o2::iotof::LabeledDigit > & getDigits()
Definition Chip.h:63
o2::iotof::LabeledDigit * findDigit(DigitKey key)
reset points container
Definition Chip.h:94
GLsizeiptr size
Definition glcorearb.h:659
GLuint index
Definition glcorearb.h:781
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
GLint ref
Definition glcorearb.h:291
std::vector< int > row