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
17
18#ifndef ALICEO2_FV0_DETECTOR_H_
19#define ALICEO2_FV0_DETECTOR_H_
20
21#include <TLorentzVector.h>
22
23#include "DataFormatsFV0/Hit.h"
25#include "FV0Base/Geometry.h"
27
28class FairModule;
29class FairVolume;
30class TGeoVolume;
31class TGraph;
32
33namespace o2
34{
35namespace fv0
36{
37class Detector : public o2::base::DetImpl<Detector>
38{
39 public:
41 Detector();
42
44 ~Detector() override;
45
49 explicit Detector(Bool_t isActive);
50
52 void InitializeO2Detector() override;
53 bool isMTSafe() const override { return true; }
54
56 Bool_t ProcessHits(FairVolume* v = nullptr) override;
57
58 // ------------------------------------------------------------------
59
61 void Register() override;
62
64 std::vector<o2::fv0::Hit>* getHits(Int_t iColl)
65 {
66 if (iColl == 0) {
67 return mHits;
68 }
69 return nullptr;
70 }
71
73 void Reset() override;
74
76 void EndOfEvent() override;
77
79 void createMaterials();
80
82 void ConstructGeometry() override; // inherited from FairModule
83
104
106 void addAlignableVolumes() const override;
107
108 private:
110 std::vector<o2::fv0::Hit>* mHits = nullptr;
111 int mTrackRefLastTrackID = -1;
112
114 Geometry* mGeometry = nullptr;
115
117 struct TrackData { // this is transient
118 bool mHitStarted;
119 TLorentzVector mPositionStart;
120 TLorentzVector mMomentumStart;
121 double mEnergyLoss;
122 } mTrackData;
123
124 o2::fv0::Hit* addHit(Int_t trackId, Int_t cellId,
125 const math_utils::Point3D<float>& startPos, const math_utils::Point3D<float>& endPos,
126 const math_utils::Vector3D<float>& startMom, double startE,
127 double endTime, double eLoss, Int_t particlePdg);
128
129 template <typename Det>
130 friend class o2::base::DetImpl;
131 ClassDefOverride(Detector, 1);
132};
133
134// Input and output function for standard C++ input/output.
135std::ostream& operator<<(std::ostream& os, Detector& source);
136std::istream& operator>>(std::istream& os, Detector& source);
137} // namespace fv0
138} // namespace o2
139
140#ifdef USESHM
141namespace o2
142{
143namespace base
144{
145template <>
146struct UseShm<o2::fv0::Detector> {
147 static constexpr bool value = true;
148};
149} // namespace base
150} // namespace o2
151#endif
152
153#endif
Definition of the Detector class.
Definition of the FV0 Hit class (based on ITSMFT)
Base definition of FV0 geometry.
~Detector() override
Default destructor.
Definition Detector.cxx:43
void InitializeO2Detector() override
Initializes the detector (adds sensitive volume)
Definition Detector.cxx:59
void createMaterials()
Registers new materials in o2::base::Detector.
Definition Detector.cxx:165
void EndOfEvent() override
Called at the end of event.
Definition Detector.cxx:160
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:141
Bool_t ProcessHits(FairVolume *v=nullptr) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
Definition Detector.cxx:76
void ConstructGeometry() override
Creates materials and geometry.
Definition Detector.cxx:275
void addAlignableVolumes() const override
Add alignable volumes.
Definition Detector.cxx:289
Detector()
Default constructor.
Definition Detector.cxx:34
bool isMTSafe() const override
whether this detector may run in multithreaded Geant4, with one clone per worker thread
Definition Detector.h:53
std::vector< o2::fv0::Hit > * getHits(Int_t iColl)
Gets the produced hits.
Definition Detector.h:64
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:152
FV0 Geometry.
Definition Geometry.h:51
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)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...