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