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_FCT_DETECTOR_H_
16#define ALICEO2_FCT_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 fct
40{
41class GeometryTGeo;
42}
43} // namespace o2
44namespace o2
45{
46namespace fct
47{
48class FCTLayer;
49}
50} // namespace o2
51
52namespace o2
53{
54namespace fct
55{
56class FCTLayer;
57
58class Detector : public o2::base::DetImpl<Detector>
59{
60 public:
64 Detector(Bool_t active);
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::FCT, 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 buildBasicFCT(const FCTBaseParam& param);
115 void buildFCTV1();
116 void buildFCTFromFile(std::string);
117
119
120 void exportLayout();
121
122 private:
123 std::vector<Int_t> mLayerID;
124 std::vector<Int_t> mConverterLayerId;
125 std::vector<TString> mLayerName;
126 std::vector<TString> mConverterLayerName;
127 Int_t mNumberOfLayers;
128 Int_t mNumberOfConverterLayers;
129
131 struct TrackData { // this is transient
132 bool mHitStarted;
133 unsigned char mTrkStatusStart;
134 TLorentzVector mPositionStart;
135 TLorentzVector mMomentumStart;
136 double mEnergyLoss;
137 } mTrackData;
138
140 std::vector<o2::itsmft::Hit>* mHits;
141
143 virtual void createMaterials();
144
146 void createGeometry();
147
149 void defineSensitiveVolumes();
150
151 Detector(const Detector&);
152
153 Detector& operator=(const Detector&);
154
155 std::vector<FCTLayer> mLayers;
156 std::vector<FCTLayer> mConverterLayers;
157 bool mIsPipeActivated = true;
158
159 template <typename Det>
160 friend class o2::base::DetImpl;
161 ClassDefOverride(Detector, 1);
162};
163
164} // namespace fct
165} // namespace o2
166
167#ifdef USESHM
168namespace o2
169{
170namespace base
171{
172template <>
173struct UseShm<o2::fct::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)
Int_t chipVolUID(Int_t id) const
Definition Detector.h:101
~Detector() override
Default destructor.
Definition Detector.cxx:272
void InitializeO2Detector() override
Initialization of the detector is done here.
Definition Detector.cxx:312
void FinishPrimary() override
Definition Detector.h:105
void EndOfEvent() override
Definition Detector.cxx:442
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:569
void PreTrack() override
Definition Detector.h:109
void buildBasicFCT(const FCTBaseParam &param)
Definition Detector.cxx:177
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:445
Bool_t ProcessHits(FairVolume *v=nullptr) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
Definition Detector.cxx:323
void buildFCTFromFile(std::string)
Definition Detector.cxx:61
void BeginPrimary() override
Definition Detector.h:107
void ConstructGeometry() override
Base class to create the detector geometry.
Definition Detector.cxx:465
Detector()
Default constructor.
Definition Detector.cxx:53
virtual void finishRun()
Definition Detector.h:106
GeometryTGeo * mGeometryTGeo
Definition Detector.h:118
void PostTrack() override
Definition Detector.h:108
std::vector< o2::itsmft::Hit > * getHits(Int_t iColl) const
Gets the produced collections.
Definition Detector.h:82
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:457
void exportLayout()
access to geometry details
Definition Detector.cxx:153
Int_t getNumberOfLayers() const
Returns the number of layers.
Definition Detector.h:112
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 ...