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 <TH2D.h>
27#include <Rtypes.h> // for Digitizer::Class
28#include <TObject.h> // for TObject
29
39
40namespace o2::iotof
41{
42
51class Digitizer : public TObject
52{
53 public:
54 void setDigits(std::vector<o2::iotof::Digit>* dig) { mDigits = dig; }
56 void setROFRecords(std::vector<o2::itsmft::ROFRecord>* rec) { mROFRecords = rec; }
57
59 void init();
60
62 void process(const std::vector<o2::itsmft::Hit>* hits, int evID, int srcID);
63
65 void setEventTime(const o2::InteractionTimeRecord& irt) { mEventTime = irt; }
66 void setROFRecordIR(const o2::InteractionRecord& ir) { mROFRecordIR = ir; }
67
69 void setContinuous(bool v) { mContinuous = v; }
70 bool isContinuous() const { return mContinuous; }
71
74
75 // Provide the common iotof::GeometryTGeo to access matrices and segmentation
76 void setGeometry(const o2::iotof::GeometryTGeo* gm) { mGeometry = gm; }
77
78 private:
80 void processHit(const o2::itsmft::Hit& hit, int evID, int srcID);
81
83 void registerDigits(Chip& chip, uint32_t roFrame, double time, int nROF,
84 uint16_t row, uint16_t col, int nElectrons, o2::MCCompLabel& label);
85
86 void stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float**& avgHitLocalX, float**& avgHitLocalZ, int& rowStart, int& colStart, int& rowSpan, int& colSpan);
87
89 double smearTime(double time, const float x, const float z) const;
90
92 int energyToCharge(float energyLoss) const;
93
96 void loadMap(TH2D*& map, const std::string& path, const char* mapName);
97
98 void prepareScaledResolutionMap();
99
103 bool isEfficient(const float x, const float z) 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 ps2ns = 1e-3f;
120 static constexpr float sec2ns = 1e9f;
121 static constexpr float cm2um = 1e4f;
122
123 const o2::iotof::GeometryTGeo* mGeometry = nullptr;
124 TH2D* mEfficiencyMap = nullptr;
125 TH2D* mResolutionMap = nullptr;
126 TH2D* mScaledResolutionMap = nullptr;
127 TH2D* mTimeOfArrivalMap = nullptr;
128
129 std::vector<o2::iotof::Chip> mChips;
130 std::deque<std::unique_ptr<std::vector<o2::iotof::McLabelRef>>> mExtraLabelBuffer;
131
132 std::vector<o2::iotof::Digit>* mDigits = nullptr;
133 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
135
136 o2::InteractionTimeRecord mEventTime;
137 o2::InteractionRecord mROFRecordIR;
138 bool mContinuous = true;
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
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:52
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
Definition Digitizer.h:56
void setROFRecordIR(const o2::InteractionRecord &ir)
Definition Digitizer.h:66
void init()
Initialize the digitizer.
Definition Digitizer.cxx:42
void fillOutputContainer()
Flush the output container.
void setDigits(std::vector< o2::iotof::Digit > *dig)
Definition Digitizer.h:54
void process(const std::vector< o2::itsmft::Hit > *hits, int evID, int srcID)
Steer conversion of hits to digits.
Definition Digitizer.cxx:96
bool isContinuous() const
Definition Digitizer.h:70
void setEventTime(const o2::InteractionTimeRecord &irt)
Set the event time.
Definition Digitizer.h:65
void setContinuous(bool v)
Set continuous readout mode.
Definition Digitizer.h:69
void setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:55
void setGeometry(const o2::iotof::GeometryTGeo *gm)
Definition Digitizer.h:76
Segmentation and response for pixels in inner and outer TOF of the ALICE 3 apparatus.
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLuint index
Definition glcorearb.h:781
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
GPUReconstruction * rec
o2::InteractionRecord ir(0, 0)
std::vector< int > row