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
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<itsmft::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 void setDigiParams(const o2::trk::DigiParams& par) { mParams = par; }
70 const o2::trk::DigiParams& getDigitParams() const { return mParams; }
71
72 // provide the common trk::GeometryTGeo to access matrices and segmentation
73 void setGeometry(const o2::trk::GeometryTGeo* gm) { mGeometry = gm; }
74
75 uint32_t getEventROFrameMin() const { return mEventROFrameMin; }
76 uint32_t getEventROFrameMax() const { return mEventROFrameMax; }
78 {
79 mEventROFrameMin = 0xffffffff;
80 mEventROFrameMax = 0;
81 }
82
83 void setDeadChannelsMap(const o2::itsmft::NoiseMap* mp) { mDeadChanMap = mp; }
84
85 private:
86 void processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID, int srcID);
87 void registerDigits(o2::trk::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
88 uint16_t row, uint16_t col, int nEle, o2::MCCompLabel& lbl);
89
90 ExtraDig* getExtraDigBuffer(uint32_t roFrame)
91 {
92 if (mROFrameMin > roFrame) {
93 return nullptr; // nothing to do
94 }
95 int ind = roFrame - mROFrameMin;
96 while (ind >= int(mExtraBuff.size())) {
97 mExtraBuff.emplace_back(std::make_unique<ExtraDig>());
98 }
99 return mExtraBuff[ind].get();
100 }
101
106 int getNCols(int subDetID, int layer)
107 {
108 if (subDetID == 0) { // VD
109 return constants::VD::petal::layer::nCols;
110 } else if (subDetID == 1 && layer <= 3) { // ML
112 } else if (subDetID == 1 && layer >= 4) { // OT
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 && layer <= 3) { // ML
128 } else if (subDetID == 1 && layer >= 4) { // OT
130 }
131 return 0;
132 }
133
134 static constexpr float sec2ns = 1e9;
135
136 o2::trk::DigiParams mParams;
137 o2::InteractionTimeRecord mEventTime;
138 o2::InteractionRecord mIRFirstSampledTF;
139 double mCollisionTimeWrtROF{};
140 uint32_t mROFrameMin = 0;
141 uint32_t mROFrameMax = 0;
142 uint32_t mNewROFrame = 0;
143
144 uint32_t mEventROFrameMin = 0xffffffff;
145 uint32_t mEventROFrameMax = 0;
146
147 int mNumberOfChips = 0;
148
149 o2::trk::ChipSimResponse* mChipSimResp = nullptr; // simulated response
150 o2::trk::ChipSimResponse* mChipSimRespVD = nullptr; // simulated response for VD chips
151 o2::trk::ChipSimResponse* mChipSimRespMLOT = nullptr; // simulated response for ML/OT chips
152
153 // std::string mResponseFile = "$(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root";
154 std::string mResponseFile = "$(O2_ROOT)/share/Detectors/Upgrades/ITS3/data/ITS3ChipResponseData/APTSResponseData.root";
155
156 bool mSimRespOrientation{false}; // wether the orientation in the response function is flipped
157 float mSimRespVDShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
158 float mSimRespVDScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
159 float mSimRespVDScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
160 float mSimRespMLOTShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
161 float mSimRespMLOTScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
162 float mSimRespMLOTScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
163 float mSimRespVDScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
164 float mSimRespMLOTScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
165
166 const o2::trk::GeometryTGeo* mGeometry = nullptr;
167
168 std::vector<o2::trk::ChipDigitsContainer> mChips;
169 std::deque<std::unique_ptr<ExtraDig>> mExtraBuff;
170
171 std::vector<o2::itsmft::Digit>* mDigits = nullptr;
172 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
174
175 const o2::itsmft::NoiseMap* mDeadChanMap = nullptr;
176 const o2::itsmft::NoiseMap* mNoiseMap = nullptr;
177};
178} // namespace o2::trk
Definition of the ITSMFT digit.
Definition of the ITSMFT Hit class.
Simulation parameters for the TRK digitizer. Based on the ITS2 and ITS3 digitizer parameters.
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:59
void setContinuous(bool v)
Definition DigiParams.h:52
bool isContinuous() const
Definition DigiParams.h:53
double getTimeOffset() const
Definition DigiParams.h:69
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:70
void process(const std::vector< itsmft::Hit > *hits, int evID, int srcID)
Steer conversion of hits to digits.
void setContinuous(bool v)
Definition Digitizer.h:65
void setDigiParams(const o2::trk::DigiParams &par)
Definition Digitizer.h:69
uint32_t getEventROFrameMin() const
Definition Digitizer.h:75
void setDigits(std::vector< o2::itsmft::Digit > *dig)
Definition Digitizer.h:45
o2::trk::ChipSimResponse * getChipResponse(int chipID)
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
Definition Digitizer.h:47
void setDeadChannelsMap(const o2::itsmft::NoiseMap *mp)
Definition Digitizer.h:83
const o2::trk::DigiParams & getParams() const
Definition Digitizer.h:50
double getEndTimeOfROFMax() const
Definition Digitizer.h:59
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:46
void setGeometry(const o2::trk::GeometryTGeo *gm)
Definition Digitizer.h:73
uint32_t getEventROFrameMax() const
Definition Digitizer.h:76
void resetEventROFrames()
Definition Digitizer.h:77
const GLdouble * v
Definition glcorearb.h:832
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
constexpr int nRows
Definition Specs.h:107
constexpr int nCols
Definition Specs.h:108
constexpr int nRows
Definition Specs.h:115
constexpr int nCols
Definition Specs.h:116
GPUReconstruction * rec
std::vector< int > row