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_FOCAL_DETECTOR_H_
13#define ALICEO2_FOCAL_DETECTOR_H_
14
15#include <vector>
16
18#include "FOCALBase/Hit.h"
19#include "FOCALBase/Geometry.h"
20#include "TGeoManager.h"
21
22class FairVolume;
23
24namespace o2::focal
25{
26
27class Hit;
28class Geometry;
29
33struct Parent {
34 int mPDG;
35 double mEnergy;
37};
38
54class Detector : public o2::base::DetImpl<Detector>
55{
56 public:
60 ID_G10 = 3,
65 ID_PB = 8,
66 ID_SC = 9,
69 ID_VAC = 12,
70 ID_AIR = 13 };
72 Detector() = default;
73
77 Detector(Bool_t isActive, std::string geofilename = "default");
78
80 ~Detector() override;
81
83 void InitializeO2Detector() override;
84
87 Bool_t ProcessHits(FairVolume* v = nullptr) final;
88
101 Hit* AddHit(int trackID, int primary, double initialEnergy, int detID, o2::focal::Hit::Subsystem_t subsystem,
102 const math_utils::Point3D<float>& pos, double time, double energyloss);
103
105 void Register() override;
106
109 std::vector<Hit>* getHits(Int_t iColl) const
110 {
111 if (iColl == 0) {
112 return mHits;
113 }
114 return nullptr;
115 }
116
118 void Reset() final;
119
123 void EndOfEvent() final;
124
129 void BeginPrimary() override;
130
134 void FinishPrimary() override;
135
140 Geometry* getGeometry(std::string name = "");
141
147 Hit* FindHit(int parentID, int col, int row, int layer);
148
149 protected:
151 void CreateMaterials();
152
153 virtual void addAlignableVolumes() const override;
154 void addAlignableVolumesHCAL() const;
155 void addAlignableVolumesECAL() const;
156
157 void ConstructGeometry() override;
158
159 virtual void CreateHCALSpaghetti();
160 virtual void CreateHCALSandwich();
161 virtual void CreateHCALSheets();
162
163 TGeoVolumeAssembly* CreatePitchAssembly(double Lx = 498.1,
164 double Ly1 = 2.0,
165 double Ly2 = 1.5,
166 double Lz = 1100.0,
167 double hole_diameter = 1.1,
168 double hole_spacing = 4.0,
169 int nholes = 124,
170 double fiber_radius = 0.5,
171 std::string suffix = "");
172
174 void CreateECALGeometry();
175
180 Parent* AddSuperparent(int trackID, int pdg, double energy);
181
184 bool ProcessHitsEPad(FairVolume* v = nullptr);
185
188 bool ProcessHitsEPix(FairVolume* v = nullptr);
189
192 bool ProcessHitsHCAL(FairVolume* v = nullptr);
193
194 private:
196 Detector(const Detector& rhs);
197
198 Geometry* mGeometry;
199
200 int mMedSensHCal = 0;
201 int mMedSensECalPad = 0;
202 int mMedSensECalPix = 0;
203
204 std::vector<const Composition*> mGeoCompositions;
205
206 std::vector<o2::focal::Hit>* mHits;
207 std::unordered_map<Hit::HitID, unsigned int, Hit::HitIDHasher> mHitIndexMapping;
208
209 std::unordered_map<int, int> mSuperParentsIndices;
210 std::unordered_map<int, Parent> mSuperParents;
211 Parent* mCurrentSuperparent;
212
213 // Worker variables during hit creation
214 Int_t mCurrentTrack;
215 Int_t mCurrentPrimaryID;
216 Int_t mCurrentParentID;
217
218 std::vector<std::string> mSensitive;
219 int mVolumeIDScintillator = -1;
220
221 template <typename Det>
222 friend class o2::base::DetImpl;
223 ClassDefOverride(Detector, 1);
224};
225} // namespace o2::focal
226
227#ifdef USESHM
228namespace o2
229{
230namespace base
231{
232template <>
233struct UseShm<o2::focal::Detector> {
234 static constexpr bool value = true;
235};
236} // namespace base
237} // namespace o2
238#endif
239
240#endif // ALICEO2_FOCAL_DETECTOR_H_
Definition of the Detector class.
int16_t time
Definition RawEventData.h:4
#define protected
uint16_t pos
Definition RawData.h:3
uint32_t col
Definition RawData.h:4
FOCAL detector simulation.
Definition Detector.h:55
bool ProcessHitsEPad(FairVolume *v=nullptr)
Processing hit creation in the ECAL Pad sensitive volume.
TGeoVolumeAssembly * CreatePitchAssembly(double Lx=498.1, double Ly1=2.0, double Ly2=1.5, double Lz=1100.0, double hole_diameter=1.1, double hole_spacing=4.0, int nholes=124, double fiber_radius=0.5, std::string suffix="")
Definition Detector.cxx:697
void addAlignableVolumesHCAL() const
Definition Detector.cxx:407
~Detector() override
Destructor.
Definition Detector.cxx:65
void InitializeO2Detector() override
Initializing detector.
Definition Detector.cxx:81
bool ProcessHitsHCAL(FairVolume *v=nullptr)
Processing hit creation in the HCAL sensitive volume.
std::vector< Hit > * getHits(Int_t iColl) const
Get access to the hits.
Definition Detector.h:109
virtual void CreateHCALSandwich()
Definition Detector.cxx:910
void Register() override
register container with hits
Definition Detector.cxx:197
virtual void CreateHCALSheets()
Definition Detector.cxx:831
Hit * AddHit(int trackID, int primary, double initialEnergy, int detID, o2::focal::Hit::Subsystem_t subsystem, const math_utils::Point3D< float > &pos, double time, double energyloss)
Add FOCAL hit.
Definition Detector.cxx:163
void FinishPrimary() override
Finish current primary.
virtual void CreateHCALSpaghetti()
Definition Detector.cxx:504
void ConstructGeometry() override
Definition Detector.cxx:428
Detector(Bool_t isActive, std::string geofilename="default")
Main constructor.
void addAlignableVolumesECAL() const
Definition Detector.cxx:418
bool ProcessHitsEPix(FairVolume *v=nullptr)
Processing hit creation in the ECAL Pixel sensitive volume.
virtual void addAlignableVolumes() const override
declare alignable volumes of detector
Definition Detector.cxx:395
void CreateMaterials()
Creating detector materials for the FOCAL detector.
Definition Detector.cxx:216
Hit * FindHit(int parentID, int col, int row, int layer)
Try to find hit with same cell and parent track ID.
Definition Detector.cxx:176
Bool_t ProcessHits(FairVolume *v=nullptr) final
Processing hit creation in the FOCAL sensitive volume.
Definition Detector.cxx:108
void EndOfEvent() final
Steps to be carried out at the end of the event.
Definition Detector.cxx:195
void BeginPrimary() override
Begin primaray.
void CreateECALGeometry()
Generate ECAL geometry.
Detector()=default
Dummy constructor.
Parent * AddSuperparent(int trackID, int pdg, double energy)
Add new superparent to the container.
Definition Detector.cxx:188
void Reset() final
Clean point collection.
Definition Detector.cxx:202
Geometry * getGeometry(std::string name="")
Get the FOCAL geometry desciption.
Definition Detector.cxx:70
friend class o2::base::DetImpl
Definition Detector.h:222
Common FOCAL hit class for the detector simulation.
Definition Hit.h:28
const GLdouble * v
Definition glcorearb.h:832
GLuint const GLchar * name
Definition glcorearb.h:781
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
Information about superparent (particle entering any FOCAL volume)
Definition Detector.h:33
double mEnergy
Total energy.
Definition Detector.h:35
bool mHasTrackReference
Flag indicating whether parent has a track reference.
Definition Detector.h:36
int mPDG
PDG code.
Definition Detector.h:34
std::vector< int > row