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
50 const o2::trk::DigiParams& getParams() const { return mParams; }
51
52 void init();
53
55
57 void process(const std::vector<o2::trk::Hit>* hits, int evID, int srcID);
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);
68
69 const o2::trk::DigiParams& getDigitParams() const { return mParams; }
70
71 // provide the common trk::GeometryTGeo to access matrices and segmentation
72 void setGeometry(const o2::trk::GeometryTGeo* gm) { mGeometry = gm; }
73
74 uint32_t getEventROFrameMin() const { return mEventROFrameMin; }
75 uint32_t getEventROFrameMax() const { return mEventROFrameMax; }
77 {
78 mEventROFrameMin = 0xffffffff;
79 mEventROFrameMax = 0;
80 }
81
82 void setDeadChannelsMap(const o2::itsmft::NoiseMap* mp) { mDeadChanMap = mp; }
83
84 private:
85 void processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, int srcID);
86 void registerDigits(o2::trk::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
87 uint16_t row, uint16_t col, int nEle, o2::MCCompLabel& lbl);
88
89 ExtraDig* getExtraDigBuffer(uint32_t roFrame)
90 {
91 if (mROFrameMin > roFrame) {
92 return nullptr; // nothing to do
93 }
94 int ind = roFrame - mROFrameMin;
95 while (ind >= int(mExtraBuff.size())) {
96 mExtraBuff.emplace_back(std::make_unique<ExtraDig>());
97 }
98 return mExtraBuff[ind].get();
99 }
100
105 int getNCols(int subDetID, int layer)
106 {
107 if (subDetID == 0) { // VD
108 return constants::VD::petal::layer::nCols;
109 } else if (subDetID == 1) { // ML/OT: the smallest element is a chip of 470 rows and 640 cols
111 }
112 return 0;
113 }
114
119 int getNRows(int subDetID, int layer)
120 {
121 if (subDetID == 0) { // VD
122 return constants::VD::petal::layer::nRows[layer];
123 } else if (subDetID == 1) { // ML/OT
125 }
126 return 0;
127 }
128
129 static constexpr float sec2ns = 1e9;
130
131 o2::trk::DigiParams mParams;
132 o2::InteractionTimeRecord mEventTime;
133 o2::InteractionRecord mIRFirstSampledTF;
134 double mCollisionTimeWrtROF{};
135 uint32_t mROFrameMin = 0;
136 uint32_t mROFrameMax = 0;
137 uint32_t mNewROFrame = 0;
138
139 uint32_t mEventROFrameMin = 0xffffffff;
140 uint32_t mEventROFrameMax = 0;
141
142 int mNumberOfChips = 0;
143
144 const o2::trk::ChipSimResponse* mChipSimResp = nullptr; // simulated response
145 const o2::trk::ChipSimResponse* mChipSimRespVD = nullptr; // simulated response for VD chips
146 const o2::trk::ChipSimResponse* mChipSimRespMLOT = nullptr; // simulated response for ML/OT chips
147
148 bool mSimRespOrientation{false}; // wether the orientation in the response function is flipped
149 float mSimRespVDShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
150 float mSimRespVDScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
151 float mSimRespVDScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
152 float mSimRespMLOTShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
153 float mSimRespMLOTScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
154 float mSimRespMLOTScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
155 float mSimRespVDScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
156 float mSimRespMLOTScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
157
158 const o2::trk::GeometryTGeo* mGeometry = nullptr;
159
160 std::vector<o2::trk::ChipDigitsContainer> mChips;
161 std::deque<std::unique_ptr<ExtraDig>> mExtraBuff;
162
163 std::vector<o2::itsmft::Digit>* mDigits = nullptr;
164 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
166
167 const o2::itsmft::NoiseMap* mDeadChanMap = nullptr;
168 const o2::itsmft::NoiseMap* mNoiseMap = nullptr;
169};
170} // 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
float getROFrameLength() const
Definition DigiParams.h:60
void setContinuous(bool v)
Definition DigiParams.h:53
bool isContinuous() const
Definition DigiParams.h:54
double getTimeOffset() const
Definition DigiParams.h:70
void setEventTime(const o2::InteractionTimeRecord &irt)
void fillOutputContainer(uint32_t maxFrame=0xffffffff)
o2::trk::DigiParams & getParams()
Definition Digitizer.h:49
bool isContinuous() const
Definition Digitizer.h:66
const o2::trk::DigiParams & getDigitParams() const
Definition Digitizer.h:69
void setContinuous(bool v)
Definition Digitizer.h:65
void process(const std::vector< o2::trk::Hit > *hits, int evID, int srcID)
Steer conversion of hits to digits.
uint32_t getEventROFrameMin() const
Definition Digitizer.h:74
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:82
const o2::trk::DigiParams & getParams() const
Definition Digitizer.h:50
double getEndTimeOfROFMax() const
Definition Digitizer.h:59
const o2::trk::ChipSimResponse * getChipResponse(int chipID)
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:46
void setGeometry(const o2::trk::GeometryTGeo *gm)
Definition Digitizer.h:72
uint32_t getEventROFrameMax() const
Definition Digitizer.h:75
void resetEventROFrames()
Definition Digitizer.h:76
const GLdouble * v
Definition glcorearb.h:832
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GPUReconstruction * rec
std::vector< int > row