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<ULong64_t, 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
79 void addDigit(UShort_t row, UShort_t col, Int_t charge, double time, o2::MCCompLabel label);
80
81 protected:
82 Int_t mChipIndex = -1;
83 bool mDisabled = false;
84 std::map<ULong64_t, o2::iotof::LabeledDigit> mDigits;
85
87};
88
90{
91 // finds the digit corresponding to global key
92 auto digitentry = mDigits.find(key);
93 return digitentry != mDigits.end() ? &(digitentry->second) : nullptr;
94}
95
96} // namespace o2::iotof
97
98#endif /* defined(ALICEO2_IOTOF_CHIP_H_) */
Definition of IOTOF digit class.
int16_t charge
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
o2::iotof::LabeledDigit * findDigit(ULong64_t key)
reset points container
Definition Chip.h:89
void addDigit(UShort_t row, UShort_t col, Int_t charge, double time, o2::MCCompLabel label)
Definition Chip.cxx:35
ClassDefNV(Chip, 1)
bool mDisabled
Flag to indicate if the chip is disabled (e.g. due to dead channels)
Definition Chip.h:83
Chip(const Chip &ref)=default
Chip()=default
Default constructor.
Int_t getNumberOfDigits() const
Definition Chip.h:74
void disable(bool disable)
Definition Chip.h:69
std::map< ULong64_t, o2::iotof::LabeledDigit > & getDigits()
Definition Chip.h:63
std::map< ULong64_t, o2::iotof::LabeledDigit > mDigits
Map of fired digits, possibly in multiple frames.
Definition Chip.h:84
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
Int_t mChipIndex
Chip ID.
Definition Chip.h:82
GLuint index
Definition glcorearb.h:781
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
std::vector< int > row