Project
Loading...
Searching...
No Matches
ChipDigitsContainer.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//
15//
16
17#ifndef ALICEO2_ITSMFT_CHIPDIGITSCONTAINER_
18#define ALICEO2_ITSMFT_CHIPDIGITSCONTAINER_
19
24#include <map>
25#include <vector>
26
27namespace o2
28{
29namespace itsmft
30{
31class DigiParams;
32
35
37{
38 public:
40 ChipDigitsContainer(UShort_t idx = 0) : mChipIndex(idx){};
41
44
45 std::map<ULong64_t, o2::itsmft::PreDigit>& getPreDigits() { return mDigits; }
46 bool isEmpty() const { return mDigits.empty(); }
47 void setNoiseMap(const o2::itsmft::NoiseMap* mp) { mNoiseMap = mp; }
49 void setChipIndex(UShort_t ind) { mChipIndex = ind; }
50 UShort_t getChipIndex() const { return mChipIndex; }
51
53 void addDigit(ULong64_t key, UInt_t roframe, UShort_t row, UShort_t col, int charge, o2::MCCompLabel lbl);
54 void addNoise(UInt_t rofMin, UInt_t rofMax, const o2::itsmft::DigiParams* params, int maxRows = o2::itsmft::SegmentationAlpide::NRows, int maxCols = o2::itsmft::SegmentationAlpide::NCols);
55
57 static ULong64_t getOrderingKey(UInt_t roframe, UShort_t row, UShort_t col)
58 {
59 return (static_cast<ULong64_t>(roframe) << (8 * sizeof(UInt_t))) + (col << (8 * sizeof(Short_t))) + row;
60 }
61
63 static UInt_t key2ROFrame(ULong64_t key)
64 {
65 return static_cast<UInt_t>(key >> (8 * sizeof(UInt_t)));
66 }
67
68 bool isDisabled() const { return mDisabled; }
69 void disable(bool v) { mDisabled = v; }
70
71 protected:
72 UShort_t mChipIndex = 0;
73 bool mDisabled = false;
76 std::map<ULong64_t, o2::itsmft::PreDigit> mDigits;
77
79};
80
81//_______________________________________________________________________
83{
84 // finds the digit corresponding to global key
85 auto digitentry = mDigits.find(key);
86 return digitentry != mDigits.end() ? &(digitentry->second) : nullptr;
87}
88
89//_______________________________________________________________________
90inline void ChipDigitsContainer::addDigit(ULong64_t key, UInt_t roframe, UShort_t row, UShort_t col,
91 int charge, o2::MCCompLabel lbl)
92{
93 mDigits.emplace(std::make_pair(key, o2::itsmft::PreDigit(roframe, row, col, charge, lbl)));
94}
95} // namespace itsmft
96} // namespace o2
97
98#endif /* defined(ALICEO2_ITSMFT_CHIPCONTAINER_) */
int16_t charge
Definition RawEventData.h:5
Definition of the ITSMFT NoiseMap.
Definition of the digit contribution from single hit.
uint32_t col
Definition RawData.h:4
Definition of the SegmentationAlpide class.
StringRef key
Container for similated points connected to a given chip.
ClassDefNV(ChipDigitsContainer, 1)
void addDigit(ULong64_t key, UInt_t roframe, UShort_t row, UShort_t col, int charge, o2::MCCompLabel lbl)
void setNoiseMap(const o2::itsmft::NoiseMap *mp)
const o2::itsmft::NoiseMap * mNoiseMap
o2::itsmft::PreDigit * findDigit(ULong64_t key)
void setDeadChanMap(const o2::itsmft::NoiseMap *mp)
std::map< ULong64_t, o2::itsmft::PreDigit > mDigits
Map of fired pixels, possibly in multiple frames.
void addNoise(UInt_t rofMin, UInt_t rofMax, const o2::itsmft::DigiParams *params, int maxRows=o2::itsmft::SegmentationAlpide::NRows, int maxCols=o2::itsmft::SegmentationAlpide::NCols)
std::map< ULong64_t, o2::itsmft::PreDigit > & getPreDigits()
static ULong64_t getOrderingKey(UInt_t roframe, UShort_t row, UShort_t col)
Get global ordering key made of readout frame, column and row.
~ChipDigitsContainer()=default
Destructor.
const o2::itsmft::NoiseMap * mDeadChanMap
static UInt_t key2ROFrame(ULong64_t key)
Get ROFrame from the ordering key.
ChipDigitsContainer(UShort_t idx=0)
Default constructor.
NoiseMap class for the ITS and MFT.
Definition NoiseMap.h:39
const GLdouble * v
Definition glcorearb.h:832
GLenum const GLfloat * params
Definition glcorearb.h:272
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< int > row