Skip to content
Snippets Groups Projects
Commit d95fb950 authored by Nikolay Karpushkin's avatar Nikolay Karpushkin Committed by Florian Uhlig
Browse files

digi cleanup

parent f89a9984
No related branches found
No related tags found
1 merge request!387Psd digi update & moni + unpack update
......@@ -17,24 +17,6 @@
#include <string> // for basic_string
// --- Default constructor
CbmPsdDigi::CbmPsdDigi() {}
// --- Constructor with assignment
CbmPsdDigi::CbmPsdDigi(UInt_t address, Double_t time, Double_t edep) : fuAddress(address), fdTime(time), fdEdep(edep) {}
// --- Constructor with module and section number
CbmPsdDigi::CbmPsdDigi(UInt_t moduleId, UInt_t sectionId, Double_t time, Double_t edep)
: fuAddress(0)
, fdTime(time)
, fdEdep(edep)
{
fuAddress = CbmPsdAddress::GetAddress(moduleId, sectionId);
}
// --- Copy constructor
CbmPsdDigi::CbmPsdDigi(const CbmPsdDigi& other) : fuAddress(other.fuAddress), fdTime(other.fdTime), fdEdep(other.fdEdep)
{
......@@ -45,33 +27,6 @@ CbmPsdDigi::CbmPsdDigi(const CbmPsdDigi& other) : fuAddress(other.fuAddress), fd
CbmPsdDigi::CbmPsdDigi(CbmPsdDigi&& other) : fuAddress(other.fuAddress), fdTime(other.fdTime), fdEdep(other.fdEdep) {}
// --- Destructor
CbmPsdDigi::~CbmPsdDigi() {}
// --- Assignment operator
CbmPsdDigi& CbmPsdDigi::operator=(const CbmPsdDigi& other)
{
if (this != &other) {
fuAddress = other.fuAddress;
fdTime = other.fdTime;
fdEdep = other.fdEdep;
}
return *this;
}
// --- Move assignment operator
CbmPsdDigi& CbmPsdDigi::operator=(CbmPsdDigi&& other)
{
if (this != &other) {
fuAddress = other.fuAddress;
fdTime = other.fdTime;
fdEdep = other.fdEdep;
}
return *this;
}
// --- Set address from module and section number
void CbmPsdDigi::SetAddress(UInt_t moduleId, UInt_t sectionId)
......
......@@ -36,24 +36,35 @@ class CbmPsdDigi {
public:
/**@brief Default constructor.
**/
CbmPsdDigi();
CbmPsdDigi() {}
/** @brief Constructor with assignment
** @param address Unique channel address
** @param edep Energy deposition
** @param time Time [ns]
** @param edep Energy deposition
**/
CbmPsdDigi(UInt_t address, Double_t time, Double_t edep);
CbmPsdDigi(UInt_t address, Double_t time, Double_t edep)
: fuAddress(address)
, fdTime(time)
, fdEdep(edep)
{
}
/** @brief Constructor with detailed assignment.
** @param moduleID Module Identifier
** @param sectionID Section Identifier
** @param edep Energy deposition
** @param time Time [ns]
** @param edep Energy deposition
**/
CbmPsdDigi(UInt_t moduleId, UInt_t sectionId, Double_t time, Double_t edep);
CbmPsdDigi(UInt_t moduleId, UInt_t sectionId, Double_t time, Double_t edep)
: fuAddress(0)
, fdTime(time)
, fdEdep(edep)
{
fuAddress = CbmPsdAddress::GetAddress(moduleId, sectionId);
}
/** Copy constructor **/
......@@ -65,15 +76,15 @@ public:
/** Assignment operator **/
CbmPsdDigi& operator=(const CbmPsdDigi&);
CbmPsdDigi& operator=(const CbmPsdDigi&) = default;
/** Move Assignment operator **/
CbmPsdDigi& operator=(CbmPsdDigi&&);
CbmPsdDigi& operator=(CbmPsdDigi&&) = default;
/** Destructor **/
~CbmPsdDigi();
~CbmPsdDigi() {}
/** @brief Class name (static)
......@@ -139,12 +150,11 @@ public:
std::string ToString() const;
private:
UInt_t fuAddress = 0; /// Unique channel address
Double_t fdTime = -1.; /// Time of measurement [ns]
Double_t fdEdep = 0.; /// Energy deposition from FPGA [MeV]
private:
/// BOOST serialization interface
friend class boost::serialization::access;
template<class Archive>
......@@ -155,7 +165,7 @@ private:
ar& fdEdep;
}
ClassDefNV(CbmPsdDigi, 6);
ClassDefNV(CbmPsdDigi, 5);
};
#endif // CBMPSDDIGI_H
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