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
55 Bool_t ProcessHits(FairVolume* v = nullptr) override;
56
57 // ------------------------------------------------------------------
58
60 void Register() override;
61
63 std::vector<o2::fv0::Hit>* getHits(Int_t iColl)
64 {
65 if (iColl == 0) {
66 return mHits;
67 }
68 return nullptr;
69 }
70
72 void Reset() override;
73
75 void EndOfEvent() override;
76
78 void createMaterials();
79
81 void ConstructGeometry() override; // inherited from FairModule
82
103
105 void addAlignableVolumes() const override;
106
107 private:
109 std::vector<o2::fv0::Hit>* mHits = nullptr;
110
112 Geometry* mGeometry = nullptr;
113
115 struct TrackData { // this is transient
116 bool mHitStarted;
117 TLorentzVector mPositionStart;
118 TLorentzVector mMomentumStart;
119 double mEnergyLoss;
120 } mTrackData;
121
122 o2::fv0::Hit* addHit(Int_t trackId, Int_t cellId,
123 const math_utils::Point3D<float>& startPos, const math_utils::Point3D<float>& endPos,
124 const math_utils::Vector3D<float>& startMom, double startE,
125 double endTime, double eLoss, Int_t particlePdg);
126
127 template <typename Det>
128 friend class o2::base::DetImpl;
129 ClassDefOverride(Detector, 1);
130};
131
132// Input and output function for standard C++ input/output.
133std::ostream& operator<<(std::ostream& os, Detector& source);
134std::istream& operator>>(std::istream& os, Detector& source);
135} // namespace fv0
136} // namespace o2
137
138#ifdef USESHM
139namespace o2
140{
141namespace base
142{
143template <>
144struct UseShm<o2::fv0::Detector> {
145 static constexpr bool value = true;
146};
147} // namespace base
148} // namespace o2
149#endif
150
151#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:62
void createMaterials()
Registers new materials in o2::base::Detector.
Definition Detector.cxx:160
void EndOfEvent() override
Called at the end of event.
Definition Detector.cxx:155
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:137
Bool_t ProcessHits(FairVolume *v=nullptr) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
Definition Detector.cxx:79
void ConstructGeometry() override
Creates materials and geometry.
Definition Detector.cxx:270
void addAlignableVolumes() const override
Add alignable volumes.
Definition Detector.cxx:283
Detector()
Default constructor.
Definition Detector.cxx:34
std::vector< o2::fv0::Hit > * getHits(Int_t iColl)
Gets the produced hits.
Definition Detector.h:63
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:148
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 ...