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
14
15#ifndef ALICEO2_FT3_DETECTOR_H_
16#define ALICEO2_FT3_DETECTOR_H_
17
18#include <vector> // for vector
19#include "DetectorsBase/GeometryManager.h" // for getSensID
20#include "DetectorsBase/Detector.h" // for Detector
21#include "DetectorsCommonDataFormats/DetID.h" // for Detector
22#include "ITSMFTSimulation/Hit.h" // for Hit
23#include "Rtypes.h" // for Int_t, Double_t, Float_t, Bool_t, etc
24#include "TArrayD.h" // for TArrayD
25#include "TGeoManager.h" // for gGeoManager, TGeoManager (ptr only)
26#include "TLorentzVector.h" // for TLorentzVector
27#include "TVector3.h" // for TVector3
29
30class FairVolume;
31class TGeoVolume;
32
33class TParticle;
34
35class TString;
36
37namespace o2
38{
39namespace ft3
40{
41class GeometryTGeo;
42}
43} // namespace o2
44namespace o2
45{
46namespace ft3
47{
48class FT3Layer;
49}
50} // namespace o2
51
52namespace o2
53{
54namespace ft3
55{
56class FT3Layer;
57
58class Detector : public o2::base::DetImpl<Detector>
59{
60 public:
65
67 Detector();
68
70 ~Detector() override;
71
73 void InitializeO2Detector() override;
74
76 Bool_t ProcessHits(FairVolume* v = nullptr) override;
77
79 void Register() override;
80
82 std::vector<o2::itsmft::Hit>* getHits(Int_t iColl) const
83 {
84 if (iColl == 0) {
85 return mHits;
86 }
87 return nullptr;
88 }
89
91 void Reset() override;
92
94 void ConstructGeometry() override;
95
97 o2::itsmft::Hit* addHit(int trackID, int detID, const TVector3& startPos, const TVector3& endPos,
98 const TVector3& startMom, double startE, double endTime, double eLoss,
99 unsigned char startStatus, unsigned char endStatus);
100
101 Int_t chipVolUID(Int_t id) const { return o2::base::GeometryManager::getSensID(o2::detectors::DetID::FT3, id); }
102
103 void EndOfEvent() override;
104
105 void FinishPrimary() override { ; }
106 virtual void finishRun() { ; }
107 void BeginPrimary() override { ; }
108 void PostTrack() override { ; }
109 void PreTrack() override { ; }
110
112 Int_t getNumberOfLayers() const { return mNumberOfLayers; }
113
114 void buildBasicFT3(const FT3BaseParam& param);
115 void buildFT3V1();
116 void buildFT3V3b();
117 void buildFT3Scoping();
119 void buildFT3FromFile(std::string);
120
122
123 void exportLayout();
124
125 protected:
126 std::vector<Int_t> mLayerID;
127 std::vector<std::vector<TString>> mLayerName;
129
130 private:
132 struct TrackData { // this is transient
133 bool mHitStarted;
134 unsigned char mTrkStatusStart;
135 TLorentzVector mPositionStart;
136 TLorentzVector mMomentumStart;
137 double mEnergyLoss;
138 } mTrackData;
139
141 std::vector<o2::itsmft::Hit>* mHits;
142
144 virtual void createMaterials();
145
147 void createGeometry();
148
150 void defineSensitiveVolumes();
151
152 Detector(const Detector&);
153
154 Detector& operator=(const Detector&);
155
156 std::vector<std::vector<FT3Layer>> mLayers;
157 bool mIsPipeActivated = true;
158
159 template <typename Det>
160 friend class o2::base::DetImpl;
161 ClassDefOverride(Detector, 1);
162};
163
164} // namespace ft3
165} // namespace o2
166
167#ifdef USESHM
168namespace o2
169{
170namespace base
171{
172template <>
173struct UseShm<o2::ft3::Detector> {
174 static constexpr bool value = true;
175};
176} // namespace base
177} // namespace o2
178#endif
179
180#endif
Definition of the Detector class.
Definition of the GeometryManager class.
Definition of the ITSMFT Hit class.
static int getSensID(o2::detectors::DetID detid, int sensid)
~Detector() override
Default destructor.
Definition Detector.cxx:444
GeometryTGeo * mGeometryTGeo
Definition Detector.h:121
std::vector< std::vector< TString > > mLayerName
Definition Detector.h:127
void InitializeO2Detector() override
Initialization of the detector is done here.
Definition Detector.cxx:484
void BeginPrimary() override
Definition Detector.h:107
void EndOfEvent() override
Definition Detector.cxx:603
Int_t getNumberOfLayers() const
Returns the number of layers.
Definition Detector.h:112
o2::itsmft::Hit * addHit(int trackID, int detID, const TVector3 &startPos, const TVector3 &endPos, const TVector3 &startMom, double startE, double endTime, double eLoss, unsigned char startStatus, unsigned char endStatus)
This method is an example of how to add your own point of type Hit to the clones array.
Definition Detector.cxx:755
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:606
void buildFT3FromFile(std::string)
Definition Detector.cxx:61
std::vector< o2::itsmft::Hit > * getHits(Int_t iColl) const
Gets the produced collections.
Definition Detector.h:82
void ConstructGeometry() override
Base class to create the detector geometry.
Definition Detector.cxx:626
Detector()
Default constructor.
Definition Detector.cxx:53
Bool_t ProcessHits(FairVolume *v=nullptr) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
Definition Detector.cxx:495
std::vector< Int_t > mLayerID
Definition Detector.h:126
void PreTrack() override
Definition Detector.h:109
void buildBasicFT3(const FT3BaseParam &param)
Definition Detector.cxx:151
Detector(Bool_t active)
Int_t chipVolUID(Int_t id) const
Definition Detector.h:101
void buildFT3NewVacuumVessel()
Definition Detector.cxx:280
void FinishPrimary() override
Definition Detector.h:105
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:618
void PostTrack() override
Definition Detector.h:108
void exportLayout()
access to geometry details
Definition Detector.cxx:128
Int_t mNumberOfLayers
Definition Detector.h:128
virtual void finishRun()
Definition Detector.h:106
const GLdouble * v
Definition glcorearb.h:832
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLenum GLfloat param
Definition glcorearb.h:271
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...