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_TRK_DIGITIZER_H
15#define ALICEO2_TRK_DIGITIZER_H
16
17#include <vector>
18#include <deque>
19#include <memory>
20
21#include "Rtypes.h" // for Digitizer::Class
22#include "TObject.h" // for TObject
23
26
28#include "TRKSimulation/Hit.h"
35#endif
36
37namespace o2::trk
38{
39
41{
42 using ExtraDig = std::vector<itsmft::PreDigitLabelRef>;
43
44 public:
45 void setDigits(std::vector<o2::itsmft::Digit>* dig) { mDigits = dig; }
47 void setROFRecords(std::vector<o2::itsmft::ROFRecord>* rec) { mROFRecords = rec; }
48 void setResponseName(const std::string& name) { mRespName = name; }
49
51 const o2::trk::DigiParams& getParams() const { return mParams; }
52
53 void init();
54
56
58 void process(const std::vector<o2::trk::Hit>* hits, int evID, int srcID, int layer);
60
61 void fillOutputContainer(uint32_t maxFrame, int layer);
62
64 {
65 mROFrameMin = 0;
66 mROFrameMax = 0;
67 mNewROFrame = 0;
68 mIsBeforeFirstRO = false;
69 mExtraBuff.clear();
70 }
71
72 const o2::trk::DigiParams& getDigitParams() const { return mParams; }
73
74 // provide the common trk::GeometryTGeo to access matrices and segmentation
75 void setGeometry(const o2::trk::GeometryTGeo* gm) { mGeometry = gm; }
76
77 uint32_t getEventROFrameMin() const { return mEventROFrameMin; }
78 uint32_t getEventROFrameMax() const { return mEventROFrameMax; }
80 {
81 mEventROFrameMin = 0xffffffff;
82 mEventROFrameMax = 0;
83 }
84
85 void setDeadChannelsMap(const o2::itsmft::NoiseMap* mp) { mDeadChanMap = mp; }
86
87 private:
88 void processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, int srcID, int rofLayer);
89 void registerDigits(o2::trk::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
90 uint16_t row, uint16_t col, int nEle, o2::MCCompLabel& lbl, int layer);
91
92 ExtraDig* getExtraDigBuffer(uint32_t roFrame)
93 {
94 if (mROFrameMin > roFrame) {
95 return nullptr; // nothing to do
96 }
97 int ind = roFrame - mROFrameMin;
98 while (ind >= int(mExtraBuff.size())) {
99 mExtraBuff.emplace_back(std::make_unique<ExtraDig>());
100 }
101 return mExtraBuff[ind].get();
102 }
103
108 int getNCols(int subDetID, int layer)
109 {
110 if (subDetID == 0) { // VD
111 return constants::VD::petal::layer::nCols;
112 } else if (subDetID == 1) { // ML/OT: the smallest element is a chip of 470 rows and 640 cols
114 }
115 return 0;
116 }
117
122 int getNRows(int subDetID, int layer)
123 {
124 if (subDetID == 0) { // VD
125 return constants::VD::petal::layer::nRows[layer];
126 } else if (subDetID == 1) { // ML/OT
128 }
129 return 0;
130 }
131
132 static constexpr float sec2ns = 1e9;
133
134 o2::trk::DigiParams mParams;
135 o2::InteractionTimeRecord mEventTime;
136 o2::InteractionRecord mIRFirstSampledTF;
137 double mCollisionTimeWrtROF{};
138 uint32_t mROFrameMin = 0;
139 uint32_t mROFrameMax = 0;
140 uint32_t mNewROFrame = 0;
141
142 bool mIsBeforeFirstRO = false;
143
144 uint32_t mEventROFrameMin = 0xffffffff;
145 uint32_t mEventROFrameMax = 0;
146
147 int mNumberOfChips = 0;
148
149 const o2::trk::ChipSimResponse* mChipSimResp = nullptr; // simulated response
150 const o2::trk::ChipSimResponse* mChipSimRespVD = nullptr; // simulated response for VD chips
151 const o2::trk::ChipSimResponse* mChipSimRespMLOT = nullptr; // simulated response for ML/OT chips
152
153 std::string mRespName;
154
155 bool mSimRespOrientation{false}; // wether the orientation in the response function is flipped
156 float mSimRespVDShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
157 float mSimRespVDScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
158 float mSimRespVDScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
159 float mSimRespMLOTShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
160 float mSimRespMLOTScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
161 float mSimRespMLOTScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
162 float mSimRespVDScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
163 float mSimRespMLOTScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
164
165 const o2::trk::GeometryTGeo* mGeometry = nullptr;
166
167 std::vector<o2::trk::ChipDigitsContainer> mChips;
168 std::deque<std::unique_ptr<ExtraDig>> mExtraBuff;
169
170 std::vector<o2::itsmft::Digit>* mDigits = nullptr;
171 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
173
174 const o2::itsmft::NoiseMap* mDeadChanMap = nullptr;
175 const o2::itsmft::NoiseMap* mNoiseMap = nullptr;
176};
177} // namespace o2::trk
Definition of the ITSMFT digit.
Simulation parameters for the TRK digitizer. Based on the ITS2 and ITS3 digitizer parameters.
Definition of the TRK Hit 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
A container to hold and manage MC truth information/labels.
NoiseMap class for the ITS and MFT.
Definition NoiseMap.h:39
o2::trk::DigiParams & getParams()
Definition Digitizer.h:50
const o2::trk::DigiParams & getDigitParams() const
Definition Digitizer.h:72
void setResponseName(const std::string &name)
Definition Digitizer.h:48
void setEventTime(const o2::InteractionTimeRecord &irt, int layer)
uint32_t getEventROFrameMin() const
Definition Digitizer.h:77
void process(const std::vector< o2::trk::Hit > *hits, int evID, int srcID, int layer)
Steer conversion of hits to digits.
void setDigits(std::vector< o2::itsmft::Digit > *dig)
Definition Digitizer.h:45
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
Definition Digitizer.h:47
void setDeadChannelsMap(const o2::itsmft::NoiseMap *mp)
Definition Digitizer.h:85
const o2::trk::DigiParams & getParams() const
Definition Digitizer.h:51
const o2::trk::ChipSimResponse * getChipResponse(int chipID)
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:46
void fillOutputContainer(uint32_t maxFrame, int layer)
void resetROFrameBounds()
Definition Digitizer.h:63
void setGeometry(const o2::trk::GeometryTGeo *gm)
Definition Digitizer.h:75
uint32_t getEventROFrameMax() const
Definition Digitizer.h:78
void resetEventROFrames()
Definition Digitizer.h:79
GLuint const GLchar * name
Definition glcorearb.h:781
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GPUReconstruction * rec
std::vector< int > row