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_TRD_DETECTOR_H_
13#define ALICEO2_TRD_DETECTOR_H_
14
15#include <vector>
19
20#include "DataFormatsTRD/Hit.h"
21
22class FairVolume;
23
24namespace o2
25{
26namespace trd
27{
28
29class Geometry;
30class TRsim;
31
32class Detector : public o2::base::DetImpl<Detector>
33{
34 public:
35 Detector(Bool_t active = true);
36 ~Detector() override;
37 void InitializeO2Detector() override;
38 bool ProcessHits(FairVolume* v = nullptr) override;
39 void Register() override;
40 std::vector<Hit>* getHits(int iColl) const
41 {
42 if (iColl == 0) {
43 return mHits;
44 }
45 return nullptr;
46 }
47 void FinishEvent() override;
48 void Reset() override;
49 void EndOfEvent() override;
50 void createMaterials();
51 void ConstructGeometry() override;
53 void addAlignableVolumes() const override;
54
55 private:
57 Detector(const Detector& rhs);
58
59 void InitializeParams();
60
61 // defines/sets-up the sensitive volumes
62 void defineSensitiveVolumes();
63
64 // addHit
65 template <typename T>
66 void addHit(T x, T y, T z, T locC, T locR, T locT, T tof, int charge, int trackId, int detId, bool drift = false);
67
68 // Create TR hits
69 void createTRhit(int);
70
71 std::vector<Hit>* mHits = nullptr;
72
73 float mFoilDensity;
74 float mGasNobleFraction;
75 float mGasDensity;
76
77 float mMaxMCStepDef;
78
79 bool mTRon; // Switch for TR simulation
80 TRsim* mTR; // Access to TR simulation
81
82 float mWion; // Ionization potential
83
84 Geometry* mGeom = nullptr;
85
86 template <typename Det>
87 friend class o2::base::DetImpl;
88 ClassDefOverride(Detector, 1);
89};
90
91template <typename T>
92void Detector::addHit(T x, T y, T z, T locC, T locR, T locT, T tof, int charge, int trackId, int detId, bool drift)
93{
94 mHits->emplace_back(x, y, z, locC, locR, locT, tof, charge, trackId, detId, drift);
95}
96
97} // namespace trd
98} // namespace o2
99
100#ifdef USESHM
101namespace o2
102{
103namespace base
104{
105template <>
106struct UseShm<o2::trd::Detector> {
107 static constexpr bool value = true;
108};
109} // namespace base
110} // namespace o2
111#endif
112#endif
Definition of the Detector class.
int16_t charge
Definition RawEventData.h:5
Detector()
Default Constructor.
Definition Detector.cxx:36
~Detector() override
Definition Detector.cxx:53
void InitializeO2Detector() override
Definition Detector.cxx:58
void EndOfEvent() override
Definition Detector.cxx:295
void Register() override
Definition Detector.cxx:272
void ConstructGeometry() override
Definition Detector.cxx:497
void addAlignableVolumes() const override
Add alignable top volumes.
Definition Detector.cxx:523
bool ProcessHits(FairVolume *v=nullptr) override
Definition Detector.cxx:83
void Reset() override
Definition Detector.cxx:288
std::vector< Hit > * getHits(int iColl) const
Definition Detector.h:40
void FinishEvent() override
Definition Detector.cxx:277
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...