Skip to content

Commit

Permalink
Adding new class TRestTrackAlphaAnalysisProcess for the analysis of a…
Browse files Browse the repository at this point in the history
…lpha tracks
  • Loading branch information
juanangp committed Jan 27, 2022
1 parent e8852fe commit 2123773
Show file tree
Hide file tree
Showing 4 changed files with 824 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ file(GLOB_RECURSE addon_src
set(addon_inc ${CMAKE_CURRENT_SOURCE_DIR}/tsp/inc)

COMPILELIB("")

file(GLOB_RECURSE MAC "${CMAKE_CURRENT_SOURCE_DIR}/macros/*")
INSTALL(FILES ${MAC} DESTINATION ./macros/track)

82 changes: 82 additions & 0 deletions inc/TRestTrackAlphaAnalysisProcess.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
///______________________________________________________________________________
///______________________________________________________________________________
///______________________________________________________________________________
///
///
/// RESTSoft : Software for Rare Event Searches with TPCs
///
/// TRestTrackAlphaAnalysisProcess.h
///
///_______________________________________________________________________________

#ifndef RestCore_TRestTrackAlphaAnalysisProcess
#define RestCore_TRestTrackAlphaAnalysisProcess

#include <TRestTrackEvent.h>

#include "TRestEventProcess.h"

class alphaTrackHit{
public:
double xy;
double z;
double en;

static bool sortByTime (const alphaTrackHit &h1, const alphaTrackHit &h2 ){
return h1.z > h2.z;
}

static bool sortByPos (const alphaTrackHit &h1, const alphaTrackHit &h2 ){
return h1.xy > h2.xy;
}
};

class TRestTrackAlphaAnalysisProcess : public TRestEventProcess {
private:
#ifndef __CINT__
TRestTrackEvent* fTrackEvent;
TRestTrackEvent* fOutTrackEvent;
#endif

void InitFromConfigFile();

void Initialize();

void LoadDefaultConfig();

protected:
// add here the members of your event process

std::vector<alphaTrackHit> smoothTrack(std::vector <alphaTrackHit> &hits);
Double_t fTrackBalance = 0.65; //Max track energy is used to define the minimun energy fTrackBalance*fTotEnergy of the total energy to assume a single track event, if the condition is not fulfill the event is rejected

public:
any GetInputEvent() { return fTrackEvent; }
any GetOutputEvent() { return fOutTrackEvent; }

void InitProcess();
TRestEvent* ProcessEvent(TRestEvent* eventInput);
void EndProcess();

void LoadConfig(std::string cfgFilename);

void PrintMetadata() {
BeginPrintProcess();
metadata<<"Track Balance: "<<fTrackBalance<<endl;
EndPrintProcess();
}

TString GetProcessName() { return (TString) "alphaTrackAna"; }
// Double_t GetCalibFactor(); ///< Calibration factor is
// found.

// Constructor
TRestTrackAlphaAnalysisProcess();
TRestTrackAlphaAnalysisProcess(char* cfgFileName);
// Destructor
~TRestTrackAlphaAnalysisProcess();

ClassDef(TRestTrackAlphaAnalysisProcess, 1);
// Template for a REST "event process" class inherited from TRestEventProcess
};
#endif
Loading

0 comments on commit 2123773

Please sign in to comment.