PandaRoot
BSEmcMultiWaveform.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 //=============================================================================
14 // BSEmcMultiWaveform.h
15 //
16 // Class to hold multiple waveforms from one Emc Hit / ADC readout
17 //
18 // Author: Christian Hammmann
19 // chammann@hiskp.uni-bonn.de
20 //
21 //=============================================================================
22 
23 //#pragma once
24 #ifndef BSEMCMULTIWAVEFORM_HH
25 #define BSEMCMULTIWAVEFORM_HH
26 
27 #include <memory>
28 #include <string>
29 #include <vector>
30 
31 #include "Rtypes.h"
32 #include "RtypesCore.h"
33 
34 #include "BSEmcDataBranchNames.h"
35 #include "BSEmcWaveform.h"
36 
37 class TBuffer;
38 class TClass;
39 class TMemberInspector;
40 
47 
49 
50  public:
51  BSEmcMultiWaveform() : BSEmcWaveform(), fSignals(1, std::vector<Double_t>(0, 0.)), fActiveWaveform(1) {}
52 
53  BSEmcMultiWaveform(Int_t t_trackid, Long_t t_detId, Long_t t_waveform_length = 128, Int_t t_hitIndex = -1);
54 
56  {
57  fSignal.clear();
58  fSignals.clear();
59  };
60 
61  void SetWaveform(const std::vector<Double_t> &t_signal, Int_t t_length, Int_t t_waveform);
62 
63  virtual void clearAndReset() /*override*/;
64 
65  virtual void Clear(Option_t * /*unused*/) /*override*/
66  {
67  fSignal.clear();
68  fSignals.clear();
69  };
70 
71  Int_t GetNumberOfWaveforms() const { return fSignals.size(); };
72  Int_t GetActiveWaveform() const { return fActiveWaveform; };
73  void SetActiveWaveform(Int_t t_active = 1) { fActiveWaveform = t_active; };
74  Int_t GetWaveformLength() const { return fSignals.at(fActiveWaveform).size(); }
75 
76  virtual std::vector<Double_t> GetSignal() const /*override*/;
77  const std::vector<Double_t> &GetSignal(Int_t t_waveform) const { return fSignals.at(t_waveform); }
78 
79  private:
80  std::vector<std::vector<Double_t>> fSignals{};
81  Int_t fActiveWaveform{-1};
82 
84 };
85 
86 #endif /*BSEMCMULTIWAVEFORM_HH*/
virtual void clearAndReset()
represents a simulated waveform in an emc crystal
Definition: BSEmcWaveform.h:75
virtual std::vector< Double_t > GetSignal() const
Int_t GetActiveWaveform() const
Int_t GetNumberOfWaveforms() const
STL namespace.
interface for waveform modifiers
ClassDef(BSEmcAbsWaveformModifier, 1)
Class to hold multiple waveforms from one Emc Hit / ADC readout.
Int_t GetWaveformLength() const
void SetActiveWaveform(Int_t t_active=1)
const std::vector< Double_t > & GetSignal(Int_t t_waveform) const
std::vector< Double_t > fSignal
virtual void Clear(Option_t *)
void SetWaveform(const std::vector< Double_t > &t_signal, Int_t t_length, Int_t t_waveform)