Skip to content
Snippets Groups Projects
Commit 2bdc54c9 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

In StsParAsic/Module, rem move methods + avoid storing TF1 in ROOT global list of fctns

parent 2823ca08
No related branches found
No related tags found
1 merge request!890Fix segfault on exit of macros: unpacking and digitization
......@@ -36,18 +36,6 @@ CbmStsParAsic::CbmStsParAsic(const CbmStsParAsic& other)
}
// -------------------------------------------------------------------------
// ----- Move constructor ----------------------------------------------
CbmStsParAsic::CbmStsParAsic(CbmStsParAsic&& other)
{
Set(other.fNofChannels, other.fNofAdc, other.fDynRange, other.fThreshold, other.fTimeResolution, other.fDeadTime,
other.fNoise, other.fZeroNoiseRate);
SetTimeOffset(other.fTimeOffset);
SetWalkCoef(other.fWalkCoef);
}
// -------------------------------------------------------------------------
// ----- Copy assignment operator --------------------------------------
CbmStsParAsic& CbmStsParAsic::operator=(const CbmStsParAsic& other)
{
......@@ -59,19 +47,6 @@ CbmStsParAsic& CbmStsParAsic::operator=(const CbmStsParAsic& other)
}
// -------------------------------------------------------------------------
// ----- Move assignment operator --------------------------------------
CbmStsParAsic& CbmStsParAsic::operator=(CbmStsParAsic&& other)
{
Set(other.fNofChannels, other.fNofAdc, other.fDynRange, other.fThreshold, other.fTimeResolution, other.fDeadTime,
other.fNoise, other.fZeroNoiseRate);
SetTimeOffset(other.fTimeOffset);
SetWalkCoef(other.fWalkCoef);
return *this;
}
// -------------------------------------------------------------------------
// ----- Destructor ----------------------------------------------------
CbmStsParAsic::~CbmStsParAsic()
{
......@@ -142,7 +117,7 @@ double CbmStsParAsic::GetRandomNoiseCharge() const
void CbmStsParAsic::Init()
{
if (fNoiseCharge) delete fNoiseCharge;
fNoiseCharge = new TF1("Noise Charge", "TMath::Gaus(x, [0], [1])", fThreshold, 10. * fNoise);
fNoiseCharge = new TF1("Noise_Charge", "TMath::Gaus(x, [0], [1])", fThreshold, 10. * fNoise, "NL");
fNoiseCharge->SetParameters(0., fNoise);
fIsInit = kTRUE;
}
......
......@@ -41,22 +41,14 @@ public:
double noise, double znr);
/** @brief Copy constructor **/
/** @brief Copy constructor (implicitely disable move constructor and assignment)**/
CbmStsParAsic(const CbmStsParAsic&);
/** @brief Move constructor (disabled) **/
CbmStsParAsic(CbmStsParAsic&&);
/** @brief Copy assignment operator **/
CbmStsParAsic& operator=(const CbmStsParAsic& other);
/** @brief Move assignment operator (disabled) **/
CbmStsParAsic& operator=(CbmStsParAsic&&);
/** @brief Destructor **/
~CbmStsParAsic();
......
......@@ -25,6 +25,27 @@ CbmStsParModule::CbmStsParModule(uint32_t nChannels, uint32_t nAsicChannels)
// -------------------------------------------------------------------------
// ----- Copy constructor ----------------------------------------------
CbmStsParModule::CbmStsParModule(const CbmStsParModule& other)
{
fNofChannels = other.GetNofChannels();
fNofAsicChannels = other.GetNofAsicChannels();
fAsicPars = other.GetAsicParams();
}
// -------------------------------------------------------------------------
// ----- Copy assignment operator --------------------------------------
CbmStsParModule& CbmStsParModule::operator=(const CbmStsParModule& other)
{
fNofChannels = other.GetNofChannels();
fNofAsicChannels = other.GetNofAsicChannels();
fAsicPars = other.GetAsicParams();
return *this;
}
// -------------------------------------------------------------------------
// ----- Randomly deactivate channels ----------------------------------
uint32_t CbmStsParModule::DeactivateRandomChannels(Double_t fraction)
{
......
......@@ -38,6 +38,14 @@ public:
CbmStsParModule(uint32_t nChannels, uint32_t nAsicChannels);
/** @brief Copy constructor (implicitely disable move constructor and assignment)**/
CbmStsParModule(const CbmStsParModule&);
/** @brief Copy assignment operator **/
CbmStsParModule& operator=(const CbmStsParModule& other);
/** @brief Destructor **/
~CbmStsParModule() {};
......
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