Project
Loading...
Searching...
No Matches
Digitizer.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_ITS3_DIGITIZER_H
15#define ALICEO2_ITS3_DIGITIZER_H
16
17#include <vector>
18#include <deque>
19#include <memory>
20
21#include "Rtypes.h"
22#include "TObject.h"
23
36
37namespace o2::its3
38{
39
40class Digitizer : public TObject
41{
42 using ExtraDig = std::vector<itsmft::PreDigitLabelRef>;
43
44 public:
45 ~Digitizer() = default;
46
47 void setDigits(std::vector<o2::itsmft::Digit>* dig) { mDigits = dig; }
49 void setROFRecords(std::vector<o2::itsmft::ROFRecord>* rec) { mROFRecords = rec; }
50
51 o2::its3::DigiParams& getParams() { return mParams; }
52 const o2::its3::DigiParams& getParams() const { return mParams; }
53
54 void init();
55
57 void process(const std::vector<itsmft::Hit>* hits, int evID, int srcID, int layer);
58 void setEventTime(const o2::InteractionTimeRecord& irt, int layer);
59 double getEndTimeOfROFMax() const
60 {
62 return mParams.getROFrameLength() * (mROFrameMax + 1) + mParams.getTimeOffset();
63 }
64
65 void setContinuous(bool v) { mParams.setContinuous(v); }
66 bool isContinuous() const { return mParams.isContinuous(); }
67 void fillOutputContainer(uint32_t maxFrame = 0xffffffff, int layer = -1);
68
69 // provide the common itsmft::GeometryTGeo to access matrices and segmentation
70 void setGeometry(const o2::its::GeometryTGeo* gm) { mGeometry = gm; }
71
72 uint32_t getEventROFrameMin() const { return mEventROFrameMin; }
73 uint32_t getEventROFrameMax() const { return mEventROFrameMax; }
75 {
76 mEventROFrameMin = 0xffffffff;
77 mEventROFrameMax = 0;
78 }
80 {
81 mROFrameMin = 0;
82 mROFrameMax = 0;
83 mNewROFrame = 0;
84 }
85
86 void setDeadChannelsMap(const o2::itsmft::NoiseMap* mp) { mDeadChanMap = mp; }
87
88 private:
89 void processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID, int srcID, int layer, std::vector<float>& respMatrix);
90 void registerDigits(o2::its3::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
91 uint16_t row, uint16_t col, int nEle, o2::MCCompLabel& lbl, int layer);
92
93 ExtraDig* getExtraDigBuffer(uint32_t roFrame)
94 {
95 if (mROFrameMin > roFrame) {
96 return nullptr; // nothing to do
97 }
98 int ind = roFrame - mROFrameMin;
99 while (ind >= int(mExtraBuff.size())) {
100 mExtraBuff.emplace_back(std::make_unique<ExtraDig>());
101 }
102 return mExtraBuff[ind].get();
103 }
104
105 static constexpr float sec2ns = 1e9;
106
107 o2::its3::DigiParams mParams;
108 o2::InteractionTimeRecord mEventTime;
109 o2::InteractionRecord mIRFirstSampledTF;
110 double mCollisionTimeWrtROF{};
111 uint32_t mROFrameMin = 0;
112 uint32_t mROFrameMax = 0;
113 uint32_t mNewROFrame = 0;
114 int mROFsWrtFirstRO = 0;
115
116 uint32_t mEventROFrameMin = 0xffffffff;
117 uint32_t mEventROFrameMax = 0;
118
119 static constexpr std::array<o2::its3::SegmentationMosaix, 3> mIBSegmentations{0, 1, 2};
120
121 const o2::its3::ChipSimResponse* mSimRespIB = nullptr; // simulated response for IB
122 const o2::itsmft::AlpideSimResponse* mSimRespOB = nullptr; // simulated response for OB
123 bool mSimRespIBOrientation{false}; // wether the orientation in the IB response function is flipped
124 float mSimRespIBShift{0.f}; // adjusting the Y-shift in the IB response function to match sensor local coord.
125 float mSimRespIBScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
126 float mSimRespIBScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
127 float mSimRespOBShift{0.f}; // adjusting the Y-shift in the OB response function to match sensor local coord.
128
129 const o2::its::GeometryTGeo* mGeometry = nullptr;
130
131 std::vector<o2::its3::ChipDigitsContainer> mChips;
132 std::deque<std::unique_ptr<ExtraDig>> mExtraBuff;
133
134 std::vector<o2::itsmft::Digit>* mDigits = nullptr;
135 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
137
138 const o2::itsmft::NoiseMap* mDeadChanMap = nullptr;
139
140 ClassDef(Digitizer, 5);
141};
142
143} // namespace o2::its3
144
145#endif /* ALICEO2_ITS3_DIGITIZER_H */
Definition of the ITSMFT Alpide simulated response parametrization.
Definition of the ITSMFT digit.
Definition of the ITSMFT Hit class.
unsigned int uint32_t
unsigned short int uint16_t
Definition of the GeometryTGeo class.
Definition of the ITSMFT ROFrame (trigger) record.
Definition of a container to keep Monte Carlo truth external to simulation objects.
uint32_t col
Definition RawData.h:4
Definition of the SegmentationMosaix class.
A container to hold and manage MC truth information/labels.
uint32_t getEventROFrameMax() const
Definition Digitizer.h:73
void fillOutputContainer(uint32_t maxFrame=0xffffffff, int layer=-1)
bool isContinuous() const
Definition Digitizer.h:66
void setDeadChannelsMap(const o2::itsmft::NoiseMap *mp)
Definition Digitizer.h:86
void setContinuous(bool v)
Definition Digitizer.h:65
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
Definition Digitizer.h:49
uint32_t getEventROFrameMin() const
Definition Digitizer.h:72
void setDigits(std::vector< o2::itsmft::Digit > *dig)
Definition Digitizer.h:47
void setGeometry(const o2::its::GeometryTGeo *gm)
Definition Digitizer.h:70
double getEndTimeOfROFMax() const
Definition Digitizer.h:59
o2::its3::DigiParams & getParams()
Definition Digitizer.h:51
void resetROFrameBounds()
Definition Digitizer.h:79
void resetEventROFrames()
Definition Digitizer.h:74
void process(const std::vector< itsmft::Hit > *hits, int evID, int srcID, int layer)
Steer conversion of hits to digits.
Definition Digitizer.cxx:76
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:48
const o2::its3::DigiParams & getParams() const
Definition Digitizer.h:52
void setEventTime(const o2::InteractionTimeRecord &irt, int layer)
double getTimeOffset() const
Definition DigiParams.h:70
bool isContinuous() const
Definition DigiParams.h:54
float getROFrameLength(int layer=-1) const
Definition DigiParams.h:60
void setContinuous(bool v)
Definition DigiParams.h:53
NoiseMap class for the ITS and MFT.
Definition NoiseMap.h:39
const GLdouble * v
Definition glcorearb.h:832
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GPUReconstruction * rec
std::vector< int > row