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 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::trk::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) { // ML/OT: the smallest element is a chip of 470 rows and 640 cols
112 }
113 return 0;
114 }
115
120 int getNRows(int subDetID, int layer)
121 {
122 if (subDetID == 0) { // VD
123 return constants::VD::petal::layer::nRows[layer];
124 } else if (subDetID == 1) { // ML/OT
126 }
127 return 0;
128 }
129
130 static constexpr float sec2ns = 1e9;
131
132 o2::trk::DigiParams mParams;
133 o2::InteractionTimeRecord mEventTime;
134 o2::InteractionRecord mIRFirstSampledTF;
135 double mCollisionTimeWrtROF{};
136 uint32_t mROFrameMin = 0;
137 uint32_t mROFrameMax = 0;
138 uint32_t mNewROFrame = 0;
139
140 uint32_t mEventROFrameMin = 0xffffffff;
141 uint32_t mEventROFrameMax = 0;
142
143 int mNumberOfChips = 0;
144
145 o2::trk::ChipSimResponse* mChipSimResp = nullptr; // simulated response
146 o2::trk::ChipSimResponse* mChipSimRespVD = nullptr; // simulated response for VD chips
147 o2::trk::ChipSimResponse* mChipSimRespMLOT = nullptr; // simulated response for ML/OT chips
148
149 // std::string mResponseFile = "$(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root";
150 std::string mResponseFile = "$(O2_ROOT)/share/Detectors/Upgrades/ITS3/data/ITS3ChipResponseData/APTSResponseData.root";
151
152 bool mSimRespOrientation{false}; // wether the orientation in the response function is flipped
153 float mSimRespVDShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
154 float mSimRespVDScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
155 float mSimRespVDScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
156 float mSimRespMLOTShift{0.f}; // adjusting the Y-shift in the APTS response function to match sensor local coord.
157 float mSimRespMLOTScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
158 float mSimRespMLOTScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
159 float mSimRespVDScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
160 float mSimRespMLOTScaleDepth{1.f}; // scale depth-local coordinate to response function depth-coordinate
161
162 const o2::trk::GeometryTGeo* mGeometry = nullptr;
163
164 std::vector<o2::trk::ChipDigitsContainer> mChips;
165 std::deque<std::unique_ptr<ExtraDig>> mExtraBuff;
166
167 std::vector<o2::itsmft::Digit>* mDigits = nullptr;
168 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
170
171 const o2::itsmft::NoiseMap* mDeadChanMap = nullptr;
172 const o2::itsmft::NoiseMap* mNoiseMap = nullptr;
173};
174} // 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: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 setContinuous(bool v)
Definition Digitizer.h:65
void setDigiParams(const o2::trk::DigiParams &par)
Definition Digitizer.h:69
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: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
GPUReconstruction * rec
std::vector< int > row