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 "Rtypes.h" // for Int_t, Double_t, Float_t, Bool_t, etc
19
20#include "DetectorsBase/Detector.h" // for Detector
21#include "DetectorsBase/GeometryManager.h" // for getSensID
22#include "DetectorsCommonDataFormats/DetID.h" // for Detector
23#include "ITSMFTSimulation/Hit.h" // for Hit
24
25#include "TArrayD.h" // for TArrayD
26#include "TGeoManager.h" // for gGeoManager, TGeoManager (ptr only)
27#include "TLorentzVector.h" // for TLorentzVector
28#include "TVector3.h" // for TVector3
29
30#include <unordered_map>
31#include <vector>
32
33class FairVolume;
34class TGeoVolume;
35
36class TParticle;
37
38class TString;
39
40namespace o2::ft3
41{
42class GeometryTGeo;
43class FT3BaseParam;
44class FT3Layer;
45
46class Detector : public o2::base::DetImpl<Detector>
47{
48 public:
53
55 Detector();
56
58 ~Detector() override;
59
61 void InitializeO2Detector() override;
62
64 Bool_t ProcessHits(FairVolume* v = nullptr) override;
65
67 void Register() override;
68
70 std::vector<o2::itsmft::Hit>* getHits(Int_t iColl) const
71 {
72 if (iColl == 0) {
73 return mHits;
74 }
75 return nullptr;
76 }
77
79 void Reset() override;
80
82 void ConstructGeometry() override;
83
85 o2::itsmft::Hit* addHit(int trackID, int detID, const TVector3& startPos, const TVector3& endPos,
86 const TVector3& startMom, double startE, double endTime, double eLoss,
87 unsigned char startStatus, unsigned char endStatus);
88
89 Int_t chipVolUID(Int_t id) const { return o2::base::GeometryManager::getSensID(o2::detectors::DetID::FT3, id); }
90
91 void EndOfEvent() override;
92
93 void FinishPrimary() override { ; }
94 virtual void finishRun() { ; }
95 void BeginPrimary() override { ; }
96 void PostTrack() override { ; }
97 void PreTrack() override { ; }
98
99 static constexpr int IdxForwardDisks = 0;
100 static constexpr int IdxBackwardDisks = 1;
102 size_t getNumberOfLayers() const
103 {
105 LOG(fatal) << "Number of layers in the two directions are different! Returning 0.";
106 }
107 return mLayerName[IdxBackwardDisks].size();
108 }
109
110 void buildBasicFT3(const FT3BaseParam& param);
111 void buildFT3V1();
112 void buildFT3V3b();
113 void buildFT3Scoping();
115 void buildFT3ScopingV3();
116
117 protected:
118 std::array<std::vector<TString>, 2> mLayerName; // Two sets of layer names, one per direction (forward/backward)
119 std::unordered_map<int, int> mActiveSensorMap;
120
121 private:
123 struct TrackData { // this is transient
124 bool mHitStarted;
125 unsigned char mTrkStatusStart;
126 TLorentzVector mPositionStart;
127 TLorentzVector mMomentumStart;
128 double mEnergyLoss;
129 } mTrackData;
130
132 std::vector<o2::itsmft::Hit>* mHits;
133
135 virtual void createMaterials();
136
138 void createGeometry();
139
141 void defineSensitiveVolumes();
142
143 Detector(const Detector&);
144
145 Detector& operator=(const Detector&);
146
147 std::array<std::vector<FT3Layer>, 2> mLayers; // Two sets of layers, one per direction (forward/backward)
148 bool mIsPipeActivated = true;
149
150 template <typename Det>
151 friend class o2::base::DetImpl;
152 ClassDefOverride(Detector, 2);
153};
154
155} // namespace o2::ft3
156
157#ifdef USESHM
158namespace o2
159{
160namespace base
161{
162template <>
163struct UseShm<o2::ft3::Detector> {
164 static constexpr bool value = true;
165};
166} // namespace base
167} // namespace o2
168#endif
169
170#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)
std::array< std::vector< TString >, 2 > mLayerName
Definition Detector.h:118
void buildFT3ScopingV3()
Definition Detector.cxx:253
std::unordered_map< int, int > mActiveSensorMap
Definition Detector.h:119
~Detector() override
Default destructor.
Definition Detector.cxx:370
void InitializeO2Detector() override
Initialization of the detector is done here.
Definition Detector.cxx:409
static constexpr int IdxBackwardDisks
Definition Detector.h:100
void BeginPrimary() override
Definition Detector.h:95
void EndOfEvent() override
Definition Detector.cxx:530
static constexpr int IdxForwardDisks
Definition Detector.h:99
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:675
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:533
std::vector< o2::itsmft::Hit > * getHits(Int_t iColl) const
Gets the produced collections.
Definition Detector.h:70
void ConstructGeometry() override
Base class to create the detector geometry.
Definition Detector.cxx:553
size_t getNumberOfLayers() const
Returns the number of layers.
Definition Detector.h:102
Detector()
Default constructor.
Definition Detector.cxx:57
Bool_t ProcessHits(FairVolume *v=nullptr) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
Definition Detector.cxx:418
void PreTrack() override
Definition Detector.h:97
void buildBasicFT3(const FT3BaseParam &param)
Definition Detector.cxx:65
Detector(Bool_t active)
Int_t chipVolUID(Int_t id) const
Definition Detector.h:89
void buildFT3NewVacuumVessel()
Definition Detector.cxx:188
void FinishPrimary() override
Definition Detector.h:93
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:545
void PostTrack() override
Definition Detector.h:96
virtual void finishRun()
Definition Detector.h:94
GLsizeiptr size
Definition glcorearb.h:659
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 ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"