MpdZdcDigi.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*************************************************************************************
  2. *
  3. * MpdZdcDigi
  4. * Class for digital data taken from MpdZdc detector
  5. *
  6. * Author: Elena Litvinenko
  7. * e-mail: litvin@nf.jinr.ru
  8. * Version: 18-Apr-2008
  9. * Modified March 2021 by A.Strijak
  10. *
  11. ************************************************************************************/
  12. #ifndef MPDZDCDIGI_H
  13. #define MPDZDCDIGI_H
  14. #include "MpdZdcPoint.h"
  15. class MpdZdcDigi: public TObject
  16. {
  17. public:
  18. MpdZdcDigi();
  19. MpdZdcDigi(Int_t pfDetectorID, Int_t pfModuleID, Int_t pfChannelID, Double_t pfELoss=0, Bool_t pIsPsd=kFALSE );
  20. MpdZdcDigi(MpdZdcPoint *p, Bool_t pIsPsd=kFALSE);
  21. virtual ~MpdZdcDigi();
  22. void Clear();
  23. void InitStatic(Bool_t pIsPsd=kFALSE);
  24. virtual void Print(const Option_t* opt ="");
  25. inline Int_t GetModuleID() { return fModuleID; }
  26. inline Int_t GetDetectorID() { return fDetectorID; }
  27. inline Int_t GetChannelID() { return fChannelID; }
  28. inline Int_t GetADCBits() { return fADCBits; }
  29. inline UInt_t GetELossDigi() { return fELossDigi; }
  30. inline Double_t GetELoss() { return fELoss; }
  31. inline Double_t GetADCResolution() { return fADCResolution; }
  32. inline Double_t GetEnergyDigiThreshold() { return fEnergyDigiThreshold; }
  33. inline Double_t GetELossReco() { return fELossReco; }
  34. inline char GetWasInitialized() { return fWasInitialized; }
  35. inline Bool_t GetIsPsd() { return fIsPsd; }
  36. inline Int_t SetModuleID(UInt_t pfModuleID) { fModuleID=pfModuleID; return fModuleID; }
  37. inline Int_t SetDetectorID(UInt_t pfDetectorID) { fDetectorID=pfDetectorID; return fDetectorID; }
  38. inline Int_t SetChannelID(UInt_t pfChannelID) { fChannelID=pfChannelID; return fChannelID; }
  39. inline Int_t SetADCBits (Int_t pfADCBits) { fADCBits=pfADCBits; return fADCBits; }
  40. inline Double_t SetADCResolution (Int_t pfADCResolution) { fADCResolution=pfADCResolution; return fADCResolution; }
  41. inline Double_t SetEnergyDigiThreshold (Int_t pfEnergyDigiThr) {fEnergyDigiThreshold=pfEnergyDigiThr; return fEnergyDigiThreshold; }
  42. inline Double_t AddEloss (Double_t pfELoss) { fELoss += pfELoss; return fELoss;}
  43. UInt_t AddZdcPoint (MpdZdcPoint *p);
  44. UInt_t Convert () { fELossDigi = ADC (fELoss); fELoss=0; return fELossDigi;}
  45. UInt_t ConvertSim () { fELossDigi = ADC (fELoss); return fELossDigi;}
  46. UInt_t ADC (Double_t pfELoss);
  47. Double_t SetELossReco (Double_t pfELoss) { fELossReco = pfELoss; return fELossReco; }
  48. protected:
  49. static char fWasInitialized; // 0 - from built-in constants; 1 - was attempt to read; 2 - success from MpdZdcDigiScheme
  50. static Int_t fADCBits; // Hardware parameter
  51. static Double_t fADCResolution; // Hardware parameter
  52. static Double_t fEnergyDigiThreshold;
  53. Int_t fDetectorID; // Detector Id
  54. Int_t fModuleID; // Hardware channel number (Module number)
  55. Int_t fChannelID; // Hardware channel number (Sub-module number)
  56. UInt_t fELossDigi; // Sum of the energy losses as digital response of the detector/channel
  57. Double_t fELoss; // Sum of the energy losses as analog signal accumulated prior to digitalization
  58. Double_t fELossReco; // Sum of the energy losses as analog simulated response of the detector/channel
  59. Bool_t fIsPsd; // static initialization tried from from MpdZdcDigiPar (0) or MpdZdcPsdDigiPar (1)
  60. ClassDef(MpdZdcDigi,2);
  61. };
  62. #endif // MPDZDCDIGI_H