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
15
16#ifndef ALICEO2_FDD_DETECTOR_H_
17#define ALICEO2_FDD_DETECTOR_H_
18
21#include "DataFormatsFDD/Hit.h"
22#include "FDDBase/Geometry.h"
23#include <TVector3.h>
24
25class FairModule;
26class FairVolume;
27class TGeoVolume;
28
29namespace o2
30{
31namespace fdd
32{
33class Geometry;
34class Hit;
35class Detector : public o2::base::DetImpl<Detector>
36{
37 public:
38 Detector(Bool_t Active);
39
41 Detector() = default;
42
44 ~Detector() override;
45
46 void InitializeO2Detector() override;
47 bool isMTSafe() const override { return true; }
48
49 Bool_t ProcessHits(FairVolume* v = nullptr) override;
50
52 void Register() override;
53
54 o2::fdd::Hit* addHit(int trackID, unsigned short detID, const TVector3& Pos, double Time, double eLoss, int nPhot);
55
56 std::vector<o2::fdd::Hit>* getHits(Int_t iColl)
57 {
58 if (iColl == 0) {
59 return mHits;
60 }
61 return nullptr;
62 }
63
64 void Reset() override;
65 void EndOfEvent() override { Reset(); }
66
67 void CreateMaterials();
68 void ConstructGeometry() override;
69
70 private:
72 Detector(const Detector& rhs);
73
75 std::vector<o2::fdd::Hit>* mHits = nullptr;
76 int mTrackRefLastTrackID = -1;
77
78 // state of the hit being built across steps in ProcessHits
79 Float_t mElossAD = 0.;
80 Int_t mNPhotonsAD = 0;
81 TVector3 mHitPosAD;
82
83 Detector& operator=(const Detector&);
84
85 Geometry* mGeometry = nullptr;
86
87 template <typename Det>
88 friend class o2::base::DetImpl;
89 ClassDefOverride(Detector, 1);
90};
91
92// Input and output function for standard C++ input/output.
93std::ostream& operator<<(std::ostream& os, Detector& source);
94std::istream& operator>>(std::istream& os, Detector& source);
95
96} // namespace fdd
97} // namespace o2
98
99#ifdef USESHM
100namespace o2
101{
102namespace base
103{
104template <>
105struct UseShm<o2::fdd::Detector> {
106 static constexpr bool value = true;
107};
108} // namespace base
109} // namespace o2
110#endif
111#endif
Definition of the Detector class.
Base definition of FIT-FDD geometry.
bool isMTSafe() const override
whether this detector may run in multithreaded Geant4, with one clone per worker thread
Definition Detector.h:47
~Detector() override
Default destructor.
Definition Detector.cxx:74
void InitializeO2Detector() override
Definition Detector.cxx:83
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:361
Bool_t ProcessHits(FairVolume *v=nullptr) override
Definition Detector.cxx:104
void ConstructGeometry() override
Definition Detector.cxx:355
Detector()=default
Default constructor.
std::vector< o2::fdd::Hit > * getHits(Int_t iColl)
Definition Detector.h:56
void EndOfEvent() override
Definition Detector.h:65
void Reset() override
Definition Detector.cxx:373
o2::fdd::Hit * addHit(int trackID, unsigned short detID, const TVector3 &Pos, double Time, double eLoss, int nPhot)
Definition Detector.cxx:179
FIT-FDD Geometry.
Definition Geometry.h:30
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)
struct o2::upgrades_utils::@478 fdd
Collision labels.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...