PandaRoot
PndEmcWaveformData.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 PNDEMCWAVEFORMDATA_H
15 #define PNDEMCWAVEFORMDATA_H
16 
17 #include "FairTimeStamp.h"
18 #include "FairLink.h"
20 
21 #include "TRef.h"
22 #include "TObject.h"
23 
24 #include <ostream>
25 #include <map>
26 
27 class PndEmcWaveform;
28 
34 class PndEmcWaveformData : public FairTimeStamp {
35 
36  public:
38  PndEmcWaveformData(Int_t detId, PndEmcAbsWaveformSimulator *wfSimulator);
39 
40  virtual ~PndEmcWaveformData(){};
41 
42  virtual bool operator<(const PndEmcWaveformData &wfData) const;
43  friend std::ostream &operator<<(std::ostream &out, PndEmcWaveformData &wfData);
44  virtual PndEmcWaveformData &operator+=(const PndEmcWaveformData &toAdd);
45 
46  virtual bool equal(FairTimeStamp *data);
47 
48  virtual void AddHit(const FairLink &linkToHit, Double_t absEventTime, Double_t energy);
49 
50  Int_t GetDetectorId() { return fDetectorId; };
51  Int_t GetNHits() { return fHitMap.size(); };
52  const std::map<Double_t, Double_t> &GetHitMap() { return fHitMap; };
54  Double_t GetTimeOfLastSample() { return fTimeOfLastSample; };
55  void GetHitParameter(Int_t hitNo, Double_t &time, Double_t &energy);
56 
57  void SetWaveformSimulator(PndEmcAbsWaveformSimulator *wfSimulator) { fWfSimulator.SetObject(wfSimulator); };
58  void SetTimeOfLastSample(Double_t time) { fTimeOfLastSample = time; };
59 
60  protected:
61  Int_t fDetectorId;
63 
65  std::map<Double_t, Double_t> fHitMap;
66 
67  ClassDef(PndEmcWaveformData, 1)
68 };
69 
70 #endif
void SetTimeOfLastSample(Double_t time)
void GetHitParameter(Int_t hitNo, Double_t &time, Double_t &energy)
virtual bool operator<(const PndEmcWaveformData &wfData) const
void SetWaveformSimulator(PndEmcAbsWaveformSimulator *wfSimulator)
const std::map< Double_t, Double_t > & GetHitMap()
Abstract base class for waveform simulator.
virtual void AddHit(const FairLink &linkToHit, Double_t absEventTime, Double_t energy)
PndEmcAbsWaveformSimulator * GetWaveformSimulator()
virtual PndEmcWaveformData & operator+=(const PndEmcWaveformData &toAdd)
represents a simulated waveform in an emc crystal
Double_t GetTimeOfLastSample()
std::map< Double_t, Double_t > fHitMap
represents a simulated waveform in an emc crystal, used by PndEmcFWEndcapTimebasedWaveforms ...
friend std::ostream & operator<<(std::ostream &out, PndEmcWaveformData &wfData)
virtual bool equal(FairTimeStamp *data)