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
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, double startE,
61 double endTime, double eLoss, int particlePdg);
62 // unsigned int startStatus,
63 // unsigned int endStatus);
64
65 std::vector<o2::fd3::Hit>* getHits(Int_t iColl)
66 {
67 if (iColl == 0) {
68 return mHits;
69 }
70 return nullptr;
71 }
72
73 // Mandatory overrides
74 void BeginPrimary() override { ; }
75 void FinishPrimary() override { ; }
76 void InitializeO2Detector() override;
77 void PostTrack() override { ; }
78 void PreTrack() override { ; }
79 bool ProcessHits(FairVolume* v = nullptr) override;
80 void EndOfEvent() override;
81 void Register() override;
82 void Reset() override;
83
84 void createMaterials();
85 void buildModules();
86
91
92 private:
93 Detector(const Detector&);
94 Detector& operator=(const Detector&);
95
96 std::vector<o2::fd3::Hit>* mHits = nullptr;
97 GeometryTGeo* mGeometryTGeo = nullptr;
98
99 TGeoVolumeAssembly* buildModuleA();
100 TGeoVolumeAssembly* buildModuleC();
101
102 float ringSize(float zmod, float eta);
103
104 unsigned int mNumberOfRingsA, mNumberOfRingsC, mNumberOfSectors;
105 float mDzScint, mDzPlate;
106
107 std::vector<float> mRingSizesA = {}, mRingSizesC = {};
108
109 float mEtaMaxA, mEtaMaxC, mEtaMinA, mEtaMinC;
110 float mZA, mZC;
111
112 bool mPlateBehindA, mFullContainer;
113
114 void defineSensitiveVolumes();
115 void definePassiveVolumes();
116
118 struct TrackData { // this is transient
119 bool mHitStarted;
120 unsigned char mTrkStatusStart;
121 TLorentzVector mPositionStart;
122 TLorentzVector mMomentumStart;
123 double mEnergyLoss;
124 } mTrackData;
125
126 template <typename Det>
127 friend class o2::base::DetImpl;
128 ClassDefOverride(Detector, 1);
129};
130
131// Input and output function for standard C++ input/output.
132std::ostream& operator<<(std::ostream& os, Detector& source);
133std::istream& operator>>(std::istream& os, Detector& source);
134
135} // namespace fd3
136} // namespace o2
137
138#ifdef USESHM
139namespace o2
140{
141namespace base
142{
143template <>
144struct UseShm<o2::fd3::Detector> {
145 static constexpr bool value = true;
146};
147} // namespace base
148} // namespace o2
149#endif
150#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:191
~Detector() override
Definition Detector.cxx:120
void InitializeO2Detector() override
Definition Detector.cxx:128
void BeginPrimary() override
Definition Detector.h:74
void PreTrack() override
Definition Detector.h:78
void FinishPrimary() override
Definition Detector.h:75
std::vector< o2::fd3::Hit > * getHits(Int_t iColl)
Definition Detector.h:65
void EndOfEvent() override
Definition Detector.cxx:211
void Register() override
Definition Detector.cxx:216
void ConstructGeometry() override
Definition Detector.cxx:205
Detector()=default
bool ProcessHits(FairVolume *v=nullptr) override
Definition Detector.cxx:135
void PostTrack() override
Definition Detector.h:77
void Reset() override
Definition Detector.cxx:227
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 ...