-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from rest-for-physics/lobis-working-on-veto-r…
…eadout Add class to hold readout metadata info
- Loading branch information
Showing
15 changed files
with
589 additions
and
144 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// Created by lobis on 24-Aug-23. | ||
// | ||
|
||
#ifndef REST_TRESTRAWPEAKSFINDERPROCESS_H | ||
#define REST_TRESTRAWPEAKSFINDERPROCESS_H | ||
|
||
#include <TRestEventProcess.h> | ||
|
||
#include "TRestRawReadoutMetadata.h" | ||
#include "TRestRawSignalEvent.h" | ||
|
||
class TRestRawPeaksFinderProcess : public TRestEventProcess { | ||
private: | ||
TRestRawSignalEvent* fSignalEvent = nullptr; //! | ||
TRestRawReadoutMetadata* fReadoutMetadata = nullptr; //! | ||
|
||
/// \brief threshold over baseline to consider a peak | ||
Double_t fThresholdOverBaseline = 2.0; | ||
/// \brief range of samples to calculate baseline for peak finding | ||
TVector2 fBaselineRange = {0, 10}; | ||
/// \brief distance between two peaks to consider them as different | ||
UShort_t fDistance = 10; | ||
/// \brief window size to calculate the peak amplitude | ||
UShort_t fWindow = 10; | ||
|
||
std::set<std::string> fChannelTypes = {}; // this process will only be applied to selected channel types | ||
|
||
public: | ||
RESTValue GetInputEvent() const override { return fSignalEvent; } | ||
RESTValue GetOutputEvent() const override { return fSignalEvent; } | ||
|
||
void PrintMetadata() override; | ||
|
||
void InitProcess() override; | ||
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override; | ||
void EndProcess() override {} | ||
|
||
const char* GetProcessName() const override { return "peaksFinder"; } | ||
|
||
explicit TRestRawPeaksFinderProcess(const char* configFilename){}; | ||
|
||
void InitFromConfigFile() override; | ||
|
||
TRestRawPeaksFinderProcess() = default; | ||
~TRestRawPeaksFinderProcess() = default; | ||
|
||
ClassDefOverride(TRestRawPeaksFinderProcess, 3); | ||
}; | ||
|
||
#endif // REST_TRESTRAWPEAKSFINDERPROCESS_H |
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,41 @@ | ||
// | ||
// Created by lobis on 24-Aug-23. | ||
// | ||
|
||
#ifndef REST_TRESTRAWREADOUTMETADATA_H | ||
#define REST_TRESTRAWREADOUTMETADATA_H | ||
|
||
#include <TRestMetadata.h> | ||
|
||
class TRestDetectorReadout; | ||
|
||
class TRestRawReadoutMetadata : public TRestMetadata { | ||
public: | ||
struct ChannelInfo { | ||
std::string type; | ||
std::string name; | ||
UShort_t channelId; | ||
// other members | ||
}; | ||
// maps daq id to channel info | ||
std::map<UShort_t, ChannelInfo> fChannelInfo; | ||
|
||
void InitializeFromReadout(TRestDetectorReadout* readout); | ||
|
||
public: | ||
std::string GetTypeForChannelDaqId(UShort_t channel) const; | ||
std::string GetNameForChannelDaqId(UShort_t channel) const; | ||
|
||
Int_t GetChannelIdForChannelDaqId(UShort_t channel) const; | ||
|
||
std::vector<UShort_t> GetChannelDaqIDsForType(const std::string& type) const; | ||
|
||
void PrintMetadata() const; | ||
|
||
TRestRawReadoutMetadata() = default; | ||
~TRestRawReadoutMetadata() = default; | ||
|
||
ClassDef(TRestRawReadoutMetadata, 1) | ||
}; | ||
|
||
#endif // REST_TRESTRAWREADOUTMETADATA_H |
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
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
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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
<globals> | ||
<parameter name="mainDataPath" value="." /> | ||
<parameter name="verboseLevel" value="silent" /> %options are : silent, warning, info, silent | ||
<parameter name="mainDataPath" value="."/> | ||
<parameter name="verboseLevel" value="silent"/> | ||
%options are : silent, warning, info, silent | ||
|
||
<variable name="BL_MIN" value="20" overwrite="false" /> | ||
<variable name="BL_MAX" value="150" overwrite="false" /> | ||
<variable name="BL_MIN" value="20" overwrite="false"/> | ||
<variable name="BL_MAX" value="150" overwrite="false"/> | ||
|
||
<variable name="INT_MIN" value="150" overwrite="false" /> | ||
<variable name="INT_MAX" value="450" overwrite="false" /> | ||
<variable name="INT_MIN" value="150" overwrite="false"/> | ||
<variable name="INT_MAX" value="450" overwrite="false"/> | ||
|
||
<variable name="NPOINTS" value="7" overwrite="false" /> | ||
<variable name="POINT_TH" value="3.5" overwrite="false" /> | ||
<variable name="SGNL_TH" value="3.5" overwrite="false" /> | ||
<variable name="NPOINTS" value="7" overwrite="false"/> | ||
<variable name="POINT_TH" value="3.5" overwrite="false"/> | ||
<variable name="SGNL_TH" value="3.5" overwrite="false"/> | ||
</globals> |
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
Oops, something went wrong.