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 ~Digitizer();
46
47 void setDigits(std::vector<o2::itsmft::Digit>* dig) { mDigits = dig; }
49 void setROFRecords(std::vector<o2::itsmft::ROFRecord>* rec) { mROFRecords = rec; }
50
51 o2::its3::DigiParams& getParams() { return mParams; }
52 const o2::its3::DigiParams& getParams() const { return mParams; }
53
54 void init();
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 // provide the common itsmft::GeometryTGeo to access matrices and segmentation
70 void setGeometry(const o2::its::GeometryTGeo* gm) { mGeometry = gm; }
71
72 uint32_t getEventROFrameMin() const { return mEventROFrameMin; }
73 uint32_t getEventROFrameMax() const { return mEventROFrameMax; }
75 {
76 mEventROFrameMin = 0xffffffff;
77 mEventROFrameMax = 0;
78 }
79
80 void setDeadChannelsMap(const o2::itsmft::NoiseMap* mp) { mDeadChanMap = mp; }
81
82 private:
83 void processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID, int srcID);
84 void registerDigits(o2::its3::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
85 uint16_t row, uint16_t col, int nEle, o2::MCCompLabel& lbl);
86
87 ExtraDig* getExtraDigBuffer(uint32_t roFrame)
88 {
89 if (mROFrameMin > roFrame) {
90 return nullptr; // nothing to do
91 }
92 int ind = roFrame - mROFrameMin;
93 while (ind >= int(mExtraBuff.size())) {
94 mExtraBuff.emplace_back(std::make_unique<ExtraDig>());
95 }
96 return mExtraBuff[ind].get();
97 }
98
99 static constexpr float sec2ns = 1e9;
100
101 o2::its3::DigiParams mParams;
102 o2::InteractionTimeRecord mEventTime;
103 o2::InteractionRecord mIRFirstSampledTF;
104 double mCollisionTimeWrtROF{};
105 uint32_t mROFrameMin = 0;
106 uint32_t mROFrameMax = 0;
107 uint32_t mNewROFrame = 0;
108
109 uint32_t mEventROFrameMin = 0xffffffff;
110 uint32_t mEventROFrameMax = 0;
111
112 static constexpr std::array<o2::its3::SegmentationMosaix, 3> mIBSegmentations{0, 1, 2};
113
114 o2::its3::ChipSimResponse* mSimRespIB = nullptr; // simulated response for IB
115 o2::itsmft::AlpideSimResponse* mSimRespOB = nullptr; // simulated response for OB
116 bool mSimRespIBOrientation{false}; // wether the orientation in the IB response function is flipped
117 float mSimRespIBShift{0.f}; // adjusting the Y-shift in the IB response function to match sensor local coord.
118 float mSimRespIBScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
119 float mSimRespIBScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
120 float mSimRespOBShift{0.f}; // adjusting the Y-shift in the OB response function to match sensor local coord.
121
122 const o2::its::GeometryTGeo* mGeometry = nullptr;
123
124 std::vector<o2::its3::ChipDigitsContainer> mChips;
125 std::deque<std::unique_ptr<ExtraDig>> mExtraBuff;
126
127 std::vector<o2::itsmft::Digit>* mDigits = nullptr;
128 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
130
131 const o2::itsmft::NoiseMap* mDeadChanMap = nullptr;
132
133 ClassDef(Digitizer, 5);
134};
135
136} // namespace o2::its3
137
138#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:73
bool isContinuous() const
Definition Digitizer.h:66
void setEventTime(const o2::InteractionTimeRecord &irt)
void setDeadChannelsMap(const o2::itsmft::NoiseMap *mp)
Definition Digitizer.h:80
void setContinuous(bool v)
Definition Digitizer.h:65
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
Definition Digitizer.h:49
uint32_t getEventROFrameMin() const
Definition Digitizer.h:72
void setDigits(std::vector< o2::itsmft::Digit > *dig)
Definition Digitizer.h:47
void setGeometry(const o2::its::GeometryTGeo *gm)
Definition Digitizer.h:70
double getEndTimeOfROFMax() const
Definition Digitizer.h:59
o2::its3::DigiParams & getParams()
Definition Digitizer.h:51
void fillOutputContainer(uint32_t maxFrame=0xffffffff)
void resetEventROFrames()
Definition Digitizer.h:74
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:48
const o2::its3::DigiParams & getParams() const
Definition Digitizer.h:52
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