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_ITS3_DIGITIZER_H
15#define ALICEO2_ITS3_DIGITIZER_H
16
17#include <vector>
18#include <deque>
19#include <memory>
20
21#include "Rtypes.h"
22#include "TObject.h"
23
36
37namespace o2::its3
38{
39
40class Digitizer : public TObject
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
49 o2::its3::DigiParams& getParams() { return mParams; }
50 const o2::its3::DigiParams& getParams() const { return mParams; }
51
52 void init();
53
55 void process(const std::vector<itsmft::Hit>* hits, int evID, int srcID);
57 double getEndTimeOfROFMax() const
58 {
60 return mParams.getROFrameLength() * (mROFrameMax + 1) + mParams.getTimeOffset();
61 }
62
63 void setContinuous(bool v) { mParams.setContinuous(v); }
64 bool isContinuous() const { return mParams.isContinuous(); }
65 void fillOutputContainer(uint32_t maxFrame = 0xffffffff);
66
67 // provide the common itsmft::GeometryTGeo to access matrices and segmentation
68 void setGeometry(const o2::its::GeometryTGeo* gm) { mGeometry = gm; }
69
70 uint32_t getEventROFrameMin() const { return mEventROFrameMin; }
71 uint32_t getEventROFrameMax() const { return mEventROFrameMax; }
73 {
74 mEventROFrameMin = 0xffffffff;
75 mEventROFrameMax = 0;
76 }
77
78 void setDeadChannelsMap(const o2::itsmft::NoiseMap* mp) { mDeadChanMap = mp; }
79
80 private:
81 void processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID, int srcID);
82 void registerDigits(o2::its3::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
83 uint16_t row, uint16_t col, int nEle, o2::MCCompLabel& lbl);
84
85 ExtraDig* getExtraDigBuffer(uint32_t roFrame)
86 {
87 if (mROFrameMin > roFrame) {
88 return nullptr; // nothing to do
89 }
90 int ind = roFrame - mROFrameMin;
91 while (ind >= int(mExtraBuff.size())) {
92 mExtraBuff.emplace_back(std::make_unique<ExtraDig>());
93 }
94 return mExtraBuff[ind].get();
95 }
96
97 static constexpr float sec2ns = 1e9;
98
99 o2::its3::DigiParams mParams;
100 o2::InteractionTimeRecord mEventTime;
101 o2::InteractionRecord mIRFirstSampledTF;
102 double mCollisionTimeWrtROF{};
103 uint32_t mROFrameMin = 0;
104 uint32_t mROFrameMax = 0;
105 uint32_t mNewROFrame = 0;
106
107 uint32_t mEventROFrameMin = 0xffffffff;
108 uint32_t mEventROFrameMax = 0;
109
110 static constexpr std::array<o2::its3::SegmentationMosaix, 3> mIBSegmentations{0, 1, 2};
111
112 o2::its3::ChipSimResponse* mSimRespIB = nullptr; // simulated response for IB
113 o2::itsmft::AlpideSimResponse* mSimRespOB = nullptr; // simulated response for OB
114 bool mSimRespIBOrientation{false}; // wether the orientation in the IB response function is flipped
115 float mSimRespIBShift{0.f}; // adjusting the Y-shift in the IB response function to match sensor local coord.
116 float mSimRespIBScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
117 float mSimRespIBScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
118 float mSimRespOBShift{0.f}; // adjusting the Y-shift in the OB response function to match sensor local coord.
119
120 const o2::its::GeometryTGeo* mGeometry = nullptr;
121
122 std::vector<o2::its3::ChipDigitsContainer> mChips;
123 std::deque<std::unique_ptr<ExtraDig>> mExtraBuff;
124
125 std::vector<o2::itsmft::Digit>* mDigits = nullptr;
126 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
128
129 const o2::itsmft::NoiseMap* mDeadChanMap = nullptr;
130
131 ClassDef(Digitizer, 5);
132};
133
134} // namespace o2::its3
135
136#endif /* ALICEO2_ITS3_DIGITIZER_H */
Definition of the ITSMFT Alpide simulated response parametrization.
Definition of the ITSMFT digit.
Definition of the ITSMFT Hit class.
Definition of the GeometryTGeo 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
Definition of the SegmentationMosaix class.
A container to hold and manage MC truth information/labels.
uint32_t getEventROFrameMax() const
Definition Digitizer.h:71
bool isContinuous() const
Definition Digitizer.h:64
void setEventTime(const o2::InteractionTimeRecord &irt)
void setDeadChannelsMap(const o2::itsmft::NoiseMap *mp)
Definition Digitizer.h:78
void setContinuous(bool v)
Definition Digitizer.h:63
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
Definition Digitizer.h:47
uint32_t getEventROFrameMin() const
Definition Digitizer.h:70
void setDigits(std::vector< o2::itsmft::Digit > *dig)
Definition Digitizer.h:45
void setGeometry(const o2::its::GeometryTGeo *gm)
Definition Digitizer.h:68
double getEndTimeOfROFMax() const
Definition Digitizer.h:57
o2::its3::DigiParams & getParams()
Definition Digitizer.h:49
void fillOutputContainer(uint32_t maxFrame=0xffffffff)
void resetEventROFrames()
Definition Digitizer.h:72
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:46
const o2::its3::DigiParams & getParams() const
Definition Digitizer.h:50
double getTimeOffset() const
Definition DigiParams.h:68
bool isContinuous() const
Definition DigiParams.h:52
float getROFrameLength() const
Definition DigiParams.h:58
void setContinuous(bool v)
Definition DigiParams.h:51
NoiseMap class for the ITS and MFT.
Definition NoiseMap.h:39
const GLdouble * v
Definition glcorearb.h:832
GPUReconstruction * rec
std::vector< int > row