62#include "TRestGeant4ToDetectorHitsProcess.h"
100 SetTitle(
"Default config");
102 cout <<
"G4 to hits metadata not found. Loading default values" << endl;
143 }
else if (
GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Warning)
144 cout <<
"TRestGeant4ToDetectorHitsProcess. volume name : " <<
fVolumeSelection[n]
145 <<
" not found and will not be added." << endl;
151 RESTDebug <<
"Active volumes available in TRestGeant4Metadata" <<
RESTendl;
152 RESTDebug <<
"-------------------------------------------" <<
RESTendl;
158 RESTDebug <<
"TRestGeant4HitsProcess volumes enabled in RML : ";
159 RESTDebug <<
"-------------------------------------------" <<
RESTendl;
171 RESTWarning <<
"TRestGeant4ToDetectorHitsProcess. Not all volumes were properly identified!"
175 RESTDebug <<
"TRestGeant4HitsProcess volumes identified : ";
176 RESTDebug <<
"---------------------------------------" <<
RESTendl;
195 cout <<
"------ TRestGeant4ToDetectorHitsProcess --- Printing Input Event --- START ----" << endl;
197 cout <<
"------ TRestGeant4ToDetectorHitsProcess --- Printing Input Event ---- END ----" << endl;
209 for (
unsigned int i = 0; i <
fG4Event->GetNumberOfTracks(); i++) {
210 const auto& track =
fG4Event->GetTrack(i);
211 const auto& hits = track.GetHits();
212 for (
unsigned int j = 0; j < track.GetNumberOfHits(); j++) {
213 const auto energy = hits.GetEnergy(j);
215 if (hits.GetVolumeId(j) == volumeID && energy > 0) {
226 cout <<
"TRestGeant4ToDetectorHitsProcess. Hits added : " <<
fHitsEvent->GetNumberOfHits() << endl;
227 cout <<
"TRestGeant4ToDetectorHitsProcess. Hits total energy : " <<
fHitsEvent->GetEnergy() << endl;
239 string addVolumeDefinition;
241 while ((addVolumeDefinition =
GetKEYDefinition(
"addVolume", position)) !=
"")
void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t=0, REST_HitType type=XYZ)
Adds a new hit to this event.
void BeginPrintProcess()
[name, cut range]
A base class for any REST event.
An event class to store geant4 generated event information.
A process to transform a TRestGeant4Event into a TRestDetectorHitsEvent.
TRestGeant4Metadata * fG4Metadata
A pointer to the Geant4 simulation conditions stored in TRestGeant4Metadata.
void Initialize() override
Function to initialize input/output event members and define the section name.
std::vector< TString > fVolumeSelection
The geometry volume names to be transferred to TRestDetectorHitsEvent.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
TRestDetectorHitsEvent * fHitsEvent
A pointer to the output TRestDetectorHitsEvent.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
TRestGeant4ToDetectorHitsProcess()
Default constructor.
void InitProcess() override
Process initialization. This process accesses the information inside TRestGeant4Metadata to identify ...
TRestGeant4Event * fG4Event
A pointer to the input TRestGeant4Event.
void InitFromConfigFile() override
Function to read input parameters from the RML TRestGeant4ToDetectorHitsProcess metadata section.
~TRestGeant4ToDetectorHitsProcess()
Default destructor.
void PrintMetadata() override
It prints on screen relevant data members from this class.
std::vector< Int_t > fVolumeId
The volume ids from the volumes selected for transfer to TRestDetectorHitsEvent.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
@ REST_Extreme
show everything
@ REST_Debug
+show the defined debug messages
Int_t GetChar(std::string hint="Press a KEY to continue ...")
Helps to pause the program, printing a message before pausing.