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_TPC_Detector_H_
13#define AliceO2_TPC_Detector_H_
14
15#include "DetectorsBase/Detector.h" // for Detector
16#include "Rtypes.h" // for Int_t, Double32_t, Double_t, Bool_t, etc
17#include "TLorentzVector.h" // for TLorentzVector
18#include "TString.h"
19
20#include "TPCSimulation/Point.h"
21#include "TPCBase/Sector.h"
23
24class FairVolume; // lines 10-10
25
26namespace o2
27{
28namespace tpc
29{
30
31class Detector : public o2::base::DetImpl<Detector>
32{
33
34 public:
36 enum EMedium {
37 kAir = 0,
40 kCO2 = 3,
42 kAl = 4,
44 kNomex = 6,
46 kMylar = 8,
51 kEpoxy = 13,
52 kCu = 14,
53 kSi = 15,
54 kG10 = 16,
56 kSteel = 18,
57 kPeek = 19,
59 kWater = 22,
60 kBrass = 23,
62 kEpoxy1 = 25,
63 kAlumina1 = 26
64 };
69 Detector(Bool_t Active);
70
71 // Factory method
73 {
74 return new Detector(active);
75 }
76
79
81 ~Detector() override;
82
84 void InitializeO2Detector() override;
85
89 // virtual Bool_t ProcessHitsOrig( FairVolume* v=0);
90 Bool_t ProcessHits(FairVolume* v = nullptr) override;
91
93 void Register() override;
94
96 std::vector<HitGroup>* getHits(Int_t iColl) const
97 {
98 if (iColl >= 0 && iColl < Sector::MAXSECTOR) {
99 return mHitsPerSectorCollection[iColl];
100 }
101 return nullptr;
102 }
103
105 std::string getHitBranchNames(int coll) const override;
106
108 void Reset() override;
109
111 void ConstructGeometry() override;
112
116 Point* addHit(float x, float y, float z, float time, float nElectrons, float trackID, float detID);
117
119
124 template <typename T>
125 static T BetheBlochAleph(T bg, T kp1, T kp2, T kp3, T kp4, T kp5)
126 {
127 return o2::tpc::BetheBlochAleph(bg, kp1, kp2, kp3, kp4, kp5);
128 }
129
136 Double_t Gamma(Double_t k);
137
142 void EndOfEvent() override;
143 void FinishPrimary() override { ; }
144 void FinishRun() override { ; }
145 void BeginPrimary() override { ; }
146 void PostTrack() override { ; }
147 void PreTrack() override { ; }
148
149 void SetSpecialPhysicsCuts() override;
150
151 void SetGeoFileName(const TString file) { mGeoFileName = file; }
152 const TString& GetGeoFileName() const { return mGeoFileName; }
153
154 private:
155 int mHitCounter = 0;
156 int mElectronCounter = 0;
157 int mStepCounter = 0;
158 ElementalHit mHitLast{};
159 HitGroup* mCurrentGroup = nullptr;
160 int mOldTrackId = -1;
161 int mOldSectorId = -1;
162 int mGroupCounter = 0;
163
165 virtual void CreateMaterials();
166
169 void GeantHack();
170
172 void LoadGeometryFromFile();
174 void ConstructTPCGeometry();
175
177 void defineSensitiveVolumes();
178
179 // needed by base implementation
180 bool setHits(Int_t iColl, std::vector<HitGroup>* ptr)
181 {
182 if (iColl >= 0 && iColl < Sector::MAXSECTOR) {
183 mHitsPerSectorCollection[iColl] = ptr;
184 // more entries to set?
185 if (iColl < Sector::MAXSECTOR - 1) {
186 return true;
187 }
188 }
189 return false;
190 }
191
193 std::vector<HitGroup>* mHitsPerSectorCollection[Sector::MAXSECTOR];
194
195 TString mGeoFileName;
196 // size_t mEventNr; //!< current event number
197 // Events are not successive in MT mode
198
200 Detector(const Detector& rhs);
201 Detector& operator=(const Detector&);
202
203 template <typename Det>
204 friend class o2::base::DetImpl;
205 ClassDefOverride(Detector, 1);
206};
207
208} // namespace tpc
209} // namespace o2
210
211#ifdef USESHM
212namespace o2
213{
214namespace base
215{
216template <>
217struct UseShm<o2::tpc::Detector> {
218 static constexpr bool value = true;
219};
220} // namespace base
221} // namespace o2
222#endif
223
224#endif // AliceO2_TPC_Detector_H_
Definition of the Detector class.
int16_t time
Definition RawEventData.h:4
Class for TPC Point.
TBranch * ptr
Detector & operator=(const Detector &)
Definition Detector.cxx:46
Detector()
Default Constructor.
Definition Detector.cxx:36
void BeginPrimary() override
Definition Detector.h:145
void Reset() override
void ConstructGeometry() override
void PreTrack() override
Definition Detector.h:147
Point * addHit(float x, float y, float z, float time, float nElectrons, float trackID, float detID)
Bool_t ProcessHits(FairVolume *v=nullptr) override
void FinishPrimary() override
Definition Detector.h:143
const TString & GetGeoFileName() const
Definition Detector.h:152
static T BetheBlochAleph(T bg, T kp1, T kp2, T kp3, T kp4, T kp5)
Copied from AliRoot - should go to someplace else.
Definition Detector.h:125
~Detector() override
void InitializeO2Detector() override
void PostTrack() override
Definition Detector.h:146
void Register() override
std::vector< HitGroup > * getHits(Int_t iColl) const
Definition Detector.h:96
void FinishRun() override
Definition Detector.h:144
std::string getHitBranchNames(int coll) const override
void EndOfEvent() override
void SetGeoFileName(const TString file)
Definition Detector.h:151
void SetSpecialPhysicsCuts() override
Detector(Bool_t Active)
static o2::base::Detector * create(bool active)
Definition Detector.h:72
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLint y
Definition glcorearb.h:270
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 ...