remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGVertexFromFile.hh
1// Copyright (C) 2024 Manuel Huber <https://orcid.org/0009-0000-5212-2999>
2// Copyright (C) 2022 Luigi Pertoldi <https://orcid.org/0000-0002-0467-2571>
3//
4// This program is free software: you can redistribute it and/or modify it under
5// the terms of the GNU Lesser General Public License as published by the Free
6// Software Foundation, either version 3 of the License, or (at your option) any
7// later version.
8//
9// This program is distributed in the hope that it will be useful, but WITHOUT
10// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12// details.
13//
14// You should have received a copy of the GNU Lesser General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17#ifndef _RMG_VERTEX_FROM_FILE_HH_
18#define _RMG_VERTEX_FROM_FILE_HH_
19
20#include <memory>
21#include <string>
22
23#include "G4GenericMessenger.hh"
24#include "G4ThreeVector.hh"
25
26#include "RMGAnalysisReader.hh"
27#include "RMGVVertexGenerator.hh"
28
35class RMGVertexFromFile : public RMGVVertexGenerator {
36
37 public:
38
39 RMGVertexFromFile();
40 ~RMGVertexFromFile() = default;
41
42 RMGVertexFromFile(RMGVertexFromFile const&) = delete;
43 RMGVertexFromFile& operator=(RMGVertexFromFile const&) = delete;
44 RMGVertexFromFile(RMGVertexFromFile&&) = delete;
45 RMGVertexFromFile& operator=(RMGVertexFromFile&&) = delete;
46
51 bool GenerateVertex(G4ThreeVector&) override;
52
54 void BeginOfRunAction(const G4Run*) override;
56 void EndOfRunAction(const G4Run*) override;
57
59 void OpenFile(std::string& name);
60
61 private:
62
63 static RMGAnalysisReader* fReader;
64
65 inline static double fXpos = NAN, fYpos = NAN, fZpos = NAN;
66
67 std::unique_ptr<G4GenericMessenger> fMessenger = nullptr;
68 void DefineCommands();
69
70 std::string fNtupleDirectoryName = "vtx";
71};
72
73#endif
74
75// vim: tabstop=2 shiftwidth=2 expandtab
wrapper around G4VAnalysisReader instances with special handling for LH5 files.
Definition RMGAnalysisReader.hh:41
void EndOfRunAction(const G4Run *) override
Close the input file.
Definition RMGVertexFromFile.cc:103
void OpenFile(std::string &name)
Set the path of the input ntuple file.
Definition RMGVertexFromFile.cc:30
bool GenerateVertex(G4ThreeVector &) override
Read the next position row from the file.
Definition RMGVertexFromFile.cc:51
void BeginOfRunAction(const G4Run *) override
Open the input file and bind the position columns.
Definition RMGVertexFromFile.cc:88