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 private:
79 void processHit(const o2::itsmft::Hit& hit, int evID, int srcID);
80
82 void registerDigits(Chip& chip, uint32_t roFrame, double time, int nROF,
83 uint16_t row, uint16_t col, int nElectrons, o2::MCCompLabel& label);
84
85 void stepping(const o2::itsmft::Hit& hit, float**& respMatrix, int& rowStart, int& colStart, int& rowSpan, int& colSpan);
86
88 double smearTime(double time) const;
89
91 int energyToCharge(float energyLoss) const;
92
94 bool isEfficient() const;
95
96 std::vector<o2::iotof::McLabelRef>* getExtraLabelBuffer(uint32_t roFrame)
97 {
98 // if (mROFrameMin > roFrame) {
99 // return nullptr; // nothing to do
100 // }
101 // int index = roFrame - mROFrameMin;
102
103 int index = roFrame;
104 while (index >= int(mExtraLabelBuffer.size())) {
105 mExtraLabelBuffer.emplace_back(std::make_unique<std::vector<o2::iotof::McLabelRef>>());
106 }
107 return mExtraLabelBuffer[index].get();
108 }
109
110 static constexpr float sec2ns = 1e9f;
111
112 const o2::iotof::GeometryTGeo* mGeometry = nullptr;
113
114 std::vector<o2::iotof::Chip> mChips;
115 std::deque<std::unique_ptr<std::vector<o2::iotof::McLabelRef>>> mExtraLabelBuffer;
116
117 std::vector<o2::iotof::Digit>* mDigits = nullptr;
118 std::vector<o2::itsmft::ROFRecord>* mROFRecords = nullptr;
120
121 o2::InteractionTimeRecord mEventTime;
122 o2::InteractionRecord mROFRecordIR;
123 bool mContinuous = true;
124
125 static o2::iotof::Segmentation* sSegmentation;
126
127 ClassDefNV(Digitizer, 1);
128};
129} // namespace o2::iotof
130
131#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:51
void setROFRecords(std::vector< o2::itsmft::ROFRecord > *rec)
Definition Digitizer.h:55
void setROFRecordIR(const o2::InteractionRecord &ir)
Definition Digitizer.h:65
void init()
Initialize the digitizer.
Definition Digitizer.cxx:35
void fillOutputContainer()
Flush the output container.
void setDigits(std::vector< o2::iotof::Digit > *dig)
Definition Digitizer.h:53
void process(const std::vector< o2::itsmft::Hit > *hits, int evID, int srcID)
Steer conversion of hits to digits.
Definition Digitizer.cxx:64
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 setMCLabels(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *mclb)
Definition Digitizer.h:54
void setGeometry(const o2::iotof::GeometryTGeo *gm)
Definition Digitizer.h:75
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