CbmRoot
CbmMuchDigi.h
Go to the documentation of this file.
1 
16 #ifndef CBMMUCHDIGI_H
17 #define CBMMUCHDIGI_H 1
18 
19 #include <Rtypes.h> // for ClassDef
20 #include <RtypesCore.h> // for Int_t, ULong64_t, UShort_t, Bool_t, Doub...
21 
22 #include <string> // for string
23 
24 #include "CbmDefs.h" // for kMuch
25 #include "CbmMuchAddress.h" // for CbmMuchAddress, kMuchModule
26 
27 #include <boost/serialization/access.hpp>
28 #include <boost/serialization/base_object.hpp>
29 
30 
31 class CbmMuchDigi {
32 public:
34  CbmMuchDigi() : fTime(0), fAddress(0), fCharge(0) {}
35 
41  CbmMuchDigi(UInt_t address, UShort_t charge = 0, ULong64_t time = 0)
42  : fTime(time), fAddress(address), fCharge(charge) {}
43  //fMatch will be created in the CbmMuchSignal and should be deleted by that class destructor only.
44  //fMatch = new CbmMatch();}
45 
46  CbmMuchDigi(CbmMuchDigi* digi);
47  CbmMuchDigi(const CbmMuchDigi&);
49 
51  virtual ~CbmMuchDigi() {}
52 
59  Double_t GetCharge() const { return fCharge; }
60 
61  //GetSystem is required due to CbmDigiManager
66 
67 
71  static const char* GetClassName() { return "CbmMuchDigi"; }
72 
73 
74  UShort_t GetAdc() const { return fCharge; }
75 
76 
77  virtual Int_t GetAddress() const { return static_cast<Int_t>(fAddress); }
78  virtual Double_t GetTime() const { return static_cast<Double_t>(fTime); }
79 
80  // Setters
81  void SetAdc(Int_t adc);
82  void SetTime(ULong64_t time);
83  void SetSaturation(Bool_t saturate) { fSaturationFlag = saturate; }
84  void SetAddress(Int_t address) { fAddress = address; }
85 
86  // Specially for littrack
87  // TODO remove after littrack fix
88  Int_t GetDetectorId() const {
90  }
91  Int_t GetChannelId() const { return GetAddress(); }
92  Int_t GetADCCharge() const { return GetAdc(); }
93  Int_t GetDTime() const { return 0; }
94 
95  std::string ToString() const { return std::string {""}; }
96 
97  template<class Archive>
98  void serialize(Archive& ar, const unsigned int /*version*/) {
99  ar& fAddress;
100  ar& fTime;
101  ar& fCharge;
102  ar& fSaturationFlag;
103  }
104 
105 
106 private:
108 
109  ULong64_t fTime; // Absolute Time Stamp[ns]
110  UInt_t fAddress; // Unique detector address
111  UShort_t fCharge; // Charge [ADC Units]
112 
113  //Below flag has to be set during the CbmMuchDigi Creation only.
115  0; //If adc value crosses the Maximum Adc value of actual electronics then SaturationFlag will be set.
116 
118 };
119 #endif
CbmMuchDigi::CbmMuchDigi
CbmMuchDigi()
Definition: CbmMuchDigi.h:34
CbmMuchDigi::GetTime
virtual Double_t GetTime() const
Definition: CbmMuchDigi.h:78
CbmMuchDigi::fSaturationFlag
Bool_t fSaturationFlag
Definition: CbmMuchDigi.h:114
CbmMuchDigi::GetChannelId
Int_t GetChannelId() const
Definition: CbmMuchDigi.h:91
CbmMuchDigi::GetCharge
Double_t GetCharge() const
Charge.
Definition: CbmMuchDigi.h:59
CbmMuchDigi::GetAdc
UShort_t GetAdc() const
Definition: CbmMuchDigi.h:74
CbmMuchDigi::fCharge
UShort_t fCharge
Definition: CbmMuchDigi.h:111
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
CbmMuchDigi::access
friend class boost::serialization::access
Definition: CbmMuchDigi.h:107
CbmMuchDigi::GetClassName
static const char * GetClassName()
Class name (static)
Definition: CbmMuchDigi.h:71
CbmMuchDigi::SetAddress
void SetAddress(Int_t address)
Definition: CbmMuchDigi.h:84
CbmMuchDigi::SetSaturation
void SetSaturation(Bool_t saturate)
Definition: CbmMuchDigi.h:83
CbmMuchDigi::ClassDef
ClassDef(CbmMuchDigi, 4)
CbmMuchDigi::GetAddress
virtual Int_t GetAddress() const
Definition: CbmMuchDigi.h:77
CbmMuchDigi::ToString
std::string ToString() const
Definition: CbmMuchDigi.h:95
CbmMuchDigi::GetDTime
Int_t GetDTime() const
Definition: CbmMuchDigi.h:93
CbmMuchDigi
Definition: CbmMuchDigi.h:31
CbmMuchDigi::CbmMuchDigi
CbmMuchDigi(UInt_t address, UShort_t charge=0, ULong64_t time=0)
Definition: CbmMuchDigi.h:41
CbmMuchAddress::GetElementAddress
static Int_t GetElementAddress(Int_t address, Int_t level)
Definition: CbmMuchAddress.h:122
CbmMuchAddress.h
CbmMuchDigi::~CbmMuchDigi
virtual ~CbmMuchDigi()
Definition: CbmMuchDigi.h:51
CbmMuchDigi::serialize
void serialize(Archive &ar, const unsigned int)
Definition: CbmMuchDigi.h:98
ECbmModuleId::kMuch
@ kMuch
Muon detection system.
kMuchModule
@ kMuchModule
Module.
Definition: CbmMuchAddress.h:20
CbmMuchDigi::fAddress
UInt_t fAddress
Definition: CbmMuchDigi.h:110
CbmMuchDigi::fTime
ULong64_t fTime
Definition: CbmMuchDigi.h:109
CbmMuchDigi::GetDetectorId
Int_t GetDetectorId() const
Definition: CbmMuchDigi.h:88
CbmMuchDigi::GetADCCharge
Int_t GetADCCharge() const
Definition: CbmMuchDigi.h:92
CbmMuchDigi::GetSystem
static ECbmModuleId GetSystem()
Definition: CbmMuchDigi.h:65
CbmMuchDigi::SetTime
void SetTime(ULong64_t time)
Definition: CbmMuchDigi.cxx:58
CbmMuchDigi::SetAdc
void SetAdc(Int_t adc)
Definition: CbmMuchDigi.cxx:34
CbmMuchDigi::operator=
CbmMuchDigi & operator=(const CbmMuchDigi &)
Definition: CbmMuchDigi.cxx:23
CbmDefs.h