PandaRoot
BSEmcPSAFPGASampleAnalyser.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef BSEMCPSAFPGASAMPLEANALYSER_HH
14 #define BSEMCPSAFPGASAMPLEANALYSER_HH
15 
16 #include <string>
17 #include <vector>
18 
19 #include "Rtypes.h"
20 #include "RtypesCore.h"
21 
22 #include "BSEmcAbsPSA.h"
23 
28 class BSEmcWaveform;
29 class TBuffer;
30 class TClass;
31 class TMemberInspector;
32 
34  constexpr static Int_t fgMaxNumberOfHits{100};
35 
36  public:
38  BSEmcPSAFPGASampleAnalyser(const std::string &t_fname);
40 
41  virtual void initFromFile(const std::string &t_fname);
42  virtual void reset() = 0;
43  virtual void put(Float_t t_valueToStore) = 0;
44  virtual void setBaseline(Float_t t_newBaseline) { fBaseline_value = t_newBaseline; };
45 
46  virtual Float_t baseline() = 0;
47  Int_t nHits() { return fNumber_of_hits; };
48  Float_t sampleTime(Int_t t_index);
49  Float_t sampleAmplitude(Int_t t_index);
50  Float_t sampleIntegral(Int_t t_index);
51  Int_t samplePileup(Int_t t_index);
52 
53  virtual Int_t Process(const BSEmcWaveform *t_waveform);
54  virtual void Reset() { this->reset(); };
55  virtual void GetHit(Int_t t_i, Double_t &t_energy, Double_t &t_time);
56  virtual void GetHit(Int_t t_i, Double_t &t_energy, Double_t &t_time, Int_t &t_PileupType);
57 
58  virtual void Init(const std::vector<Double_t> &t_params);
59 
61  Int_t ma_trig_M;
62  Float_t hit_threshold;
63  Int_t cf_delay;
64  Float_t cf_ratio;
67  Int_t mwd_length;
68  Float_t mwd_tau;
69  Int_t mwd2_length;
70  Float_t mwd2_tau;
71  Int_t mwd3_length;
72  Float_t mwd3_tau;
73  Int_t sig_delay;
75  Float_t clock_unit; // unit time per point
76  Float_t iafactor; // integral vs ampltitue
77  };
78 
79  enum pileup_t { kSingle = 0, kPileup1 = 1, kPileup2 = 2, kInvalid = 99 };
81  status_t GetStatus() { return fStatus; }
82 
83  protected:
84  virtual void init(SampleAnalyserParams &t_params);
85 
87 
88  Float_t fBaseline_value{0};
89  Int_t fLocal_time{0};
90  Bool_t fPulse_detected{kFALSE};
92  Int_t fCF_zero_crossing_points{0}; // Unused
93 
101 
103 
104  // features of the detected pulses
105  Int_t fNumber_of_hits{0};
106  Float_t fTime[fgMaxNumberOfHits]{};
107  Float_t fIntegral[fgMaxNumberOfHits]{};
108  Float_t fAmplitude[fgMaxNumberOfHits]{};
109 
111  Int_t fPileups[fgMaxNumberOfHits]{};
112 
114 };
115 
116 #endif /*BSEMCPSAFPGASAMPLEANALYSER_HH*/
Baseclass for pulseshapeanalysis ( featureextraction )
Definition: BSEmcAbsPSA.h:38
BSEmcPSAFPGAFilterDelay * fMA_delay
virtual Float_t baseline()=0
represents a simulated waveform in an emc crystal
Definition: BSEmcWaveform.h:75
BSEmcPSAFPGAFilterDelay * fSignal_buffer
virtual void GetHit(Int_t t_i, Double_t &t_energy, Double_t &t_time)
Get energy and time of hit.
Int_t samplePileup(Int_t t_index)
ClassDef(BSEmcPSAFPGASampleAnalyser, 2)
virtual void reset()=0
Float_t fTime[fgMaxNumberOfHits]
virtual void initFromFile(const std::string &t_fname)
BSEmcPSAFPGAFilterMA * fMA_triggering
Float_t sampleAmplitude(Int_t t_index)
virtual void put(Float_t t_valueToStore)=0
Float_t sampleTime(Int_t t_index)
Float_t fAmplitude[fgMaxNumberOfHits]
virtual Int_t Process(const BSEmcWaveform *t_waveform)
Find Hits in Waveform.
Float_t sampleIntegral(Int_t t_index)
virtual void setBaseline(Float_t t_newBaseline)
virtual void Init(const std::vector< Double_t > &t_params)
virtual ~BSEmcPSAFPGASampleAnalyser()
virtual void Reset()
reset found hits
Float_t fIntegral[fgMaxNumberOfHits]
BSEmcPSAFPGAFilterDelay * fSignal_delay
BSEmcPSAFPGAFilterDelay * fCF_delay
virtual void init(SampleAnalyserParams &t_params)