REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestGeant4QuenchingProcess.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_TRestGeant4QuenchingProcess
24#define RestCore_TRestGeant4QuenchingProcess
25
26#include <TRestEventProcess.h>
27
28#include "TRestGeant4Event.h"
29#include "TRestGeant4Metadata.h"
30
33 private:
36
39
42
43 std::set<std::string> fUserVolumeExpressions;
44 std::set<std::string> fVolumes;
45
46 void Initialize() override;
47 void InitFromConfigFile() override;
48 void LoadDefaultConfig();
49
50 public:
51 std::set<std::string> GetUserVolumeExpressions() const;
52 std::set<std::string> GetVolumes() const;
53
54 RESTValue GetInputEvent() const override { return fInputG4Event; }
55 RESTValue GetOutputEvent() const override { return fOutputG4Event; }
56
57 void InitProcess() override;
58 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
59 void EndProcess() override;
60
61 void LoadConfig(const std::string& configFilename, const std::string& name = "");
62
63 void PrintMetadata() override;
64
67
69 const char* GetProcessName() const override { return "Geant4Quenching"; }
70
72 explicit TRestGeant4QuenchingProcess(const char* configFilename);
74
75 ClassDefOverride(TRestGeant4QuenchingProcess, 2);
76};
77#endif
A base class for any REST event process.
A base class for any REST event.
Definition: TRestEvent.h:38
An event class to store geant4 generated event information.
The main class to store the Geant4 simulation conditions that will be used by restG4.
Recomputes the energy of every hit based on quenching factor for each particle and volume.
TRestGeant4Event * fOutputG4Event
A pointer to the specific TRestGeant4Event output.
const char * GetProcessName() const override
Returns the name of this process.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
TRestGeant4Metadata * fGeant4Metadata
A pointer to the simulation metadata information accessible to TRestRun.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
TRestGeant4Event * fInputG4Event
A pointer to the specific TRestGeant4Event input.
void EndProcess() override
To be executed at the end of the run (outside event loop)
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
TRestGeant4QuenchingProcess()
Default constructor.
TRestEventProcess * Maker()
Returns a new instance of this class.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void Initialize() override
Function to initialize input/output event members and define the section name.
~TRestGeant4QuenchingProcess() override
Default destructor.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
void InitProcess() override
Process initialization. User volume expressions are matched to physical volumes.