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
25// #include "ITSMFTSimulation/AlpideSimResponse.h"
29// #include "ITS3Base/SegmentationSuperAlpide.h"
35#endif
36
37namespace o2::trk
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
50 const o2::itsmft::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 void setDigiParams(const o2::itsmft::DigiParams& par) { mParams = par; }
68 const o2::itsmft::DigiParams& getDigitParams() const { return mParams; }
69
70 // provide the common itsmft::GeometryTGeo to access matrices and segmentation
71 void setGeometry(const o2::trk::GeometryTGeo* gm) { mGeometry = gm; }
72
73 uint32_t getEventROFrameMin() const { return mEventROFrameMin; }
74 uint32_t getEventROFrameMax() const { return mEventROFrameMax; }
76 {
77 mEventROFrameMin = 0xffffffff;
78 mEventROFrameMax = 0;
79 }
80
81 void setDeadChannelsMap(const o2::itsmft::NoiseMap* mp) { mDeadChanMap = mp; }
82
83 private:
84 void processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID, int srcID);
85 void registerDigits(o2::itsmft::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
86 uint16_t row, uint16_t col, int nEle, o2::MCCompLabel& lbl);
87
88 ExtraDig* getExtraDigBuffer(uint32_t roFrame)
89 {
90 if (mROFrameMin > roFrame) {
91 return nullptr; // nothing to do
92 }
93 int ind = roFrame - mROFrameMin;
94 while (ind >= int(mExtraBuff.size())) {
95 mExtraBuff.emplace_back(std::make_unique<ExtraDig>());
96 }
97 return mExtraBuff[ind].get();
98 }
99
100 static constexpr float sec2ns = 1e9;
101
102 o2::itsmft::DigiParams mParams;
103 o2::InteractionTimeRecord mEventTime;
104 o2::InteractionRecord mIRFirstSampledTF;
105 double mCollisionTimeWrtROF{};
106 uint32_t mROFrameMin = 0;
107 uint32_t mROFrameMax = 0;
108 uint32_t mNewROFrame = 0;
109
110 uint32_t mEventROFrameMin = 0xffffffff;
111 uint32_t mEventROFrameMax = 0;
112
113 o2::itsmft::AlpideSimResponse* mAlpSimResp = nullptr; // simulated response
114
115 const o2::trk::GeometryTGeo* mGeometry = nullptr;
116
117 std::vector<o2::itsmft::ChipDigitsContainer> mChips;
118 std::deque<std::unique_ptr<ExtraDig>> mExtraBuff;
119
120 std::vector<o2::itsmft::Digit>* mDigits = nullptr;
121 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
123
124 const o2::itsmft::NoiseMap* mDeadChanMap = nullptr;
125
126 ClassDef(Digitizer, 1);
127};
128} // namespace o2::trk
transient container for single chip digits accumulation
Definition of the ITSMFT digit.
Simulation parameters for the ALIPIDE chip.
Definition of the ITSMFT 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.
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
void setEventTime(const o2::InteractionTimeRecord &irt)
bool isContinuous() const
Definition Digitizer.h:64
void setDigiParams(const o2::itsmft::DigiParams &par)
Definition Digitizer.h:67
const o2::itsmft::DigiParams & getParams() const
Definition Digitizer.h:50
void setContinuous(bool v)
Definition Digitizer.h:63
uint32_t getEventROFrameMin() const
Definition Digitizer.h:73
void setDigits(std::vector< o2::itsmft::Digit > *dig)
Definition Digitizer.h:45
o2::itsmft::DigiParams & getParams()
Definition Digitizer.h:49
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
Definition Digitizer.h:47
void fillOutputContainer(uint32_t maxFrame=0xffffffff)
void setDeadChannelsMap(const o2::itsmft::NoiseMap *mp)
Definition Digitizer.h:81
double getEndTimeOfROFMax() const
Definition Digitizer.h:57
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:46
const o2::itsmft::DigiParams & getDigitParams() const
Definition Digitizer.h:68
void setGeometry(const o2::trk::GeometryTGeo *gm)
Definition Digitizer.h:71
uint32_t getEventROFrameMax() const
Definition Digitizer.h:74
void resetEventROFrames()
Definition Digitizer.h:75
const GLdouble * v
Definition glcorearb.h:832
GPUReconstruction * rec
std::vector< int > row