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