Skip to content
Snippets Groups Projects
Commit 6d8512de authored by Administrator's avatar Administrator Committed by Florian Uhlig
Browse files

Remove ROOT data types from CbmStsDigi

Also remove the dependency to RtypesCore.h.
This is the first step to an additional ROOT free version of the CbmStsDigi
requested for the new algorithm code.
The change of the data types has no influence on the streamer. It is still
possible to read previous versions from file even without increasing the
version number.
parent 4d042e37
No related branches found
No related tags found
1 merge request!525Implement CbmStsDigi version without ROOT dependencies
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#ifndef CBMDEFS_H #ifndef CBMDEFS_H
#define CBMDEFS_H 1 #define CBMDEFS_H 1
#include <RtypesCore.h> // for Double_t
#include <type_traits> // for underlying_type #include <type_traits> // for underlying_type
#include <iostream> // for ostream #include <iostream> // for ostream
...@@ -145,8 +144,8 @@ enum class ECbmTreeAccess ...@@ -145,8 +144,8 @@ enum class ECbmTreeAccess
/** Global functions for particle masses **/ /** Global functions for particle masses **/
inline Double_t CbmProtonMass() { return 0.938272046; } inline double CbmProtonMass() { return 0.938272046; }
inline Double_t CbmNeutronMass() { return 0.939565379; } inline double CbmNeutronMass() { return 0.939565379; }
inline Double_t CbmElectronMass() { return 0.000510998928; } inline double CbmElectronMass() { return 0.000510998928; }
#endif #endif
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "CbmDefs.h" // for ECbmModuleId::kSts #include "CbmDefs.h" // for ECbmModuleId::kSts
#include <Rtypes.h> // for ClassDef #include <Rtypes.h> // for ClassDef
#include <RtypesCore.h> // for Int_t, Double_t, UShort_t, Long64_t, ULong64_t
#include <boost/serialization/access.hpp> #include <boost/serialization/access.hpp>
#include <boost/serialization/base_object.hpp> #include <boost/serialization/base_object.hpp>
...@@ -44,7 +43,7 @@ public: ...@@ -44,7 +43,7 @@ public:
** @param time Measurement time [ns] ** @param time Measurement time [ns]
** @param charge Charge [ADC units] ** @param charge Charge [ADC units]
**/ **/
CbmStsDigi(Int_t address, Int_t channel, ULong64_t time, UShort_t charge) CbmStsDigi(int32_t address, int32_t channel, uint64_t time, uint16_t charge)
: fTime(time) : fTime(time)
, fAddress(address) , fAddress(address)
, fChannel(channel) , fChannel(channel)
...@@ -60,7 +59,7 @@ public: ...@@ -60,7 +59,7 @@ public:
/** Unique detector element address (see CbmStsAddress) /** Unique detector element address (see CbmStsAddress)
** @value Unique address of readout channel ** @value Unique address of readout channel
**/ **/
Int_t GetAddress() const { return fAddress; } int32_t GetAddress() const { return fAddress; }
/** @brief Get the desired name of the branch for this obj in the cbm output tree (static) /** @brief Get the desired name of the branch for this obj in the cbm output tree (static)
...@@ -72,7 +71,7 @@ public: ...@@ -72,7 +71,7 @@ public:
/** @brief Channel number in module /** @brief Channel number in module
** @value Channel number ** @value Channel number
**/ **/
UShort_t GetChannel() const { return fChannel; } uint16_t GetChannel() const { return fChannel; }
/** @brief Class name (static) /** @brief Class name (static)
...@@ -84,7 +83,7 @@ public: ...@@ -84,7 +83,7 @@ public:
/** Charge /** Charge
** @value Charge [ADC units] ** @value Charge [ADC units]
**/ **/
Double_t GetCharge() const { return Double_t(fCharge); } double GetCharge() const { return double(fCharge); }
/** System ID (static) /** System ID (static)
...@@ -96,7 +95,7 @@ public: ...@@ -96,7 +95,7 @@ public:
/** Time of measurement /** Time of measurement
** @value Time [ns] ** @value Time [ns]
**/ **/
Double_t GetTime() const { return Double_t(fTime); } double GetTime() const { return double(fTime); }
template<class Archive> template<class Archive>
...@@ -112,7 +111,7 @@ public: ...@@ -112,7 +111,7 @@ public:
/** Update Time of measurement /** Update Time of measurement
** @param New Time [ns] ** @param New Time [ns]
**/ **/
void SetTime(Double_t dNewTime) void SetTime(double dNewTime)
{ {
// Future versions of StsDigi won't be able to store negative timestamps. // Future versions of StsDigi won't be able to store negative timestamps.
assert(dNewTime >= 0); assert(dNewTime >= 0);
...@@ -127,10 +126,10 @@ public: ...@@ -127,10 +126,10 @@ public:
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
Long64_t fTime = 0.; ///< Time [ns] int64_t fTime = 0.; ///< Time [ns]
Int_t fAddress = 0; ///< Unique element address int32_t fAddress = 0; ///< Unique element address
UShort_t fChannel = 0; ///< Channel number uint16_t fChannel = 0; ///< Channel number
UShort_t fCharge = 0; ///< Charge [ADC units] uint16_t fCharge = 0; ///< Charge [ADC units]
ClassDefNV(CbmStsDigi, 7); ClassDefNV(CbmStsDigi, 7);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment