Project
Loading...
Searching...
No Matches
SpatialPhotonResponse.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
14
15#ifndef DETECTORS_ZDC_SIMULATION_INCLUDE_ZDCSIMULATION_SPATIALPHOTONRESPONSE_H_
16#define DETECTORS_ZDC_SIMULATION_INCLUDE_ZDCSIMULATION_SPATIALPHOTONRESPONSE_H_
17
18#include <array>
19#include <vector>
20
21namespace o2
22{
23namespace zdc
24{
25
26static constexpr int ZDCCHANNELSPERTOWER = 1;
27
31{
32 public:
33 // Nx number of pixels in x direction
34 // Ny number of pixels in y direction
35 SpatialPhotonResponse(int Nx, int Ny, double lowerx, double lowery, double lengthx, double lengthy);
36
38
39 void addPhoton(double x, double y, int nphotons);
40 // void exportToPNG() const;
41 void printToScreen() const;
42 void reset();
43
44 double getCellLx() const { return mLxOfCell; }
45 double getCellLy() const { return mLyOfCell; }
46
47 double getNx() const { return mNx; }
48 double getNy() const { return mNy; }
49 double getLowerX() const { return mLowerX; }
50 double getLowerY() const { return mLowerY; }
51
52 bool hasSignal() const { return mPhotonSum > 0; }
53 int getPhotonSum() const { return mPhotonSum; }
54 void setDetectorID(int det)
55 {
56 if (mDetectorID != -1 && det != mDetectorID) {
57 printErrMsg("trying to change detector ID");
58 }
59 mDetectorID = det;
60 }
61 int getDetectorID() const { return mDetectorID; }
62 void setHitTime(float t) { mTime = t; }
63 float getHitTime() const { return mTime; }
64
65 std::array<int, 5> getPhotonsPerChannel() const;
66
67 std::vector<std::vector<int>> const& getImageData() const { return mImageData; }
68
69 private:
70 void printErrMsg(const char* mgs) const;
71
72 double mLxOfCell = 1.; // x length of cell corresponding to one pixel
73 double mLyOfCell = 1.; // y length of cell corresponding to one pixel
74
75 double mInvLxOfCell = 1.; // x length of cell corresponding to one pixel
76 double mInvLyOfCell = 1.; // y length of cell corresponding to one pixel
77
78 double mLowerX = 0.; // lowerX coordinate of image (used to convert to pixels in addPhoton)
79 double mLowerY = 0.; // lowerY coordinate of image (used to convert to pixels in addPhoton)
80
81 int mNx = 1; // number of "towers" in x direction
82 int mNy = 1; // number of "towers" in y direction
83 int mPhotonSum = 0; // accumulated photon number (for quick filtering)
84
85 int mDetectorID = -1; // the detectorID (ZNA, ZNC, ZPA, ZPC) to which this image corresponds (if available)
86
87 float mTime = -1.; // the time (time difference between creation of response and the collission time); negative is unitialized
88
89 std::vector<std::vector<int>> mImageData;
90};
91
92} // namespace zdc
93} // namespace o2
94
95#endif /* DETECTORS_ZDC_SIMULATION_INCLUDE_ZDCSIMULATION_SPATIALPHOTONRESPONSE_H_ */
std::vector< std::vector< int > > const & getImageData() const
void addPhoton(double x, double y, int nphotons)
std::array< int, 5 > getPhotonsPerChannel() const
GLint GLenum GLint x
Definition glcorearb.h:403
struct o2::upgrades_utils::@463 zdc
structure to keep FT0 information
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...