R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeuland.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14#ifndef R3BNEULAND_H
15#define R3BNEULAND_H
16
17#include "R3BDetector.h"
18#include "R3BNeulandPoint.h"
19#include "TLorentzVector.h"
20#include <R3BIOConnector.h>
21#include <R3BNeulandCommon.h>
23#include <TClonesArray.h>
24#include <memory>
25#include <string>
26
27class FairVolume;
28class TClonesArray;
30
41
42class R3BNeuland : public FairDetector
43{
44 public:
46 R3BNeuland();
47
52 R3BNeuland(const TString& geoFile, const TGeoTranslation& trans, const TGeoRotation& rot = TGeoRotation());
53
57 explicit R3BNeuland(const TString& geoFile, const TGeoCombiTrans& combi = TGeoCombiTrans());
58
63 R3BNeuland(int nDP, const TGeoTranslation& trans, const TGeoRotation& rot = TGeoRotation());
64
68 explicit R3BNeuland(int nDP, const TGeoCombiTrans& combi = TGeoCombiTrans());
69
78 void EnableAutoGeoBuild(bool is_enabled = true) { is_geo_auto_built = is_enabled; }
79
88 void SetLocationDirection(const TGeoCombiTrans& pos) { rot_trans_ = pos; }
89
90 private:
91 bool is_geo_auto_built = false;
92 bool is_last_hit_done_ = false;
93 int num_of_planes_ = R3B::Neuland::MaxNumberOfPlanes;
94
95 // Track information to be stored until the track leaves the active volume.
96 int fTrackId = 0;
97 int fPaddleId = 0;
98 int particle_id_ = 0;
99 int parent_particle_id_ = 0;
100 double time_ = 0.;
101 double length_ = 0.;
102 double energy_loss_ = 0.;
103 double light_yield_ = 0.;
104 TLorentzVector pos_in_;
105 TLorentzVector pos_out_;
106 TLorentzVector mom_in_;
107 TLorentzVector mom_out_;
108
110 std::unique_ptr<TClonesArray> tca_points_buffer_ = std::make_unique<TClonesArray>(R3BNeulandPoint::Class());
112 R3B::OutputVectorConnector<R3BNeulandPoint> neuland_points_{ "NeulandPoints" };
114 R3BNeulandGeoPar* neuland_geo_par_ = nullptr;
116 R3B::Neuland::Geometry::Creator geo_creator_;
118 TGeoCombiTrans rot_trans_;
120 std::string geo_file_;
123 std::map<int, int> track_pid_map_;
124
125 // private virtual functions:
126
127 auto ProcessHits(FairVolume* /*v*/ = nullptr) -> bool override;
128
129 void EndOfEvent() override;
130
131 void FinishEvent() override;
132
133 void Print(Option_t* /*unused*/ = "") const override;
134
135 void Reset() override;
136
137 auto CheckIfSensitive(std::string name) -> bool override;
138
139 [[nodiscard]] auto GetCollection(int iColl) const -> TClonesArray* override;
140
141 void Register() override;
142
143 // private non-virtual member functions:
144
145 void reset_values();
146
147 void write_parameter_file();
148
149 void ConstructGeometry() override;
150
151 void Initialize() override;
152
153 // non-virtual functions:
154
155 void create_geo();
156
157 void create_geo_from_root_file();
158
159 ClassDefOverride(R3BNeuland, 4);
160};
161
162#endif // R3BNEULAND_H
NeuLAND geometry parameter storage.
auto CheckIfSensitive(std::string name) -> bool override
auto ProcessHits(FairVolume *=nullptr) -> bool override
void EnableAutoGeoBuild(bool is_enabled=true)
Enable the automatic geometry build for NeuLAND.
Definition R3BNeuland.h:78
void SetLocationDirection(const TGeoCombiTrans &pos)
Set the translation and rotation of the NeuLAND detector.
Definition R3BNeuland.h:88
void Register() override
void FinishEvent() override
void EndOfEvent() override
R3BNeuland()
Default constructor.
void ConstructGeometry() override
auto GetCollection(int iColl) const -> TClonesArray *override
void Reset() override
void Print(Option_t *="") const override
void Initialize() override
constexpr auto MaxNumberOfPlanes
OutputConnector< std::vector< ElementType > > OutputVectorConnector