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 <FairDetector.h>
21#include <R3BIOConnector.h>
22#include <R3BNeulandCommon.h>
24#include <Rtypes.h>
25#include <RtypesCore.h>
26#include <TClonesArray.h>
27#include <TGeoMatrix.h>
28#include <TString.h>
29#include <map>
30#include <memory>
31#include <string>
32
33class FairVolume;
34class TClonesArray;
36
47
48class R3BNeuland : public FairDetector
49{
50 public:
52 R3BNeuland();
53
58 R3BNeuland(const TString& geoFile, const TGeoTranslation& trans, const TGeoRotation& rot = TGeoRotation());
59
63 explicit R3BNeuland(const TString& geoFile, const TGeoCombiTrans& combi = TGeoCombiTrans());
64
69 R3BNeuland(int nDP, const TGeoTranslation& trans, const TGeoRotation& rot = TGeoRotation());
70
74 explicit R3BNeuland(int nDP, const TGeoCombiTrans& combi = TGeoCombiTrans());
75
84 void EnableAutoGeoBuild(bool is_enabled = true) { is_geo_auto_built = is_enabled; }
85
94 void SetLocationDirection(const TGeoCombiTrans& pos) { rot_trans_ = pos; }
95
96 private:
97 bool is_geo_auto_built = false;
98 bool is_last_hit_done_ = false;
100
101 // Track information to be stored until the track leaves the active volume.
102 int track_id_ = 0;
103 int paddle_id_ = 0;
104 int particle_id_ = 0;
106 double time_ = 0.;
107 double length_ = 0.;
108 double energy_loss_ = 0.;
109 double light_yield_ = 0.;
110 TLorentzVector pos_in_;
111 TLorentzVector pos_out_;
112 TLorentzVector mom_in_;
113 TLorentzVector mom_out_;
114
116 std::unique_ptr<TClonesArray> tca_points_buffer_ = std::make_unique<TClonesArray>(R3BNeulandPoint::Class());
124 TGeoCombiTrans rot_trans_;
126 std::string geo_file_;
129 std::map<int, int> track_pid_map_;
130
131 // private virtual functions:
132
133 auto ProcessHits(FairVolume* /*v*/ = nullptr) -> bool override;
134
135 void EndOfEvent() override;
136
137 void FinishEvent() override;
138
139 void Print(Option_t* /*unused*/ = "") const override;
140
141 void Reset() override;
142
143 auto CheckIfSensitive(std::string name) -> bool override;
144
145 [[nodiscard]] auto GetCollection(int iColl) const -> TClonesArray* override;
146
147 void Register() override;
148
149 // private non-virtual member functions:
150
151 void reset_values();
152
154
155 void ConstructGeometry() override;
156
157 void Initialize() override;
158
159 // non-virtual functions:
160
161 void create_geo();
162
164
166};
167
168#endif // R3BNEULAND_H
NeuLAND geometry parameter storage.
bool is_last_hit_done_
Flag to check if last hit finished.
Definition R3BNeuland.h:98
auto CheckIfSensitive(std::string name) -> bool override
R3B::OutputVectorConnector< R3BNeulandPoint > neuland_points_
Output data written to the ROOT file.
Definition R3BNeuland.h:118
int track_id_
A buffer for the track IDs.
Definition R3BNeuland.h:102
TGeoCombiTrans rot_trans_
Rotation and tranlation of NeuLAND detector.
Definition R3BNeuland.h:124
TLorentzVector pos_out_
A buffer for the position where the track goes out of the volume.
Definition R3BNeuland.h:111
double energy_loss_
A buffer for the energy losses.
Definition R3BNeuland.h:108
auto ProcessHits(FairVolume *=nullptr) -> bool override
void EnableAutoGeoBuild(bool is_enabled=true)
Enable the automatic geometry build for NeuLAND.
Definition R3BNeuland.h:84
ClassDefOverride(R3BNeuland, 4)
int paddle_id_
A buffer for the paddle ids.
Definition R3BNeuland.h:103
std::string geo_file_
Geometry file name. The file must be present if EnableAutoGeoBuild() is disabled.
Definition R3BNeuland.h:126
void SetLocationDirection(const TGeoCombiTrans &pos)
Set the translation and rotation of the NeuLAND detector.
Definition R3BNeuland.h:94
double time_
A buffer for time values.
Definition R3BNeuland.h:106
void reset_values()
void Register() override
TLorentzVector mom_out_
A buffer for the position when the track goes out of the volume.
Definition R3BNeuland.h:113
void FinishEvent() override
TLorentzVector pos_in_
A buffer for the position where the track goes into the volume.
Definition R3BNeuland.h:110
void EndOfEvent() override
bool is_geo_auto_built
Flag to check if geo-build is needed.
Definition R3BNeuland.h:97
R3B::Neuland::Geometry::Creator geo_creator_
Creating NeuLAND geometry if EnableAutoGeoBuild() is enabled.
Definition R3BNeuland.h:122
void create_geo()
void write_parameter_file()
void create_geo_from_root_file()
int particle_id_
A buffer for the particle IDs.
Definition R3BNeuland.h:104
R3BNeulandGeoPar * neuland_geo_par_
Output parameter containing the geometry information.
Definition R3BNeuland.h:120
int num_of_planes_
The number of planes.
Definition R3BNeuland.h:99
R3BNeuland()
Default constructor.
int parent_particle_id_
A buffer for the parent particle IDs.
Definition R3BNeuland.h:105
std::map< int, int > track_pid_map_
A map with the track ID as the key and the particle ID as the value.
Definition R3BNeuland.h:129
void ConstructGeometry() override
auto GetCollection(int iColl) const -> TClonesArray *override
void Reset() override
void Print(Option_t *="") const override
double length_
A buffer for track lengths.
Definition R3BNeuland.h:107
double light_yield_
A buffer for the light yields.
Definition R3BNeuland.h:109
void Initialize() override
TLorentzVector mom_in_
A buffer for the momentum when the track goes into the volume.
Definition R3BNeuland.h:112
std::unique_ptr< TClonesArray > tca_points_buffer_
The TCA data buffer used to be returned by virtual method GetCollection(int iColl).
Definition R3BNeuland.h:116
constexpr auto MaxNumberOfPlanes
OutputConnector< std::vector< ElementType > > OutputVectorConnector