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
21class FairVolume;
22
23namespace o2::focal
24{
25
26class Hit;
27class Geometry;
28
32struct Parent {
33 int mPDG;
34 double mEnergy;
36};
37
53class Detector : public o2::base::DetImpl<Detector>
54{
55 public:
59 ID_G10 = 3,
64 ID_PB = 8,
65 ID_SC = 9,
68 ID_VAC = 12,
69 ID_AIR = 13 };
71 Detector() = default;
72
76 Detector(Bool_t isActive, std::string geofilename = "default");
77
79 ~Detector() override;
80
82 void InitializeO2Detector() override;
83
86 Bool_t ProcessHits(FairVolume* v = nullptr) final;
87
100 Hit* AddHit(int trackID, int primary, double initialEnergy, int detID, o2::focal::Hit::Subsystem_t subsystem,
101 const math_utils::Point3D<float>& pos, double time, double energyloss);
102
104 void Register() override;
105
108 std::vector<Hit>* getHits(Int_t iColl) const
109 {
110 if (iColl == 0) {
111 return mHits;
112 }
113 return nullptr;
114 }
115
117 void Reset() final;
118
122 void EndOfEvent() final;
123
128 void BeginPrimary() override;
129
133 void FinishPrimary() override;
134
139 Geometry* getGeometry(std::string name = "");
140
146 Hit* FindHit(int parentID, int col, int row, int layer);
147
148 protected:
150 void CreateMaterials();
151
152 virtual void addAlignableVolumes() const override;
153 void addAlignableVolumesHCAL() const;
154 void addAlignableVolumesECAL() const;
155
156 void ConstructGeometry() override;
157
158 virtual void CreateHCALSpaghetti();
159 virtual void CreateHCALSandwich();
160
162 void CreateECALGeometry();
163
168 Parent* AddSuperparent(int trackID, int pdg, double energy);
169
172 bool ProcessHitsEPad(FairVolume* v = nullptr);
173
176 bool ProcessHitsEPix(FairVolume* v = nullptr);
177
180 bool ProcessHitsHCAL(FairVolume* v = nullptr);
181
182 private:
184 Detector(const Detector& rhs);
185
186 Geometry* mGeometry;
187
188 int mMedSensHCal = 0;
189 int mMedSensECalPad = 0;
190 int mMedSensECalPix = 0;
191
192 std::vector<const Composition*> mGeoCompositions;
193
194 std::vector<o2::focal::Hit>* mHits;
195 std::unordered_map<Hit::HitID, unsigned int, Hit::HitIDHasher> mHitIndexMapping;
196
197 std::unordered_map<int, int> mSuperParentsIndices;
198 std::unordered_map<int, Parent> mSuperParents;
199 Parent* mCurrentSuperparent;
200
201 // Worker variables during hit creation
202 Int_t mCurrentTrack;
203 Int_t mCurrentPrimaryID;
204 Int_t mCurrentParentID;
205
206 std::vector<std::string> mSensitive;
207 int mVolumeIDScintillator = -1;
208
209 template <typename Det>
210 friend class o2::base::DetImpl;
211 ClassDefOverride(Detector, 1);
212};
213} // namespace o2::focal
214
215#ifdef USESHM
216namespace o2
217{
218namespace base
219{
220template <>
221struct UseShm<o2::focal::Detector> {
222 static constexpr bool value = true;
223};
224} // namespace base
225} // namespace o2
226#endif
227
228#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:54
bool ProcessHitsEPad(FairVolume *v=nullptr)
Processing hit creation in the ECAL Pad sensitive volume.
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:108
virtual void CreateHCALSandwich()
Definition Detector.cxx:651
void Register() override
register container with hits
Definition Detector.cxx:197
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:492
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.
Definition Detector.cxx:773
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:210
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:32
double mEnergy
Total energy.
Definition Detector.h:34
bool mHasTrackReference
Flag indicating whether parent has a track reference.
Definition Detector.h:35
int mPDG
PDG code.
Definition Detector.h:33
std::vector< int > row