PandaRoot
PndMdtWaveform.h
Go to the documentation of this file.
1 //==========================================================================
2 // PndMdtWaveform.h
3 //
4 // Class to hold waveforms created from Mdt Digis
5 //
6 // Hits will be converted to waveforms from semi-parameterized simulation
7 //
8 // Software developed for the BaBar Detector at the SLAC B-Factory.
9 // Adapted for the PANDA experiment at GSI
10 //
11 // Jifeng Hu, hu@to.infn.it, Torino University
12 //=======================================================================
13 //#pragma once
14 #ifndef PNDMDTWAVEFORM_H
15 #define PNDMDTWAVEFORM_H
16 
17 #include <vector>
18 #include "TObject.h"
19 #include "FairTimeStamp.h"
20 #include <algorithm>
21 #include "TGraphErrors.h"
22 
23 class PndMdtWaveform : public FairTimeStamp {
24 
25  public:
26  // Constructors
28  PndMdtWaveform(Int_t trackId, Int_t detId, Double_t time, Bool_t isWire = kTRUE);
29  // Destructor:
30  virtual ~PndMdtWaveform();
31  // Copy:
32  PndMdtWaveform(const PndMdtWaveform &copy);
33  // Operators
34 
35  virtual PndMdtWaveform &operator=(const PndMdtWaveform &copy);
36  virtual bool operator<(const PndMdtWaveform &otherWave) const;
37  PndMdtWaveform &operator+=(const PndMdtWaveform &otherWave);
38  virtual bool equal(FairTimeStamp *data) const;
39  virtual bool equal(FairTimeStamp *data);
40  // Selectors
41  Bool_t IsWire() const { return fIsWireSig; }
42  Int_t GetDetectorID() const { return fDetectorId; }
43  Int_t GetTrackId() const { return fTrackId; }
44  Long_t GetWaveformLength() const { return fSignal.size(); }
45  Double_t GetActiveTime() const { return GetTimeStamp() + 10 * GetWaveformLength(); } // nano seconds
46 
47  TGraphErrors *ToTGraph() const;
48 
49  const std::vector<Double_t> &GetSignal() const { return fSignal; }
50  // Modifiers
51  void SetSignal(const std::vector<Double_t> &v) { copy(v.begin(), v.end(), fSignal.begin()); }
52 
53  virtual std::ostream &Print(std::ostream &out = std::cout) const;
54 
55  protected:
56  Int_t fTrackId;
57  Int_t fDetectorId;
58  Bool_t fIsWireSig; // wire or strip
59  std::vector<Double_t> fSignal; // induced current
60 
61  ClassDef(PndMdtWaveform, 5)
62 };
63 #endif
Long_t GetWaveformLength() const
virtual bool operator<(const PndMdtWaveform &otherWave) const
virtual bool equal(FairTimeStamp *data) const
const std::vector< Double_t > & GetSignal() const
virtual ~PndMdtWaveform()
std::vector< Double_t > fSignal
__m128 v
Definition: P4_F32vec4.h:3
virtual std::ostream & Print(std::ostream &out=std::cout) const
PndMdtWaveform & operator+=(const PndMdtWaveform &otherWave)
Int_t GetTrackId() const
TGraphErrors * ToTGraph() const
virtual PndMdtWaveform & operator=(const PndMdtWaveform &copy)
Bool_t IsWire() const
void SetSignal(const std::vector< Double_t > &v)
Double_t GetActiveTime() const
Int_t GetDetectorID() const