PandaRoot
BSEmcWaveformData.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 BSEMCWAVEFORMDATA_HH
15 #define BSEMCWAVEFORMDATA_HH
16 
17 #include <map>
18 #include <ostream>
19 #include <string>
20 
21 #include "Rtypes.h"
22 #include "RtypesCore.h"
23 #include "TObject.h"
24 #include "TRef.h"
25 
26 #include "FairLink.h"
27 #include "FairTimeStamp.h"
28 
30 
31 class BSEmcWaveform;
32 class FairLink;
33 class TBuffer;
34 class TClass;
35 class TMemberInspector;
36 
42 class BSEmcWaveformData : public FairTimeStamp {
43  friend std::ostream &operator<<(std::ostream &t_out, BSEmcWaveformData &t_wfData)
44  {
45  t_out << "waveform links to " << t_wfData.fDepMap.size() << " BSEmcMCDeps:" << std::endl;
46 
47  Int_t count = 0;
48  for (auto &it : t_wfData.fDepMap) {
49  t_out << "\t#" << count++ << "\t time: " << it.first << "\t energy: " << it.second << std::endl;
50  }
51 
52  return t_out;
53  }
54 
55  public:
57  BSEmcWaveformData(Int_t t_detId, BSEmcAbsWaveformSimulator *t_wfSimulator);
58 
59  virtual ~BSEmcWaveformData(){};
60 
61  virtual Bool_t operator<(const BSEmcWaveformData &t_wfData) const;
62 
63  virtual BSEmcWaveformData &operator+=(const BSEmcWaveformData &t_toAdd);
64 
65  virtual Bool_t equal(FairTimeStamp *t_data) /*override*/;
66 
67  virtual void AddDeposit(const FairLink &t_linkToDeposit, Double_t t_absEventTime, Double_t t_energy);
68 
69  Int_t GetDetectorId() { return fDetectorId; };
70  Int_t GetNDeposits() { return fDepMap.size(); };
71  const std::map<Double_t, Double_t> &GetDepositMap() { return fDepMap; };
73  Double_t GetTimeOfLastSample() { return fTimeOfLastSample; };
74  void GetDepositParameter(Int_t t_depositNo, Double_t &t_time, Double_t &t_energy);
75 
76  void SetWaveformSimulator(BSEmcAbsWaveformSimulator *t_wfSimulator) { fWfSimulator.SetObject(t_wfSimulator); };
77  void SetTimeOfLastSample(Double_t t_time) { fTimeOfLastSample = t_time; };
78  void SetOverlapTime(const Double_t t_overlap) { fOverlapTime = t_overlap; }
79  Double_t GetOverlapTime() const { return fOverlapTime; }
80 
81  protected:
82  Int_t fDetectorId{-1};
83  Double_t fTimeOfLastSample{-1};
84  Double_t fOverlapTime{-1};
85 
86  TRef fWfSimulator{};
87  std::map<Double_t, Double_t> fDepMap{};
88 
89  ClassDef(BSEmcWaveformData, 1)
90 };
91 
92 #endif /*BSEMCWAVEFORMDATA_HH*/
std::map< Double_t, Double_t > fDepMap
represents a simulated waveform in an emc crystal
Definition: BSEmcWaveform.h:75
virtual BSEmcWaveformData & operator+=(const BSEmcWaveformData &t_toAdd)
virtual void AddDeposit(const FairLink &t_linkToDeposit, Double_t t_absEventTime, Double_t t_energy)
virtual ~BSEmcWaveformData()
Double_t GetTimeOfLastSample()
virtual Bool_t equal(FairTimeStamp *t_data)
void GetDepositParameter(Int_t t_depositNo, Double_t &t_time, Double_t &t_energy)
BSEmcAbsWaveformSimulator * GetWaveformSimulator()
Abstract base class for waveform simulator.
void SetWaveformSimulator(BSEmcAbsWaveformSimulator *t_wfSimulator)
represents a simulated waveform in an emc crystal, used by BSEmcFwEndcapTimebasedWaveforms ...
friend std::ostream & operator<<(std::ostream &t_out, BSEmcWaveformData &t_wfData)
Double_t GetOverlapTime() const
virtual Bool_t operator<(const BSEmcWaveformData &t_wfData) const
void SetTimeOfLastSample(Double_t t_time)
void SetOverlapTime(const Double_t t_overlap)
const std::map< Double_t, Double_t > & GetDepositMap()