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
16
17#ifndef ALICEO2_MFT_DETECTOR_H
18#define ALICEO2_MFT_DETECTOR_H
19
20#include "TLorentzVector.h"
21
22#include <vector> // for vector
24#include "DetectorsCommonDataFormats/DetID.h" // for Detector
25#include "ITSMFTSimulation/Hit.h" // for Hit
26
27class TVector3;
28
29namespace o2
30{
31namespace itsmft
32{
33class Hit;
34}
35} // namespace o2
36
37namespace o2
38{
39namespace mft
40{
41class GeometryTGeo;
42}
43} // namespace o2
44
45namespace o2
46{
47namespace mft
48{
49class Detector : public o2::base::DetImpl<Detector>
50{
51 public:
55 Detector(Bool_t active);
56
58 Detector();
59
61 ~Detector() override;
62
64 void InitializeO2Detector() override;
65
67 Bool_t ProcessHits(FairVolume* v = nullptr) override;
68
70 void Reset() override;
71
73 void Register() override;
74
76 std::vector<o2::itsmft::Hit>* getHits(Int_t iColl) const
77 {
78 if (iColl == 0) {
79 return mHits;
80 }
81 return nullptr;
82 }
83
84 void EndOfEvent() override;
85
86 void FinishPrimary() override { ; }
87 void FinishRun() override { ; }
88 void BeginPrimary() override { ; }
89 void PostTrack() override { ; }
90 void PreTrack() override { ; }
91 void ConstructGeometry() override; // inherited from FairModule
92
94 void addAlignableVolumes() const override;
95
100 void addAlignableVolumesHalf(Int_t hf, TString& parent, Int_t& lastUID) const;
101
107 void addAlignableVolumesDisk(Int_t hf, Int_t dk, TString& parent, Int_t& lastUID) const;
108
115 void addAlignableVolumesLadder(Int_t hf, Int_t dk, Int_t lr, TString& parent, Int_t& lastUID) const;
116
124 void addAlignableVolumesChip(Int_t hf, Int_t dk, Int_t lr, Int_t ms, TString& parent, Int_t& lastUID) const;
125
126 Int_t isVersion() const { return mVersion; }
128
129 void createMaterials();
130 void setDensitySupportOverSi(Double_t density)
131 {
132 if (density > 1e-6) {
133 mDensitySupportOverSi = density;
134 } else {
136 }
137 }
138
139 void createGeometry();
141
143
144 protected:
145 Int_t mVersion; //
147
148 private:
150 std::vector<o2::itsmft::Hit>* mHits;
151
152 Detector(const Detector&);
153 Detector& operator=(const Detector&);
154
155 o2::itsmft::Hit* addHit(int trackID, int detID, TVector3 startPos, TVector3 endPos, TVector3 startMom, double startE,
156 double endTime, double eLoss, unsigned char startStatus, unsigned char endStatus);
157
159 struct TrackData { // this is transient
160 bool mHitStarted;
161 unsigned char mTrkStatusStart;
162 TLorentzVector mPositionStart;
163 TLorentzVector mMomentumStart;
164 double mEnergyLoss;
165 } mTrackData;
166
167 template <typename Det>
168 friend class o2::base::DetImpl;
169 ClassDefOverride(Detector, 1);
170};
171
172// Input and output function for standard C++ input/output.
173std::ostream& operator<<(std::ostream& os, Detector& source);
174std::istream& operator>>(std::istream& os, Detector& source);
175} // namespace mft
176} // namespace o2
177
178#ifdef USESHM
179namespace o2
180{
181namespace base
182{
183template <>
184struct UseShm<o2::mft::Detector> {
185 static constexpr bool value = true;
186};
187} // namespace base
188} // namespace o2
189#endif
190
191#endif
Definition of the Detector class.
Definition of the ITSMFT Hit class.
void PreTrack() override
Definition Detector.h:90
void setDensitySupportOverSi(Double_t density)
Definition Detector.h:130
~Detector() override
Default destructor.
Definition Detector.cxx:77
void PostTrack() override
Definition Detector.h:89
void InitializeO2Detector() override
Initialization of the detector is done here.
Definition Detector.cxx:87
Int_t isVersion() const
Definition Detector.h:126
void createMaterials()
Creating materials for the detector.
Definition Detector.cxx:206
GeometryTGeo * mGeometryTGeo
Definition Detector.h:142
void addAlignableVolumesLadder(Int_t hf, Int_t dk, Int_t lr, TString &parent, Int_t &lastUID) const
Definition Detector.cxx:688
void EndOfEvent() override
Definition Detector.cxx:726
void BeginPrimary() override
Definition Detector.h:88
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:729
void FinishPrimary() override
Definition Detector.h:86
std::vector< o2::itsmft::Hit > * getHits(Int_t iColl) const
Gets the produced hits.
Definition Detector.h:76
Bool_t ProcessHits(FairVolume *v=nullptr) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
Definition Detector.cxx:95
void ConstructGeometry() override
Definition Detector.cxx:595
void addAlignableVolumes() const override
Add alignable top volumes.
Definition Detector.cxx:617
Detector()
Default constructor.
Definition Detector.cxx:43
void defineSensitiveVolumes()
Definition Detector.cxx:603
void addAlignableVolumesChip(Int_t hf, Int_t dk, Int_t lr, Int_t ms, TString &parent, Int_t &lastUID) const
Definition Detector.cxx:709
void FinishRun() override
Definition Detector.h:87
Double_t mDensitySupportOverSi
Definition Detector.h:146
Int_t mVersion
access to geometry details
Definition Detector.h:145
void addAlignableVolumesDisk(Int_t hf, Int_t dk, TString &parent, Int_t &lastUID) const
Definition Detector.cxx:664
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:742
void addAlignableVolumesHalf(Int_t hf, TString &parent, Int_t &lastUID) const
Definition Detector.cxx:645
const GLdouble * v
Definition glcorearb.h:832
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLsizei const GLfloat * value
Definition glcorearb.h:819
std::ostream & operator<<(std::ostream &os, Detector &source)
std::istream & operator>>(std::istream &os, Detector &source)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...