Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing generic analysis methods inside detectorlib #75

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions inc/TRestDetectorSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,7 @@ class TRestDetectorSignal {
public:
TGraph* fGraph; //!

std::vector<Int_t> fPointsOverThreshold; //!

void IncreaseAmplitude(TVector2 p);
void SetPoint(TVector2 p);

// TODO other objects should probably skip using GetMaxIndex direclty
Int_t GetMaxIndex(Int_t from = 0, Int_t to = 0);
Int_t GetMaxIndex();

TVector2 GetMaxGauss();
TVector2 GetMaxLandau();
Expand Down Expand Up @@ -87,16 +81,13 @@ class TRestDetectorSignal {

void Normalize(Double_t scale = 1.);

std::vector<Int_t> GetPointsOverThreshold() { return fPointsOverThreshold; }

Double_t GetAverage(Int_t start = 0, Int_t end = 0);
Int_t GetMaxPeakWidth();
Double_t GetMaxPeakWithTime(Double_t startTime, Double_t endTime);

Double_t GetMaxPeakValue();
Double_t GetMinPeakValue();

Double_t GetMaxPeakTime(Int_t from = 0, Int_t to = 0);
Double_t GetMaxPeakTime();

Double_t GetMaxValue() { return GetMaxPeakValue(); }
Double_t GetMinValue() { return GetMinPeakValue(); }
Expand All @@ -112,16 +103,13 @@ class TRestDetectorSignal {
void SetID(Int_t sID) { fSignalID = sID; }

void NewPoint(Float_t time, Float_t data);
void IncreaseAmplitude(const TVector2& p);
void IncreaseAmplitude(Double_t t, Double_t d);

void SetPoint(Double_t t, Double_t d);
void SetPoint(const TVector2& p);
void SetPoint(Int_t index, Double_t t, Double_t d);

Double_t GetStandardDeviation(Int_t startBin, Int_t endBin);
Double_t GetBaseLine(Int_t startBin, Int_t endBin);
Double_t GetBaseLineSigma(Int_t startBin, Int_t endBin, Double_t baseline = 0);

Double_t SubstractBaseline(Int_t startBin, Int_t endBin);
void AddOffset(Double_t offset);

void MultiplySignalBy(Double_t factor);
Expand Down
8 changes: 8 additions & 0 deletions inc/TRestDetectorSignalToHitsProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ class TRestDetectorSignalToHitsProcess : public TRestEventProcess {

void LoadConfig(const std::string& configFilename, const std::string& name = "");

/// Returns the Z coordinate from the hitTime, drifVelocity, fieldZDirection and zPositon (relative to the
/// readout)
inline Double_t GetHitZCoordinate(Double_t hitTime, Double_t driftVelocity, Double_t fieldZDirection,
Double_t zPosition) const {
const Double_t distanceToPlane = hitTime * driftVelocity;
return zPosition + fieldZDirection * distanceToPlane;
}

/// It prints out the process parameters stored in the metadata structure
void PrintMetadata() override {
BeginPrintProcess();
Expand Down
Loading