REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestGeant4AnalysisProcess.h
1/*************************************************************************
2 * This file is part of the REST software framework. *
3 * *
4 * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5 * For more information see http://gifna.unizar.es/trex *
6 * *
7 * REST is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * REST is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have a copy of the GNU General Public License along with *
18 * REST in $REST_PATH/LICENSE. *
19 * If not, see http://www.gnu.org/licenses/. *
20 * For the list of contributors see $REST_PATH/CREDITS. *
21 *************************************************************************/
22
23#ifndef RestCore_TRestGeant4AnalysisProcess
24#define RestCore_TRestGeant4AnalysisProcess
25
26#include <TRestGeant4Event.h>
27#include <TRestGeant4Metadata.h>
28
29#include "TRestEventProcess.h"
30
33 private:
36
39
42
44 std::vector<std::string> fEnergyInObservables;
45
47 std::vector<Int_t> fVolumeID;
48
49 std::vector<std::string> fVolumeName;
50
52 std::vector<std::string> fMeanPosObservables;
53
55 std::vector<Int_t> fVolumeID2;
56
59 std::vector<std::string> fDirID;
60
62 std::vector<std::string> fProcessObservables;
63
65 std::vector<Int_t> fVolumeID3;
66
68 std::vector<std::string> fProcessName;
69
71 std::vector<std::string> fTrackCounterObservables;
72
74 std::vector<std::string> fParticleTrackCounter;
75
77 std::vector<std::string> fTracksEDepObservables;
78
80 std::vector<std::string> fParticleTrackEdep;
81
82 Bool_t fPerProcessSensitiveEnergy = false;
83 Bool_t fPerProcessSensitiveEnergyNorm = false;
84
85 void Initialize() override;
86
87 void LoadDefaultConfig();
88
89 protected:
90 // add here the members of your event process
91
92 public:
93 RESTValue GetInputEvent() const override { return fInputG4Event; }
94 RESTValue GetOutputEvent() const override { return fOutputG4Event; }
95
96 void InitProcess() override;
97 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
98 void EndProcess() override;
99
100 void LoadConfig(const std::string& configFilename, const std::string& name = "");
101
103 void PrintMetadata() override {
105
106 EndPrintProcess();
107 }
108
111
113 const char* GetProcessName() const override { return "Geant4Analysis"; }
114
116 TRestGeant4AnalysisProcess(const char* configFilename);
118
119 ClassDefOverride(TRestGeant4AnalysisProcess, 3);
120};
121#endif
A base class for any REST event process.
void BeginPrintProcess()
[name, cut range]
A base class for any REST event.
Definition: TRestEvent.h:38
A pure analysis process to extract information from a TRestGeant4Event.
void Initialize() override
Function to initialize input/output event members and define the section name.
std::vector< std::string > fEnergyInObservables
It stores the name of observables xxxVolumeEDep related to the energy deposition in volume xxx.
std::vector< std::string > fDirID
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
void InitProcess() override
Process initialization. Observable names are interpreted and auxiliar observable members,...
TRestGeant4Event * fInputG4Event
A pointer to the specific TRestGeant4Event input.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
TRestGeant4Metadata * fG4Metadata
A pointer to the simulation metadata information accessible to TRestRun.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
~TRestGeant4AnalysisProcess()
Default destructor.
const char * GetProcessName() const override
Returns the name of this process.
std::vector< std::string > fTracksEDepObservables
A std::vector storing the observable name xxxTracksEDep for a given xxx particle.
std::vector< std::string > fParticleTrackCounter
A std::vector storing the xxx particle name extracted from xxxTracksCounter.
std::vector< std::string > fProcessObservables
A std::vector storing the name of observables related to processes in a particular active volume.
std::vector< Int_t > fVolumeID2
A std::vector storing the active volume ids corresponding mean position observable xxxMeanPosX,...
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
TRestEventProcess * Maker()
Returns a new instance of this class.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
std::vector< Int_t > fVolumeID
A std::vector storing the active volume ids of observables xxxVolumeEDep.
TRestGeant4Event * fOutputG4Event
A pointer to the specific TRestGeant4Event output.
std::vector< std::string > fTrackCounterObservables
A std::vector storing the observable name xxxTracksCounter for a given xxx particle.
std::vector< Int_t > fVolumeID3
A std::vector storing the active volume ids corresponding process observable .
TRestGeant4AnalysisProcess()
Default constructor.
std::vector< std::string > fMeanPosObservables
A std::vector storing the name of active volumes.
std::vector< std::string > fProcessName
A std::vector storing the name of processes.
void EndProcess() override
Function to include required actions after all events have been processed.
std::vector< std::string > fParticleTrackEdep
A std::vector storing the xxx particle name extracted from xxxTracksEDep.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
An event class to store geant4 generated event information.
The main class to store the Geant4 simulation conditions that will be used by restG4.