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_PHOS_DETECTOR_H_
13#define ALICEO2_PHOS_DETECTOR_H_
14
16#include "MathUtils/Cartesian.h"
17#include "PHOSBase/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 phos
29{
30class Hit;
31class Geometry;
32class GeometryParams;
33
41class Detector : public o2::base::DetImpl<Detector>
42{
43 public:
44 // PHOS materials/media
45 enum {
46 ID_PWO = 1,
47 ID_AL = 2,
50 ID_APD = 5,
54 ID_FE = 9,
57 ID_AIR = 12
58 };
59
63 Detector() = default;
64
69 Detector(Bool_t isActive);
70
74 ~Detector() override;
75
79 void InitializeO2Detector() final;
80 bool isMTSafe() const override { return true; }
81
86 Bool_t ProcessHits(FairVolume* v = nullptr) final;
87
100 Hit* addHit(Int_t trackID, Int_t detID, const math_utils::Point3D<float>& pos, const math_utils::Vector3D<float>& mom, Double_t totE,
101 Double_t time, Double_t eLoss);
102
106 void Register() override;
107
111 std::vector<Hit>* getHits(Int_t iColl) const
112 {
113 if (iColl == 0) {
114 return mHits;
115 } else {
116 return nullptr;
117 }
118 }
119
124 void Reset() final;
125
127 void FinishEvent() final;
128
133 void EndOfEvent() final;
134
141
145 void addAlignableVolumes() const override;
146
147 protected:
151 void CreateMaterials();
152
156 void ConstructGeometry() override;
157
160
163
164 /*
165
174 Double_t CalculateLightYield(Double_t energydeposit, Double_t tracklength, Int_t charge) const;
175 */
176 private:
178 Detector(const Detector& rhs);
179 Detector& operator=(const Detector&);
180
182 void defineSensitiveVolumes();
183
184 // Geometry parameters
185 Bool_t mCreateHalfMod; // Should we create 1/2 filled module
186 Bool_t mActiveModule[6]; // list of modules to create
187
188 // Simulation
189 std::map<int, int> mSuperParents;
190 std::vector<Hit>* mHits = nullptr;
191 Int_t mCurrentTrackID = 0;
192 Int_t mCurrentCellID = 0;
193 Int_t mCurentSuperParent = 0;
194 Hit* mCurrentHit = nullptr;
195
196 template <typename Det>
197 friend class o2::base::DetImpl;
198 ClassDefOverride(Detector, 1);
199};
200} // namespace phos
201} // namespace o2
202
203#ifdef USESHM
204namespace o2
205{
206namespace base
207{
208template <>
209struct UseShm<o2::phos::Detector> {
210 static constexpr bool value = true;
211};
212} // namespace base
213} // namespace o2
214#endif
215
216#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 PHOS detector.
Definition Detector.h:42
~Detector() override
Definition Detector.cxx:61
void ConstructSupportGeometry()
Creating PHOS/support description for Geant.
Definition Detector.cxx:807
bool isMTSafe() const override
whether this detector may run in multithreaded Geant4, with one clone per worker thread
Definition Detector.h:80
Hit * addHit(Int_t trackID, Int_t detID, const math_utils::Point3D< float > &pos, const math_utils::Vector3D< float > &mom, Double_t totE, Double_t time, Double_t eLoss)
Definition Detector.cxx:224
void Register() override
Definition Detector.cxx:128
void ConstructGeometry() override
Definition Detector.cxx:234
void InitializeO2Detector() final
Definition Detector.cxx:66
std::vector< Hit > * getHits(Int_t iColl) const
Definition Detector.h:111
void ConstructEMCGeometry()
Creating calo for Geant.
Definition Detector.cxx:441
void addAlignableVolumes() const override
Definition Detector.cxx:925
Bool_t ProcessHits(FairVolume *v=nullptr) final
Definition Detector.cxx:130
void EndOfEvent() final
Definition Detector.cxx:74
Geometry * getGeometry()
void FinishEvent() final
Sort final hist.
Definition Detector.cxx:78
void Reset() final
Definition Detector.cxx:116
friend class o2::base::DetImpl
current Hit
Definition Detector.h:197
PHOS simulation hit information.
Definition Hit.h:25
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 ...