PandaRoot
BSEmcDigi.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 // File and Version Information:
15 // $Id:$
16 //
17 // Description:
18 // EMC Digi.
19 //
20 // Software developed for the BaBar Detector at the SLAC B-Factory.
21 // Adapted for the PANDA experiment at GSI
22 //
23 // Author List:
24 // Xiaorong Shi Lawrence Livermore National Lab
25 // Steve Playfer University of Edinburgh
26 // Stephen Gowdy University of Edinburgh
27 // Dima Melnichuk - adaption for PANDA
28 //
29 // Copyright Information:
30 // Copyright (C) 1994 Lawrence Livermore National Lab
31 //
33 #ifndef BSEMCDIGI_HH
34 #define BSEMCDIGI_HH
35 
36 #include <iosfwd> // for ostream
37 #include <ostream>
38 #include <string> // for string
39 
40 #include "Rtypes.h" // for BSEmcDigi::Class, BSEmcDigi::Streamer
41 #include "RtypesCore.h" // for Double_t, Int_t, Bool_t, Float_t, Option_t
42 
43 #include "FairTimeStamp.h" // for FairTimeStamp
44 
45 #include "BSEmcDataBranchNames.h"
46 
47 class TBuffer;
48 class TClass;
49 class TMemberInspector;
50 
59 class BSEmcDigi : public FairTimeStamp {
60 
61  friend std::ostream &operator<<(std::ostream &t_out, const BSEmcDigi &t_digi)
62  {
63  t_out << "BSEmc Digi in crystal: " << t_digi.GetDetectorId() << " energy: " << t_digi.GetEnergy() << " timestamp: " << t_digi.GetTimeStamp();
64  return t_out;
65  }
66 
67  public:
68  enum class eGAIN : Int_t { kNONE, kHIGH, kLOW };
69 
71  BSEmcDigi();
72  BSEmcDigi(Int_t t_id, Double_t t_energy, Float_t t_time);
73  BSEmcDigi(const BSEmcDigi &);
74 
76  virtual ~BSEmcDigi();
77  // Operators
78 
79  virtual Bool_t operator==(const BSEmcDigi &t_otherDigi) const;
80  virtual Bool_t operator!=(const BSEmcDigi &t_otherDigi) const;
81  virtual Bool_t operator<(const BSEmcDigi &t_otherDigi) const;
82  virtual Bool_t equal(FairTimeStamp *t_data);
83 
85  virtual void Print(const Option_t *t_opt = "") const;
86 
87  void SetEnergy(Double_t t_energy) { fEnergy = t_energy; };
88  virtual Double_t GetEnergy() const { return fEnergy; };
89 
90  void SetRawEnergy(Double_t t_energy) { fRawEnergyBin = t_energy; };
91  Double_t GetRawEnergy() const { return fRawEnergyBin; }
92 
93  void SetDetectorId(Int_t t_detectorId) { fDetectorId = t_detectorId; }
94  Int_t GetDetectorId() const { return fDetectorId; };
95 
96  void SetGainType(eGAIN t_type) { fGain = t_type; }
97  eGAIN GetGainType() const { return fGain; }
98 
99  void SetDCNumber(Int_t t_dcId) { fDCNumber = t_dcId; }
100  Int_t GetDCNumber() const { return fDCNumber; };
101 
102  protected:
103  Double_t fRawEnergyBin{-1};
104  Double_t fEnergy{-1}; // digi amplitude
105  Int_t fDetectorId{-1};
107  Int_t fDCNumber{-1};
108  ClassDef(BSEmcDigi, 5);
109 };
110 
111 #endif /*BSEMCDIGI_HH*/
eGAIN fGain
Definition: BSEmcDigi.h:106
void SetDCNumber(Int_t t_dcId)
Definition: BSEmcDigi.h:99
Int_t fDCNumber
Definition: BSEmcDigi.h:107
virtual Bool_t equal(FairTimeStamp *t_data)
Double_t GetRawEnergy() const
Definition: BSEmcDigi.h:91
void SetGainType(eGAIN t_type)
Definition: BSEmcDigi.h:96
Int_t GetDetectorId() const
Definition: BSEmcDigi.h:94
virtual Double_t GetEnergy() const
Definition: BSEmcDigi.h:88
Int_t fDetectorId
Definition: BSEmcDigi.h:105
ClassDef(BSEmcDigi, 5)
void SetRawEnergy(Double_t t_energy)
Definition: BSEmcDigi.h:90
void SetDetectorId(Int_t t_detectorId)
Definition: BSEmcDigi.h:93
eGAIN GetGainType() const
Definition: BSEmcDigi.h:97
virtual void Print(const Option_t *t_opt="") const
virtual Bool_t operator==(const BSEmcDigi &t_otherDigi) const
friend std::ostream & operator<<(std::ostream &t_out, const BSEmcDigi &t_digi)
Definition: BSEmcDigi.h:61
virtual ~BSEmcDigi()
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:59
Int_t GetDCNumber() const
Definition: BSEmcDigi.h:100
virtual Bool_t operator<(const BSEmcDigi &t_otherDigi) const
Double_t fRawEnergyBin
Definition: BSEmcDigi.h:103
Double_t fEnergy
Definition: BSEmcDigi.h:104
virtual Bool_t operator!=(const BSEmcDigi &t_otherDigi) const
void SetEnergy(Double_t t_energy)
Definition: BSEmcDigi.h:87