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;
90
92 int energyToCharge(float energyLoss) const;
93
95 void loadEfficiencyMap(const std::string& filePath);
96
100 bool isEfficient(const float x, const float z) const;
101
102 std::vector<o2::iotof::McLabelRef>* getExtraLabelBuffer(uint32_t roFrame)
103 {
104 // if (mROFrameMin > roFrame) {
105 // return nullptr; // nothing to do
106 // }
107 // int index = roFrame - mROFrameMin;
108
109 int index = roFrame;
110 while (index >= int(mExtraLabelBuffer.size())) {
111 mExtraLabelBuffer.emplace_back(std::make_unique<std::vector<o2::iotof::McLabelRef>>());
112 }
113 return mExtraLabelBuffer[index].get();
114 }
115
116 static constexpr float sec2ns = 1e9f;
117 static constexpr float cm2um = 1e4f;
118
119 const o2::iotof::GeometryTGeo* mGeometry = nullptr;
120 TH2D* mEfficiencyMap = nullptr;
121
122 std::vector<o2::iotof::Chip> mChips;
123 std::deque<std::unique_ptr<std::vector<o2::iotof::McLabelRef>>> mExtraLabelBuffer;
124
125 std::vector<o2::iotof::Digit>* mDigits = nullptr;
126 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
128
129 o2::InteractionTimeRecord mEventTime;
130 o2::InteractionRecord mROFRecordIR;
131 bool mContinuous = true;
132
133 static o2::iotof::Segmentation* sSegmentation;
134
135 ClassDefNV(Digitizer, 1);
136};
137} // namespace o2::iotof
138
139#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:39
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:71
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
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
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
GPUReconstruction * rec
o2::InteractionRecord ir(0, 0)
std::vector< int > row