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 mROFsWrtFirstRO = 0;
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
76 {
77 LOG(info) << "trk::Digizer set geom";
78 mGeometry = gm;
79 }
80
81 uint32_t getEventROFrameMin() const { return mEventROFrameMin; }
82 uint32_t getEventROFrameMax() const { return mEventROFrameMax; }
84 {
85 mEventROFrameMin = 0xffffffff;
86 mEventROFrameMax = 0;
87 }
88
89 void setDeadChannelsMap(const o2::itsmft::NoiseMap* mp) { mDeadChanMap = mp; }
90
91 private:
92 void processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, int srcID, int rofLayer);
93 void registerDigits(o2::trk::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
94 uint16_t row, uint16_t col, int nEle, o2::MCCompLabel& lbl, int layer);
95
96 ExtraDig* getExtraDigBuffer(uint32_t roFrame)
97 {
98 if (mROFrameMin > roFrame) {
99 return nullptr; // nothing to do
100 }
101 int ind = roFrame - mROFrameMin;
102 while (ind >= int(mExtraBuff.size())) {
103 mExtraBuff.emplace_back(std::make_unique<ExtraDig>());
104 }
105 return mExtraBuff[ind].get();
106 }
107
112 int getNCols(int subDetID, int layer)
113 {
114 if (subDetID == 0) { // VD
115 return constants::VD::petal::layer::nCols;
116 } else if (subDetID == 1 || subDetID == 2) { // ML/OT: the smallest element is a chip of 470 rows and 640 cols
118 }
119 return 0;
120 }
121
126 int getNRows(int subDetID, int layer)
127 {
128 if (subDetID == 0) { // VD
129 return constants::VD::petal::layer::nRows[layer];
130 } else if (subDetID == 1 || subDetID == 2) { // ML/OT
132 }
133 return 0;
134 }
135
136 static constexpr float sec2ns = 1e9;
137
138 o2::trk::DigiParams mParams;
139 o2::InteractionTimeRecord mEventTime;
140 o2::InteractionRecord mIRFirstSampledTF;
141 double mCollisionTimeWrtROF{};
142 uint32_t mROFrameMin = 0;
143 uint32_t mROFrameMax = 0;
144 uint32_t mNewROFrame = 0;
145
146 int mROFsWrtFirstRO = 0;
147
148 uint32_t mEventROFrameMin = 0xffffffff;
149 uint32_t mEventROFrameMax = 0;
150
151 int mNumberOfChips = 0;
152
153 const o2::trk::ChipSimResponse* mChipSimResp = nullptr; // simulated response
154 const o2::trk::ChipSimResponse* mChipSimRespVD = nullptr; // simulated response for VD chips
155 const o2::trk::ChipSimResponse* mChipSimRespMLOT = nullptr; // simulated response for ML/OT chips
156
157 std::string mRespName;
158
159 bool mSimRespOrientation{false}; // wether the orientation in the response function is flipped
160 float mSimRespVDShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
161 float mSimRespVDScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
162 float mSimRespVDScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
163 float mSimRespMLOTShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
164 float mSimRespMLOTScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
165 float mSimRespMLOTScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
166 float mSimRespVDScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
167 float mSimRespMLOTScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
168
169 const o2::trk::GeometryTGeo* mGeometry = nullptr;
170
171 std::vector<o2::trk::ChipDigitsContainer> mChips;
172 std::deque<std::unique_ptr<ExtraDig>> mExtraBuff;
173
174 std::vector<o2::itsmft::Digit>* mDigits = nullptr;
175 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
177
178 const o2::itsmft::NoiseMap* mDeadChanMap = nullptr;
179 const o2::itsmft::NoiseMap* mNoiseMap = nullptr;
180};
181} // 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:81
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:89
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:82
void resetEventROFrames()
Definition Digitizer.h:83
GLuint const GLchar * name
Definition glcorearb.h:781
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GPUReconstruction * rec
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< int > row