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 bool isMTSafe() const override { return true; }
66
68 Bool_t ProcessHits(FairVolume* v = nullptr) override;
69
71 void Reset() override;
72
74 void Register() override;
75
77 std::vector<o2::itsmft::Hit>* getHits(Int_t iColl) const
78 {
79 if (iColl == 0) {
80 return mHits;
81 }
82 return nullptr;
83 }
84
85 void EndOfEvent() override;
86
87 void FinishPrimary() override { ; }
88 void FinishRun() override { ; }
89 void BeginPrimary() override { ; }
90 void PostTrack() override { ; }
91 void PreTrack() override { ; }
92 void ConstructGeometry() override; // inherited from FairModule
93
95 void addAlignableVolumes() const override;
96
101 void addAlignableVolumesHalf(Int_t hf, TString& parent, Int_t& lastUID) const;
102
108 void addAlignableVolumesDisk(Int_t hf, Int_t dk, TString& parent, Int_t& lastUID) const;
109
116 void addAlignableVolumesLadder(Int_t hf, Int_t dk, Int_t lr, TString& parent, Int_t& lastUID) const;
117
125 void addAlignableVolumesChip(Int_t hf, Int_t dk, Int_t lr, Int_t ms, TString& parent, Int_t& lastUID) const;
126
127 Int_t isVersion() const { return mVersion; }
129
130 void createMaterials();
131 void setDensitySupportOverSi(Double_t density)
132 {
133 if (density > 1e-6) {
134 mDensitySupportOverSi = density;
135 } else {
137 }
138 }
139
140 void createGeometry();
142
144
145 protected:
146 Int_t mVersion; //
148
149 private:
151 std::vector<o2::itsmft::Hit>* mHits;
152 int mTrackRefLastTrackID = -1;
153
154 Detector(const Detector&);
155 Detector& operator=(const Detector&);
156
157 o2::itsmft::Hit* addHit(int trackID, int detID, TVector3 startPos, TVector3 endPos, TVector3 startMom, double startE,
158 double endTime, double eLoss, unsigned char startStatus, unsigned char endStatus);
159
161 struct TrackData { // this is transient
162 bool mHitStarted;
163 unsigned char mTrkStatusStart;
164 TLorentzVector mPositionStart;
165 TLorentzVector mMomentumStart;
166 double mEnergyLoss;
167 } mTrackData;
168
169 template <typename Det>
170 friend class o2::base::DetImpl;
171 ClassDefOverride(Detector, 1);
172};
173
174// Input and output function for standard C++ input/output.
175std::ostream& operator<<(std::ostream& os, Detector& source);
176std::istream& operator>>(std::istream& os, Detector& source);
177} // namespace mft
178} // namespace o2
179
180#ifdef USESHM
181namespace o2
182{
183namespace base
184{
185template <>
186struct UseShm<o2::mft::Detector> {
187 static constexpr bool value = true;
188};
189} // namespace base
190} // namespace o2
191#endif
192
193#endif
Definition of the Detector class.
Definition of the ITSMFT Hit class.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
void PreTrack() override
Definition Detector.h:91
void setDensitySupportOverSi(Double_t density)
Definition Detector.h:131
~Detector() override
Default destructor.
Definition Detector.cxx:77
void PostTrack() override
Definition Detector.h:90
void InitializeO2Detector() override
Initialization of the detector is done here.
Definition Detector.cxx:87
Int_t isVersion() const
Definition Detector.h:127
void createMaterials()
Creating materials for the detector.
Definition Detector.cxx:213
GeometryTGeo * mGeometryTGeo
Definition Detector.h:143
bool isMTSafe() const override
whether this detector may run in multithreaded Geant4, with one clone per worker thread
Definition Detector.h:65
void addAlignableVolumesLadder(Int_t hf, Int_t dk, Int_t lr, TString &parent, Int_t &lastUID) const
Definition Detector.cxx:695
void EndOfEvent() override
Definition Detector.cxx:733
void BeginPrimary() override
Definition Detector.h:89
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:736
void FinishPrimary() override
Definition Detector.h:87
std::vector< o2::itsmft::Hit > * getHits(Int_t iColl) const
Gets the produced hits.
Definition Detector.h:77
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:602
void addAlignableVolumes() const override
Add alignable top volumes.
Definition Detector.cxx:624
Detector()
Default constructor.
Definition Detector.cxx:43
void defineSensitiveVolumes()
Definition Detector.cxx:610
void addAlignableVolumesChip(Int_t hf, Int_t dk, Int_t lr, Int_t ms, TString &parent, Int_t &lastUID) const
Definition Detector.cxx:716
void FinishRun() override
Definition Detector.h:88
Double_t mDensitySupportOverSi
Definition Detector.h:147
Int_t mVersion
access to geometry details
Definition Detector.h:146
void addAlignableVolumesDisk(Int_t hf, Int_t dk, TString &parent, Int_t &lastUID) const
Definition Detector.cxx:671
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:749
void addAlignableVolumesHalf(Int_t hf, TString &parent, Int_t &lastUID) const
Definition Detector.cxx:652
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 ...