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
16#ifndef O2_MID_DIGITIZER_H
17#define O2_MID_DIGITIZER_H
18
19#include <random>
20#include <vector>
21#include <array>
22#include "MathUtils/Cartesian.h"
26#include "MIDBase/Mapping.h"
30#include "MIDSimulation/Hit.h"
32
33namespace o2
34{
35namespace mid
36{
38{
39 public:
40 Digitizer(const ChamberResponse& chamberResponse, const ChamberEfficiencyResponse& efficiencyResponse, const GeometryTransformer& transformer);
41 virtual ~Digitizer() = default;
42
43 void process(const std::vector<Hit>& hits, std::vector<ColumnData>& digitStore, o2::dataformats::MCTruthContainer<MCLabel>& mcContainer);
44
46 void setEventID(int entryID) { mEventID = entryID; }
47
49 void setSrcID(int sourceID) { mSrcID = sourceID; }
50
52 void setGeometryTransformer(const GeometryTransformer& transformer) { mTransformer = transformer; }
53
55 void setChamberResponse(const ChamberResponse& chamberResponse) { mResponse = chamberResponse; }
56
58 ChamberResponse& getChamberResponse() { return mResponse; }
59
61 void setChamberEfficiency(const std::vector<ChEffCounter>& counters) { mEfficiencyResponse.setFromCounters(counters); }
62
64 void setSeed(unsigned int seed) { mGenerator.seed(seed); }
65
66 private:
67 void addStrip(const Mapping::MpStripIndex& stripIndex, int cathode, int deId);
68 bool addBPStrips(double xPos, double yPos, int deId, double prob, double xOffset);
69 bool addNeighbours(const Mapping::MpStripIndex& stripIndex, int cathode, int deId, double prob,
70 const std::array<double, 2>& initialDist, double xOffset = 0.);
71 bool hitToDigits(const Hit& hit);
72 bool getLabelLimits(int cathode, const ColumnData& col, int& firstStrip, int& lastStrip) const;
73
74 int mEventID{0};
75 int mSrcID{0};
76
77 std::default_random_engine mGenerator;
78 std::uniform_real_distribution<double> mRandom;
79 ChamberResponse mResponse;
80 ChamberEfficiencyResponse mEfficiencyResponse;
81 Mapping mMapping;
82 GeometryTransformer mTransformer;
83 std::vector<ColumnData> mDigits;
84};
85
87
88} // namespace mid
89} // namespace o2
90
91#endif /* O2_MID_DIGITIZER_H */
Chamber efficiency counters.
MID RPC effciency response.
MID RPC response.
Strip pattern (aka digits)
Label for MID.
Hit for MID.
Geometry transformer for MID.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Mapping for MID.
uint32_t col
Definition RawData.h:4
Checks validity of hardware address (HW) and transform it to digit AbsId index.
A container to hold and manage MC truth information/labels.
void setFromCounters(const std::vector< ChEffCounter > &counters)
Sets the chamber efficiency from the counters.
ChamberResponse & getChamberResponse()
Gets the chamber response.
Definition Digitizer.h:58
void setChamberResponse(const ChamberResponse &chamberResponse)
Sets the chamber response.
Definition Digitizer.h:55
void setChamberEfficiency(const std::vector< ChEffCounter > &counters)
Sets the chamber efficiency.
Definition Digitizer.h:61
void setSeed(unsigned int seed)
Sets the seed.
Definition Digitizer.h:64
void setEventID(int entryID)
Sets the event ID.
Definition Digitizer.h:46
void setSrcID(int sourceID)
Sets the source ID.
Definition Digitizer.h:49
void setGeometryTransformer(const GeometryTransformer &transformer)
Sets the geometry transformer.
Definition Digitizer.h:52
virtual ~Digitizer()=default
GLint GLint GLsizei GLuint * counters
Definition glcorearb.h:3985
Digitizer createDefaultDigitizer()
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Column data structure for MID.
Definition ColumnData.h:29
Indexes required to define a strip in the detection element.
Definition Mapping.h:34