PandaRoot
BSEmcAbsWaveformModifier.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 BSEMCABSWAVEFORMMODIFIER_HH
14 #define BSEMCABSWAVEFORMMODIFIER_HH
15 
16 #include "TObject.h"
17 
18 #include "BSEmcMultiWaveform.h"
19 #include "BSEmcWaveform.h"
20 
27 class BSEmcAbsWaveformModifier : public TObject {
28  public:
29  virtual void Modify(BSEmcWaveform *t_wf) = 0;
30  virtual Double_t GetScale() { return 1.; };
31 
33 
34  protected:
35  std::vector<Double_t> &GetWaveformReference(BSEmcWaveform *t_wf)
36  {
37  if (BSEmcMultiWaveform *multiWf = dynamic_cast<BSEmcMultiWaveform *>(t_wf)) {
38  Int_t activeWf = multiWf->GetActiveWaveform();
39  return multiWf->fSignals.at(activeWf);
40  }
41  return t_wf->fSignal;
42  }
43 
45 };
46 
47 #endif /*BSEMCABSWAVEFORMMODIFIER_HH*/
represents a simulated waveform in an emc crystal
Definition: BSEmcWaveform.h:75
virtual void Modify(BSEmcWaveform *t_wf)=0
interface for waveform modifiers
ClassDef(BSEmcAbsWaveformModifier, 1)
Class to hold multiple waveforms from one Emc Hit / ADC readout.
std::vector< Double_t > fSignal
std::vector< Double_t > & GetWaveformReference(BSEmcWaveform *t_wf)