PandaRoot
PndEmcPSAFPGASampleAnalyser.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 PNDEMCFPGASAMPLEANALYSER_HH
14 #define PNDEMCFPGASAMPLEANALYSER_HH
15 
16 #include <string>
17 #include <fstream>
22 
23 #include "PndEmcAbsPSA.h"
24 
25 #define MAX_NUMBER_OF_HITS 100
26 
28 
29  public:
31  PndEmcPSAFPGASampleAnalyser(const std::string &fname);
33 
34  virtual void initFromFile(const std::string &fname);
35  virtual void reset() = 0;
36  virtual void put(float valueToStore) = 0;
37  virtual void setBaseline(float newBaseline){baseline_value = newBaseline;};
38 
39  virtual float baseline() = 0;
40  int nHits(){return Number_of_hits;};
41  float sampleTime(int index);
42  float sampleAmplitude(int index);
43  float sampleIntegral(int index);
44  Int_t samplePileup(int index);
45  virtual Int_t Process(const PndEmcWaveform *waveform);
46  virtual void Reset(){this->reset();};
47  virtual void GetHit(Int_t i,Double_t &energy, Double_t &time);
48  virtual void GetHit2(Int_t i, Double_t &energy, Double_t &time, Int_t &PileupType);
49  virtual void Init(const std::vector<Double_t> &params);
50 
52  int ma_trig_M;
54  int cf_delay;
55  float cf_ratio;
59  float mwd_tau;
61  float mwd2_tau;
63  float mwd3_tau;
64  int sig_delay;
66  float clock_unit;//unit time per point
67  float iafactor;//integral vs ampltitue
68  } ;
69 
71  status_t GetStatus() { return status; }
72 
73  protected:
74  virtual void init(SampleAnalyserParams &params);
75 
77 
79  unsigned int local_time;
83  std::ofstream Ratio;
84 
93 
94  // features of the detected pulses
96  float time[MAX_NUMBER_OF_HITS];
101 
103 };
104 
105 #endif
virtual ~PndEmcPSAFPGASampleAnalyser()
virtual float baseline()=0
float integral[MAX_NUMBER_OF_HITS]
virtual void put(float valueToStore)=0
PndEmcPSAFPGAFilterDelay * MA_delay
virtual void GetHit2(Int_t i, Double_t &energy, Double_t &time, Int_t &PileupType)
virtual void Init(const std::vector< Double_t > &params)
virtual void GetHit(Int_t i, Double_t &energy, Double_t &time)
Get energy and time of hit.
float sampleTime(int index)
unsigned int i
Definition: P4_F32vec4.h:33
ClassDef(PndEmcPSAFPGASampleAnalyser, 2)
float sampleAmplitude(int index)
float amplitude[MAX_NUMBER_OF_HITS]
virtual void Reset()
reset found hits
represents a simulated waveform in an emc crystal
virtual void init(SampleAnalyserParams &params)
Baseclass for pulseshapeanalysis ( featureextraction )
Definition: PndEmcAbsPSA.h:33
PndEmcPSAFPGAFilterDelay * Signal_buffer
float sampleIntegral(int index)
PndEmcPSAFPGAFilterDelay * Signal_delay
virtual Int_t Process(const PndEmcWaveform *waveform)
Find Hits in Waveform.
virtual void setBaseline(float newBaseline)
#define MAX_NUMBER_OF_HITS
virtual void initFromFile(const std::string &fname)
Int_t samplePileup(int index)
PndEmcPSAFPGAFilterDelay * CF_delay