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 buildFT3ScopingV3();
120 void buildFT3FromFile(std::string);
121
123
124 void exportLayout();
125
126 protected:
127 std::vector<Int_t> mLayerID;
128 std::vector<std::vector<TString>> mLayerName;
130
131 private:
133 struct TrackData { // this is transient
134 bool mHitStarted;
135 unsigned char mTrkStatusStart;
136 TLorentzVector mPositionStart;
137 TLorentzVector mMomentumStart;
138 double mEnergyLoss;
139 } mTrackData;
140
142 std::vector<o2::itsmft::Hit>* mHits;
143
145 virtual void createMaterials();
146
148 void createGeometry();
149
151 void defineSensitiveVolumes();
152
153 Detector(const Detector&);
154
155 Detector& operator=(const Detector&);
156
157 std::vector<std::vector<FT3Layer>> mLayers;
158 bool mIsPipeActivated = true;
159
160 template <typename Det>
161 friend class o2::base::DetImpl;
162 ClassDefOverride(Detector, 1);
163};
164
165} // namespace ft3
166} // namespace o2
167
168#ifdef USESHM
169namespace o2
170{
171namespace base
172{
173template <>
174struct UseShm<o2::ft3::Detector> {
175 static constexpr bool value = true;
176};
177} // namespace base
178} // namespace o2
179#endif
180
181#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)
void buildFT3ScopingV3()
Definition Detector.cxx:350
~Detector() override
Default destructor.
Definition Detector.cxx:501
GeometryTGeo * mGeometryTGeo
Definition Detector.h:122
std::vector< std::vector< TString > > mLayerName
Definition Detector.h:128
void InitializeO2Detector() override
Initialization of the detector is done here.
Definition Detector.cxx:541
void BeginPrimary() override
Definition Detector.h:107
void EndOfEvent() override
Definition Detector.cxx:660
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:826
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:663
void buildFT3FromFile(std::string)
Definition Detector.cxx:63
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:683
Detector()
Default constructor.
Definition Detector.cxx:55
Bool_t ProcessHits(FairVolume *v=nullptr) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
Definition Detector.cxx:552
std::vector< Int_t > mLayerID
Definition Detector.h:127
void PreTrack() override
Definition Detector.h:109
void buildBasicFT3(const FT3BaseParam &param)
Definition Detector.cxx:154
Detector(Bool_t active)
Int_t chipVolUID(Int_t id) const
Definition Detector.h:101
void buildFT3NewVacuumVessel()
Definition Detector.cxx:283
void FinishPrimary() override
Definition Detector.h:105
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:675
void PostTrack() override
Definition Detector.h:108
void exportLayout()
access to geometry details
Definition Detector.cxx:130
Int_t mNumberOfLayers
Definition Detector.h:129
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 ...