diff --git a/src/external/DepthProfile/src/PDepthProfile.cpp.backup b/src/external/DepthProfile/src/PDepthProfile.cpp.backup deleted file mode 100644 index 80ef1e1d..00000000 --- a/src/external/DepthProfile/src/PDepthProfile.cpp.backup +++ /dev/null @@ -1,247 +0,0 @@ -/*************************************************************************** - - PDepthProfile.cpp - - Author: Andreas Suter - e-mail: andreas.suter@psi.ch - -***************************************************************************/ - -/*************************************************************************** - * Copyright (C) 2009-2022 by Andreas Suter * - * andreas.suter@psi.ch * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include - -#include -#include - -#include -#include - -#include "PDepthProfile.h" - -ClassImp(PDepthProfileGlobal) - -//-------------------------------------------------------------------------- -// Constructor (PDepthProfileGlobal) -//-------------------------------------------------------------------------- -/** - *

Constructor. Reads the necessary rge-files based on the depth_profile_startup.xml - */ -PDepthProfileGlobal::PDepthProfileGlobal() -{ - // load all the TRIM.SP rge-files - fRgeHandler = new PRgeHandler("./depth_profile_startup.xml"); - if (!fRgeHandler->IsValid()) { - std::cout << std::endl << ">> PDepthProfileGlobal::PDepthProfileGlobal **PANIC ERROR**"; - std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry."; - std::cout << std::endl; - fValid = false; - } -} - -//-------------------------------------------------------------------------- -// Destructor (PDepthProfileGlobal) -//-------------------------------------------------------------------------- -/** - *

Clean up the rge-handler. - */ -PDepthProfileGlobal::~PDepthProfileGlobal() -{ - if (fRgeHandler) { - delete fRgeHandler; - fRgeHandler = nullptr; - } -} - -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -ClassImp(PDepthProfile) - -//-------------------------------------------------------------------------- -// Destructor (PDepthProfile) -//-------------------------------------------------------------------------- -/** - *

Clean up the global part. - */ -PDepthProfile::~PDepthProfile() -{ - if ((fDepthProfileGlobal != 0) && fInvokedGlobal) { - delete fDepthProfileGlobal; - fDepthProfileGlobal = nullptr; - } -} - -//-------------------------------------------------------------------------- -// SetGlobalPart (public) -//-------------------------------------------------------------------------- -/** - *

- * - * return: - * - * \param globalPart - * \param idx - */ -void PDepthProfile::SetGlobalPart(std::vector &globalPart, UInt_t idx) -{ - fIdxGlobal = static_cast(idx); - - if ((Int_t)globalPart.size() <= fIdxGlobal) { - fDepthProfileGlobal = new PDepthProfileGlobal(); - if (fDepthProfileGlobal == nullptr) { - fValid = false; - std::cerr << std::endl << ">> PDepthProfile::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << std::endl; - } else if (!fDepthProfileGlobal->IsValid()) { - fValid = false; - std::cerr << std::endl << ">> PDepthProfile::SetGlobalPart(): **ERROR** initialization of global user function object failed, sorry ..." << std::endl; - } else { - fValid = true; - fInvokedGlobal = true; - globalPart.resize(fIdxGlobal+1); - globalPart[fIdxGlobal] = dynamic_cast(fDepthProfileGlobal); - } - } else { - fValid = true; - fDepthProfileGlobal = (PDepthProfileGlobal*)globalPart[fIdxGlobal]; - } -} - -//-------------------------------------------------------------------------- -// GlobalPartIsValid (public) -//-------------------------------------------------------------------------- -/** - *

- * - * return: - */ -Bool_t PDepthProfile::GlobalPartIsValid() const -{ - return (fValid && fDepthProfileGlobal->IsValid()); -} - -//-------------------------------------------------------------------------- -// GetStoppingProbability() -//-------------------------------------------------------------------------- -/** - *

Yet to be implemented. - */ - -std::array PDepthProfile::GetStoppingProbability(double a, double b, double *energy) const -{ - - // calculation of stopping probability for a given interval and experimental energy range - // \int n(z, E) dz ~ dz [1/2 n_0 + n_1 + n_2 + ... + n_(N-1) + 1/2 n_N] - - - double zMax=fRgeHandler->GetZmax(energy[23]); - vector z; - double x=a; - double xMax=b; - if (x==0) { - x=0.5; - } - if (b>zMax){ - xMax=zMax; - - } - int j=0; - - while (x n; - double prob[24]; - double sum=0; - for (int i=0; i<24;i++){ - for (int j=0; jGet_n(energy[i], z[j]; - } else { - prob=fRgeHandler->Get_n(energy[i], z[j]; - } - sum=sum+prob; - } - prob[i]=sum; - } - - return prob; -} - - -//-------------------------------------------------------------------------- -// operator() -//-------------------------------------------------------------------------- -/** - *

Yet to be implemented. - */ -Double_t PDepthProfile::operator()(Double_t t, const std::vector ¶m) const -{ - //verify number of parameters: 2n+1 - // parameters: {f1, f2, ..., f_n, x1, ..., x_(n-1)} - assert(param.size() >2); - assert(((param.size()-1)%2) == 0); - int n=(param.size()-1)/2; - - double energy[24]; - for (int i=0;iGetZmax(energy[23])); - - } else { - prob=GetStoppingProbability(i,i+1); - } - for (int k=0;k