-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new class TRestTrackAlphaAnalysisProcess for the analysis of a…
…lpha tracks
- Loading branch information
Showing
4 changed files
with
824 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.