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