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
78 Bool_t ProcessHits(FairVolume* v = nullptr) final;
79
90 void addHit(int trackID, short detID, const math_utils::Point3D<float>& pos, double time, float qdep);
91
95 void Register() override;
96
100 std::vector<Hit>* getHits(Int_t iColl) const
101 {
102 if (iColl == 0) {
103 return mHits;
104 } else {
105 return nullptr;
106 }
107 }
108
113 void Reset() final;
114
116 void FinishEvent() final;
117
122 void EndOfEvent() final;
123
127 void addAlignableVolumes() const override;
128
129 protected:
133 void CreateMaterials();
134
138 void ConstructGeometry() override;
139
140 //
141 // Calculate the amplitude in one CPV pad using the
142 //
143 float padResponseFunction(float qhit, float zhit, float xhit);
144
145 float CPVCumulPadResponse(float x, float y);
146
147 private:
149 Detector(const Detector& rhs);
150 Detector& operator=(const Detector& rhs);
151
153 void defineSensitiveVolumes();
154
155 // Geometry parameters
156 Bool_t mActiveModule[5]; // list of modules to create
157
158 // Simulation
159 std::vector<Hit>* mHits = nullptr;
160
161 template <typename Det>
162 friend class o2::base::DetImpl;
163 ClassDefOverride(Detector, 1);
164};
165} // namespace cpv
166} // namespace o2
167
168#ifdef USESHM
169namespace o2
170{
171namespace base
172{
173template <>
174struct UseShm<o2::cpv::Detector> {
175 static constexpr bool value = true;
176};
177} // namespace base
178} // namespace o2
179#endif
180
181#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:299
~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:323
std::vector< Hit > * getHits(Int_t iColl) const
Definition Detector.h:100
Detector()=default
float padResponseFunction(float qhit, float zhit, float xhit)
Definition Detector.cxx:279
void Register() override
Definition Detector.cxx:111
void ConstructGeometry() override
Definition Detector.cxx:332
void InitializeO2Detector() final
Definition Detector.cxx:58
void addAlignableVolumes() const override
Definition Detector.cxx:543
Bool_t ProcessHits(FairVolume *v=nullptr) final
Definition Detector.cxx:113
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
Collection of CPV hits.
Definition Detector.h:162
CPV simulation hit information.
Definition Hit.h:25
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLsizei const GLfloat * value
Definition glcorearb.h:819
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.