Project
Loading...
Searching...
No Matches
Detector.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
12#ifndef ALICEO2_CPV_DETECTOR_H_
13#define ALICEO2_CPV_DETECTOR_H_
14
16#include "MathUtils/Cartesian.h"
17#include "DataFormatsCPV/Hit.h"
18#include "RStringView.h"
19#include "Rtypes.h"
20
21#include <map>
22#include <vector>
23
24class FairVolume;
25
26namespace o2
27{
28namespace cpv
29{
30class Hit;
31class GeometryParams;
32
40class Detector : public o2::base::DetImpl<Detector>
41{
42 public:
43 // CPV materials/media
44 enum {
45 ID_AIR = 1,
47 ID_CU = 3,
48 ID_AR = 4,
49 ID_AL = 5,
50 ID_FE = 6
51 };
52
56 Detector() = default;
57
62 Detector(Bool_t isActive);
63
67 ~Detector() override;
68
72 void InitializeO2Detector() final;
73 bool isMTSafe() const override { return true; }
74
79 Bool_t ProcessHits(FairVolume* v = nullptr) final;
80
91 void addHit(int trackID, short detID, const math_utils::Point3D<float>& pos, double time, float qdep);
92
96 void Register() override;
97
101 std::vector<Hit>* getHits(Int_t iColl) const
102 {
103 if (iColl == 0) {
104 return mHits;
105 } else {
106 return nullptr;
107 }
108 }
109
114 void Reset() final;
115
117 void FinishEvent() final;
118
123 void EndOfEvent() final;
124
128 void addAlignableVolumes() const override;
129
130 protected:
134 void CreateMaterials();
135
139 void ConstructGeometry() override;
140
141 //
142 // Calculate the amplitude in one CPV pad using the
143 //
144 float padResponseFunction(float qhit, float zhit, float xhit);
145
146 float CPVCumulPadResponse(float x, float y);
147
148 private:
150 Detector(const Detector& rhs);
151 Detector& operator=(const Detector& rhs);
152
154 void defineSensitiveVolumes();
155
156 // Geometry parameters
157 Bool_t mActiveModule[5]; // list of modules to create
158
159 // Simulation
160 std::vector<Hit>* mHits = nullptr;
161 int mTrackRefLastTrackID = -1;
162
163 template <typename Det>
164 friend class o2::base::DetImpl;
165 ClassDefOverride(Detector, 1);
166};
167} // namespace cpv
168} // namespace o2
169
170#ifdef USESHM
171namespace o2
172{
173namespace base
174{
175template <>
176struct UseShm<o2::cpv::Detector> {
177 static constexpr bool value = true;
178};
179} // namespace base
180} // namespace o2
181#endif
182
183#endif // Detector.h
Definition of the Detector class.
int16_t time
Definition RawEventData.h:4
#define protected
uint16_t pos
Definition RawData.h:3
Detector class for the CPV detector.
Definition Detector.h:41
float CPVCumulPadResponse(float x, float y)
Definition Detector.cxx:307
~Detector() override
Definition Detector.cxx:53
void addHit(int trackID, short detID, const math_utils::Point3D< float > &pos, double time, float qdep)
Definition Detector.cxx:331
std::vector< Hit > * getHits(Int_t iColl) const
Definition Detector.h:101
Detector()=default
bool isMTSafe() const override
whether this detector may run in multithreaded Geant4, with one clone per worker thread
Definition Detector.h:73
float padResponseFunction(float qhit, float zhit, float xhit)
Definition Detector.cxx:287
void Register() override
Definition Detector.cxx:112
void ConstructGeometry() override
Definition Detector.cxx:340
void InitializeO2Detector() final
Definition Detector.cxx:58
void addAlignableVolumes() const override
Definition Detector.cxx:561
Bool_t ProcessHits(FairVolume *v=nullptr) final
Definition Detector.cxx:114
void EndOfEvent() final
Definition Detector.cxx:66
void FinishEvent() final
Sort final hist.
Definition Detector.cxx:70
void Reset() final
Definition Detector.cxx:104
friend class o2::base::DetImpl
last track that received a TrackReference in the current event
Definition Detector.h:164
CPV simulation hit information.
Definition Hit.h:25
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLint y
Definition glcorearb.h:270
GLsizei const GLfloat * value
Definition glcorearb.h:819
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...