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 void loadEfficiencyMap(TH2D* map) { mEfficiencyMap = map; }
79 void loadResolutionMap(TH2D* map) { mResolutionMap = map; }
80 void loadTimeOfArrivalMap(TH2D* map) { mTimeOfArrivalMap = map; }
81
83
84 private:
86 void processHit(const o2::itsmft::Hit& hit, int evID, int srcID);
87
89 void registerDigits(Chip& chip, uint32_t roFrame, double time, int nROF,
90 uint16_t row, uint16_t col, int nElectrons, o2::MCCompLabel& label);
91
92 void stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float**& avgHitLocalX, float**& avgHitLocalZ, int& rowStart, int& colStart, int& rowSpan, int& colSpan);
93
95 double smearTime(double time, const float x, const float z) const;
96
98 int energyToCharge(float energyLoss) const;
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
unsigned short int uint16_t
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to process
configStandalone rec
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 prepareScaledResolutionMap()
void loadResolutionMap(TH2D *map)
Definition Digitizer.h:79
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:43
void fillOutputContainer()
Flush the output container.
void loadTimeOfArrivalMap(TH2D *map)
Definition Digitizer.h:80
void setDigits(std::vector< o2::iotof::Digit > *dig)
Definition Digitizer.h:54
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
void loadEfficiencyMap(TH2D *map)
Definition Digitizer.h:78
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
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
o2::InteractionRecord ir(0, 0)
std::vector< int > row