11 #include "TRestDetectorHitsShuffleProcess.h"
17 TRestDetectorHitsShuffleProcess::TRestDetectorHitsShuffleProcess() { Initialize(); }
19 TRestDetectorHitsShuffleProcess::TRestDetectorHitsShuffleProcess(
const char* configFilename) {
22 if (LoadConfigFromFile(configFilename) == -1) {
27 TRestDetectorHitsShuffleProcess::~TRestDetectorHitsShuffleProcess() {
31 void TRestDetectorHitsShuffleProcess::LoadDefaultConfig() {
32 SetName(
"hitsShuffleProcess");
33 SetTitle(
"Default config");
39 SetSectionName(this->ClassName());
40 SetLibraryVersion(LIBRARY_VERSION);
47 void TRestDetectorHitsShuffleProcess::LoadConfig(
const string& configFilename,
const string& name) {
48 if (LoadConfigFromFile(configFilename, name) == -1) LoadDefaultConfig();
58 Int_t nHits = hits->GetNumberOfHits();
60 for (
int n = 0; n < fIterations; n++) {
61 Int_t hit1 = (Int_t)(nHits * fRandom->Uniform(0, 1));
62 Int_t hit2 = (Int_t)(nHits * fRandom->Uniform(0, 1));
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
void EndProcess() override
To be executed at the end of the run (outside event loop)
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
void Initialize() override
Making default settings.
A base class for any REST event.
It saves a 3-coordinate position and an energy for each punctual deposition.
virtual void SwapHits(Int_t i, Int_t j)
It exchanges hits n and m affecting to the ordering of the hits inside the list of hits.
Double_t StringToDouble(std::string in)
Gets a double from a string.
Int_t StringToInteger(std::string in)
Gets an integer from a string.