Project
Loading...
Searching...
No Matches
Detector.h
Go to the documentation of this file.
1// Copyright 2019-2026 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 ALICEO2_FD3_DETECTOR_H_
16#define ALICEO2_FD3_DETECTOR_H_
17
22#include "DataFormatsFD3/Hit.h"
23#include "Rtypes.h"
24#include "TGeoManager.h"
25#include "TLorentzVector.h"
26#include "TVector3.h"
27#include <cmath>
28
29class FairVolume;
30class TGeoVolume;
31
32namespace o2
33{
34namespace fd3
35{
36class GeometryTGeo;
37}
38} // namespace o2
39
40namespace o2
41{
42namespace fd3
43{
44
45class Detector : public o2::base::DetImpl<Detector>
46{
47 public:
48 Detector(bool Active);
49
50 Detector() = default;
51
52 ~Detector() override;
53
54 void ConstructGeometry() override;
55
57 o2::fd3::Hit* addHit(int trackId, unsigned int detId,
58 const math_utils::Point3D<float>& startPos,
59 const math_utils::Point3D<float>& endPos,
60 const math_utils::Vector3D<float>& startMom,
61 double startE,
62 double endTime,
63 double eLoss,
64 int particlePdg);
65
66 // unsigned int startStatus,
67 // unsigned int endStatus);
68
69 std::vector<o2::fd3::Hit>* getHits(Int_t iColl)
70 {
71 if (iColl == 0) {
72 return mHits;
73 }
74 return nullptr;
75 }
76
77 // Mandatory overrides
78 void BeginPrimary() override { ; }
79 void FinishPrimary() override { ; }
80 void InitializeO2Detector() override;
81 void PostTrack() override { ; }
82 void PreTrack() override { ; }
83 bool ProcessHits(FairVolume* v = nullptr) override;
84 void EndOfEvent() override;
85 void Register() override;
86 void Reset() override;
87
88 void createMaterials();
89 void buildModules();
90
95
96 private:
97 Detector(const Detector&);
98 Detector& operator=(const Detector&);
99
100 std::vector<o2::fd3::Hit>* mHits = nullptr;
101 GeometryTGeo* mGeometryTGeo = nullptr;
102
103 TGeoVolumeAssembly* buildModuleScint(float etaMin, float etaMax);
104 TGeoVolumeAssembly* buildModuleCherenkov_v1();
105 TGeoVolumeAssembly* buildModuleCherenkov_v2();
106
107 int mChannelCounter;
108 std::map<int, int> mChannelId;
109
110 float getRingSize(float zmod, float eta);
111
112 void defineSensitiveVolumes();
113 void definePassiveVolumes();
114
116 struct TrackData { // this is transient
117 bool mHitStarted;
118 unsigned char mTrkStatusStart;
119 TLorentzVector mPositionStart;
120 TLorentzVector mMomentumStart;
121 double mEnergyLoss;
122 } mTrackData;
123
124 template <typename Det>
125 friend class o2::base::DetImpl;
126 ClassDefOverride(Detector, 1);
127};
128
129// Input and output function for standard C++ input/output.
130std::ostream& operator<<(std::ostream& os, Detector& source);
131std::istream& operator>>(std::istream& os, Detector& source);
132
133} // namespace fd3
134} // namespace o2
135
136#ifdef USESHM
137namespace o2
138{
139namespace base
140{
141template <>
142struct UseShm<o2::fd3::Detector> {
143 static constexpr bool value = true;
144};
145} // namespace base
146} // namespace o2
147#endif
148#endif
Definition of the Detector class.
Definition of the FD3 Hit class (based on ITSMFT and FV0)
o2::fd3::Hit * addHit(int trackId, unsigned int detId, const math_utils::Point3D< float > &startPos, const math_utils::Point3D< float > &endPos, const math_utils::Vector3D< float > &startMom, double startE, double endTime, double eLoss, int particlePdg)
This method is an example of how to add your own point of type Hit to the clones array.
Definition Detector.cxx:153
~Detector() override
Definition Detector.cxx:80
void InitializeO2Detector() override
Definition Detector.cxx:88
void BeginPrimary() override
Definition Detector.h:78
void PreTrack() override
Definition Detector.h:82
void FinishPrimary() override
Definition Detector.h:79
std::vector< o2::fd3::Hit > * getHits(Int_t iColl)
Definition Detector.h:69
void EndOfEvent() override
Definition Detector.cxx:167
void Register() override
Definition Detector.cxx:172
void ConstructGeometry() override
Definition Detector.cxx:190
Detector()=default
bool ProcessHits(FairVolume *v=nullptr) override
Definition Detector.cxx:96
void PostTrack() override
Definition Detector.h:81
void Reset() override
Definition Detector.cxx:183
FD3 Geometry type.
const GLdouble * v
Definition glcorearb.h:832
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLsizei const GLfloat * value
Definition glcorearb.h:819
std::istream & operator>>(std::istream &os, Detector &source)
std::ostream & operator<<(std::ostream &os, Detector &source)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...