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
18
19#ifndef ALICEO2_IOTOF_DIGITIZER_H
20#define ALICEO2_IOTOF_DIGITIZER_H
21
22#include <vector>
23#include <deque>
24#include <memory>
25
26#include "Rtypes.h" // for Digitizer::Class
27#include "TObject.h" // for TObject
28
38
39namespace o2::iotof
40{
41
50class Digitizer : public TObject
51{
52 public:
53 void setDigits(std::vector<o2::iotof::Digit>* dig) { mDigits = dig; }
55 void setROFRecords(std::vector<o2::itsmft::ROFRecord>* rec) { mROFRecords = rec; }
56
58 void init();
59
61 void process(const std::vector<o2::itsmft::Hit>* hits, int evID, int srcID);
62
64 void setEventTime(const o2::InteractionTimeRecord& irt) { mEventTime = irt; }
65 void setROFRecordIR(const o2::InteractionRecord& ir) { mROFRecordIR = ir; }
66
68 void setContinuous(bool v) { mContinuous = v; }
69 bool isContinuous() const { return mContinuous; }
70
73
74 // Provide the common iotof::GeometryTGeo to access matrices and segmentation
75 void setGeometry(const o2::iotof::GeometryTGeo* gm) { mGeometry = gm; }
76
77 // Setters for digitization parameters
78 void setChargeThreshold(float thr) { mChargeThreshold = thr; }
79 void setTimeResolution(float res) { mTimeResolution = res; }
80 void setEfficiency(float eff) { mEfficiency = eff; }
81 void setEnergyToCharge(float e2c) { mEnergyToCharge = e2c; }
82
83 // Getters
84 float getChargeThreshold() const { return mChargeThreshold; }
85 float getTimeResolution() const { return mTimeResolution; }
86 float getEfficiency() const { return mEfficiency; }
87
88 private:
90 void processHit(const o2::itsmft::Hit& hit, int evID, int srcID);
91
93 void registerDigits(Chip& chip, uint32_t roFrame, double time, int nROF,
94 uint16_t row, uint16_t col, int nElectrons, o2::MCCompLabel& label);
95
97 double smearTime(double time) const;
98
100 int energyToCharge(float energyLoss) const;
101
103 bool isEfficient() const;
104
105 std::vector<o2::iotof::McLabelRef>* getExtraLabelBuffer(uint32_t roFrame)
106 {
107 // if (mROFrameMin > roFrame) {
108 // return nullptr; // nothing to do
109 // }
110 // int index = roFrame - mROFrameMin;
111
112 int index = roFrame;
113 while (index >= int(mExtraLabelBuffer.size())) {
114 mExtraLabelBuffer.emplace_back(std::make_unique<std::vector<o2::iotof::McLabelRef>>());
115 }
116 return mExtraLabelBuffer[index].get();
117 }
118
119 static constexpr float sec2ns = 1e9f;
120
121 const o2::iotof::GeometryTGeo* mGeometry = nullptr;
122
123 std::vector<o2::iotof::Chip> mChips;
124 std::deque<std::unique_ptr<std::vector<o2::iotof::McLabelRef>>> mExtraLabelBuffer;
125
126 std::vector<o2::iotof::Digit>* mDigits = nullptr;
127 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
129
130 o2::InteractionTimeRecord mEventTime;
131 o2::InteractionRecord mROFRecordIR;
132 bool mContinuous = true;
133
134 // Digitization parameters
135 float mChargeThreshold = 100.f;
136 float mTimeResolution = 0.020f;
137 float mEfficiency = 0.98f;
138 float mEnergyToCharge = 3.6e-9f;
139
140 static o2::iotof::Segmentation* sSegmentation;
141
142 ClassDefNV(Digitizer, 1);
143};
144} // namespace o2::iotof
145
146#endif
Definition of the ITSMFT Hit class.
Definition of IOTOF digit class.
int16_t time
Definition RawEventData.h:4
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
uint32_t res
Definition RawData.h:0
Definition of the Segmentation class.
A container to hold and manage MC truth information/labels.
Container for similated points connected to a given TOF Chip This will be used in order to allow a mo...
Definition Chip.h:41
Digitizer for the ALICE3 Inner/Outer TOF detector.
Definition Digitizer.h:51
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
Definition Digitizer.h:55
void setROFRecordIR(const o2::InteractionRecord &ir)
Definition Digitizer.h:65
float getChargeThreshold() const
Definition Digitizer.h:84
void init()
Initialize the digitizer.
Definition Digitizer.cxx:35
void setEnergyToCharge(float e2c)
Definition Digitizer.h:81
void setTimeResolution(float res)
Definition Digitizer.h:79
void fillOutputContainer()
Flush the output container.
void setDigits(std::vector< o2::iotof::Digit > *dig)
Definition Digitizer.h:53
void setEfficiency(float eff)
Definition Digitizer.h:80
void process(const std::vector< o2::itsmft::Hit > *hits, int evID, int srcID)
Steer conversion of hits to digits.
Definition Digitizer.cxx:62
bool isContinuous() const
Definition Digitizer.h:69
void setEventTime(const o2::InteractionTimeRecord &irt)
Set the event time.
Definition Digitizer.h:64
void setContinuous(bool v)
Set continuous readout mode.
Definition Digitizer.h:68
void setChargeThreshold(float thr)
Definition Digitizer.h:78
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:54
float getTimeResolution() const
Definition Digitizer.h:85
void setGeometry(const o2::iotof::GeometryTGeo *gm)
Definition Digitizer.h:75
float getEfficiency() const
Definition Digitizer.h:86
const GLdouble * v
Definition glcorearb.h:832
GLuint index
Definition glcorearb.h:781
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
GPUReconstruction * rec
o2::InteractionRecord ir(0, 0)
std::vector< int > row