Merged muonspin/musrfit:root6 into master
This commit is contained in:
176
src/classes/CMakeLists.txt
Normal file
176
src/classes/CMakeLists.txt
Normal file
@@ -0,0 +1,176 @@
|
||||
#--- build the PMusr and PUserFcnBase libs ------------------------------------
|
||||
|
||||
#--- generate necessary dictionaries ------------------------------------------
|
||||
set(MUSRFIT_INC ${CMAKE_SOURCE_DIR}/src/include)
|
||||
|
||||
root_generate_dictionary(
|
||||
PFourierCanvasDict
|
||||
-I${FFTW3_INCLUDE_DIR} ${MUSRFIT_INC}/PFourierCanvas.h
|
||||
LINKDEF ${MUSRFIT_INC}/PFourierCanvasLinkDef.h
|
||||
)
|
||||
root_generate_dictionary(
|
||||
PMusrCanvasDict
|
||||
-I${FFTW3_INCLUDE_DIR} ${MUSRFIT_INC}/PMusrCanvas.h
|
||||
LINKDEF ${MUSRFIT_INC}/PMusrCanvasLinkDef.h
|
||||
)
|
||||
root_generate_dictionary(
|
||||
PMusrT0Dict
|
||||
-I${FFTW3_INCLUDE_DIR} ${MUSRFIT_INC}/PMusrT0.h
|
||||
LINKDEF ${MUSRFIT_INC}/PMusrT0LinkDef.h
|
||||
)
|
||||
root_generate_dictionary(
|
||||
PStartupHandlerDict
|
||||
-I${FFTW3_INCLUDE_DIR} ${MUSRFIT_INC}/PStartupHandler.h
|
||||
LINKDEF ${MUSRFIT_INC}/PStartupHandlerLinkDef.h
|
||||
)
|
||||
root_generate_dictionary(
|
||||
PUserFcnBaseDict
|
||||
-I${FFTW3_INCLUDE_DIR} ${MUSRFIT_INC}/PUserFcnBase.h
|
||||
LINKDEF ${MUSRFIT_INC}/PUserFcnBaseLinkDef.h
|
||||
)
|
||||
|
||||
#--- create pkg-config info ---------------------------------------------------
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(exec_prefix "\$\{prefix\}")
|
||||
set(libdir "\$\{exec_prefix\}/lib")
|
||||
set(includedir "\$\{prefix\}/include")
|
||||
set(MUSR_VERSION "1.3.0")
|
||||
set(MUSR_LIBRARY_NAME "PMusr")
|
||||
configure_file("PMusr.pc.in" "PMusr.pc" @ONLY)
|
||||
set(USERFCN_LIBRARY_NAME "PUserFcnBase")
|
||||
configure_file("PUserFcnBase.pc.in" "PUserFcnBase.pc" @ONLY)
|
||||
|
||||
#--- lib creation -------------------------------------------------------------
|
||||
add_library(PMusr SHARED
|
||||
PFitter.cpp
|
||||
PFitterFcn.cpp
|
||||
PFourier.cpp
|
||||
PFourierCanvas.cpp
|
||||
PFourierCanvasDict.cxx
|
||||
PMusrCanvas.cpp
|
||||
PMusrCanvasDict.cxx
|
||||
PFunction.cpp
|
||||
PFunctionHandler.cpp
|
||||
PMsr2Data.cpp
|
||||
PMsrHandler.cpp
|
||||
PMusrCanvas.cpp
|
||||
PMusrCanvasDict.cxx
|
||||
PMusr.cpp
|
||||
PMusrT0.cpp
|
||||
PMusrT0Dict.cxx
|
||||
PPrepFourier.cpp
|
||||
PRunAsymmetry.cpp
|
||||
PRunAsymmetryRRF.cpp
|
||||
PRunBase.cpp
|
||||
PRunDataHandler.cpp
|
||||
PRunListCollection.cpp
|
||||
PRunMuMinus.cpp
|
||||
PRunNonMusr.cpp
|
||||
PRunSingleHisto.cpp
|
||||
PRunSingleHistoRRF.cpp
|
||||
PStartupHandler.cpp
|
||||
PStartupHandlerDict.cxx
|
||||
PTheory.cpp
|
||||
)
|
||||
#--- make sure that the include directory is found ----------------------------
|
||||
target_include_directories(
|
||||
PMusr BEFORE PRIVATE
|
||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
||||
$<BUILD_INTERFACE:${NEXUS_INCLUDE_DIR}>
|
||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/MusrRoot>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/TLemRunHeader>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/MuSR_software/Class_MuSR_PSI>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/mud/src>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/nexus>
|
||||
)
|
||||
|
||||
add_library(PUserFcnBase SHARED
|
||||
PUserFcnBase.cpp
|
||||
PUserFcnBaseDict.cxx
|
||||
)
|
||||
|
||||
#--- set target properties, e.g. version --------------------------------------
|
||||
set_target_properties(PMusr
|
||||
PROPERTIES
|
||||
VERSION ${MUSR_VERSION}
|
||||
)
|
||||
set_target_properties(PUserFcnBase
|
||||
PROPERTIES
|
||||
VERSION ${MUSR_VERSION}
|
||||
)
|
||||
#--- make sure that the include directory is found ----------------------------
|
||||
target_include_directories(
|
||||
PUserFcnBase BEFORE PRIVATE $<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||
)
|
||||
|
||||
#--- add OpenMP compile options if needed -------------------------------------
|
||||
if (OpenMP_FOUND)
|
||||
target_compile_options(PMusr PUBLIC ${OpenMP_CXX_FLAGS})
|
||||
endif (OpenMP_FOUND)
|
||||
|
||||
#--- add library dependencies -------------------------------------------------
|
||||
set(DependOnLibs ${ROOT_LIBARIES})
|
||||
set(DependOnLibs ${DependOnLibs} ${FFTW3_LIBRARY})
|
||||
set(DependOnLibs ${DependOnLibs} PUserFcnBase)
|
||||
set(DependOnLibs ${DependOnLibs} mud)
|
||||
set(DependOnLibs ${DependOnLibs} TMusrRunHeader)
|
||||
set(DependOnLibs ${DependOnLibs} TLemRunHeader)
|
||||
set(DependOnLibs ${DependOnLibs} Class_MuSR_PSI)
|
||||
if (nexus)
|
||||
set(DependOnLibs ${DependOnLibs} ${LIBNEXUS_LIBRARY})
|
||||
set(DependOnLibs ${DependOnLibs} PNeXus)
|
||||
endif (nexus)
|
||||
if (OpenMP_FOUND)
|
||||
if (OpenMP_CXX_LIBRARIES)
|
||||
set(DependOnLibs ${DependOnLibs} ${OpenMP_CXX_LIBRARIES})
|
||||
else (OpenMP_CXX_LIBRARIES)
|
||||
set(DependOnLibs ${DependOnLibs} ${OpenMP_CXX_FLAGS}) # for older cmake OpenMP_CXX_LIBRARIES is not defined
|
||||
endif (OpenMP_CXX_LIBRARIES)
|
||||
endif (OpenMP_FOUND)
|
||||
|
||||
target_link_libraries(PUserFcnBase ${ROOT_LIBRARIES})
|
||||
target_link_libraries(PMusr ${DependOnLibs})
|
||||
|
||||
#--- install PUserFcnBase solib -----------------------------------------------
|
||||
install(TARGETS PUserFcnBase DESTINATION lib)
|
||||
|
||||
#--- install PMusr solib ------------------------------------------------------
|
||||
install(TARGETS PMusr DESTINATION lib)
|
||||
|
||||
#--- install root pcm's and rootmaps ------------------------------------------
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/libPFourierCanvasDict_rdict.pcm
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libPFourierCanvasDict.rootmap
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libPMusrCanvasDict_rdict.pcm
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libPMusrCanvasDict.rootmap
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libPMusrT0Dict_rdict.pcm
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libPMusrT0Dict.rootmap
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libPStartupHandlerDict_rdict.pcm
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libPStartupHandlerDict.rootmap
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libPUserFcnBaseDict_rdict.pcm
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libPUserFcnBaseDict.rootmap
|
||||
DESTINATION lib
|
||||
)
|
||||
|
||||
#--- install headers ----------------------------------------------------------
|
||||
#--- only install headers needed for classes with dictionary
|
||||
install(
|
||||
FILES ${MUSRFIT_INC}/PFourierCanvas.h
|
||||
${MUSRFIT_INC}/PFourier.h
|
||||
${MUSRFIT_INC}/PMusrCanvas.h
|
||||
${MUSRFIT_INC}/PMusr.h
|
||||
${MUSRFIT_INC}/PMusrT0.h
|
||||
${MUSRFIT_INC}/PRunListCollection.h
|
||||
${MUSRFIT_INC}/PStartupHandler.h
|
||||
${MUSRFIT_INC}/PUserFcnBase.h
|
||||
DESTINATION include
|
||||
)
|
||||
|
||||
#--- install pkg-config info --------------------------------------------------
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/PUserFcnBase.pc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PMusr.pc
|
||||
DESTINATION lib/pkgconfig
|
||||
)
|
||||
|
||||
@@ -2607,7 +2607,7 @@ void PMsrHandler::SetMsrBkgRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin)
|
||||
Int_t PMsrHandler::ParameterInUse(UInt_t paramNo)
|
||||
{
|
||||
// check that paramNo is within acceptable range
|
||||
if ((paramNo < 0) || (paramNo >= fParam.size()))
|
||||
if (paramNo >= fParam.size())
|
||||
return -1;
|
||||
|
||||
return fParamInUse[paramNo];
|
||||
@@ -6164,10 +6164,10 @@ UInt_t PMsrHandler::LastSignificant(Double_t dval, UInt_t precLimit)
|
||||
}
|
||||
|
||||
// find last significant digit
|
||||
for (UInt_t i=strlen(str)-1; i>=0; i--) {
|
||||
for (Int_t i=strlen(str)-1; i>=0; i--) {
|
||||
if (str[i] != '0') {
|
||||
if ((i-decimalPoint) < precLimit)
|
||||
lastSignificant = i-decimalPoint;
|
||||
if (((UInt_t)i-decimalPoint) < precLimit)
|
||||
lastSignificant = (UInt_t)i-decimalPoint;
|
||||
else
|
||||
lastSignificant = precLimit;
|
||||
break;
|
||||
|
||||
@@ -6475,10 +6475,10 @@ UInt_t PMusrCanvas::GetNeededAccuracy(PMsrParamStructure param)
|
||||
}
|
||||
|
||||
// find last significant digit
|
||||
for (UInt_t i=strlen(str)-1; i>=0; i--) {
|
||||
for (Int_t i=strlen(str)-1; i>=0; i--) {
|
||||
if (str[i] != '0') {
|
||||
if ((i-decimalPoint) < precLimit)
|
||||
accuracy = i-decimalPoint;
|
||||
if (((UInt_t)i-decimalPoint) < precLimit)
|
||||
accuracy = (UInt_t)i-decimalPoint;
|
||||
else
|
||||
accuracy = precLimit;
|
||||
break;
|
||||
|
||||
@@ -574,7 +574,7 @@ Bool_t PRunAsymmetry::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(forwardHistoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(forwardHistoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if ((j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) {
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(forwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k]);
|
||||
}
|
||||
}
|
||||
@@ -585,7 +585,7 @@ Bool_t PRunAsymmetry::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(backwardHistoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(backwardHistoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if ((j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) {
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) {
|
||||
backward[k][j] += addRunData->GetDataBin(backwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,7 +566,7 @@ Bool_t PRunAsymmetryRRF::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(forwardHistoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(forwardHistoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if ((j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) {
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(forwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k]);
|
||||
}
|
||||
}
|
||||
@@ -577,7 +577,7 @@ Bool_t PRunAsymmetryRRF::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(backwardHistoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(backwardHistoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if ((j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) {
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) {
|
||||
backward[k][j] += addRunData->GetDataBin(backwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1]);
|
||||
}
|
||||
}
|
||||
@@ -597,7 +597,7 @@ Bool_t PRunAsymmetryRRF::PrepareData()
|
||||
for (UInt_t i=1; i<forwardHistoNo.size(); i++) { // loop over the groupings
|
||||
for (UInt_t j=0; j<runData->GetDataBin(forwardHistoNo[i])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays within proper range
|
||||
if ((j+fT0s[2*i]-fT0s[0] >= 0) && (j+fT0s[2*i]-fT0s[0] < runData->GetDataBin(forwardHistoNo[i])->size())) {
|
||||
if (((Int_t)j+fT0s[2*i]-fT0s[0] >= 0) && (j+fT0s[2*i]-fT0s[0] < runData->GetDataBin(forwardHistoNo[i])->size())) {
|
||||
fForward[j] += forward[i][j+(Int_t)fT0s[2*i]-(Int_t)fT0s[0]];
|
||||
}
|
||||
}
|
||||
@@ -771,8 +771,7 @@ Bool_t PRunAsymmetryRRF::SubtractEstimatedBkg()
|
||||
}
|
||||
|
||||
// check if start is within histogram bounds
|
||||
if ((start[0] < 0) || (start[0] >= fForward.size()) ||
|
||||
(start[1] < 0) || (start[1] >= fBackward.size())) {
|
||||
if ((start[0] >= fForward.size()) || (start[1] >= fBackward.size())) {
|
||||
cerr << endl << ">> PRunAsymmetryRRF::SubtractEstimatedBkg(): **ERROR** background bin values out of bound!";
|
||||
cerr << endl << ">> histo lengths (f/b) = (" << fForward.size() << "/" << fBackward.size() << ").";
|
||||
cerr << endl << ">> background start (f/b) = (" << start[0] << "/" << start[1] << ").";
|
||||
@@ -780,8 +779,7 @@ Bool_t PRunAsymmetryRRF::SubtractEstimatedBkg()
|
||||
}
|
||||
|
||||
// check if end is within histogram bounds
|
||||
if ((end[0] < 0) || (end[0] >= fForward.size()) ||
|
||||
(end[1] < 0) || (end[1] >= fBackward.size())) {
|
||||
if ((end[0] >= fForward.size()) || (end[1] >= fBackward.size())) {
|
||||
cerr << endl << ">> PRunAsymmetryRRF::SubtractEstimatedBkg(): **ERROR** background bin values out of bound!";
|
||||
cerr << endl << ">> histo lengths (f/b) = (" << fForward.size() << "/" << fBackward.size() << ").";
|
||||
cerr << endl << ">> background end (f/b) = (" << end[0] << "/" << end[1] << ").";
|
||||
|
||||
@@ -34,11 +34,8 @@
|
||||
#include <TString.h>
|
||||
#include <TObjArray.h>
|
||||
#include <TObjString.h>
|
||||
//#include <TFile.h>
|
||||
#include <TFolder.h>
|
||||
|
||||
#include "TLemRunHeader.h"
|
||||
|
||||
#include "PRunBase.h"
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -78,7 +75,7 @@ PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo,
|
||||
fValid = true;
|
||||
|
||||
fRunNo = static_cast<Int_t>(runNo);
|
||||
if ((runNo < 0) || (runNo > fMsrInfo->GetMsrRunList()->size())) {
|
||||
if (runNo > fMsrInfo->GetMsrRunList()->size()) {
|
||||
fRunInfo = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -788,7 +788,7 @@ PRunData* PRunListCollection::GetSingleHisto(UInt_t index, EDataSwitch tag)
|
||||
|
||||
switch (tag) {
|
||||
case kIndex:
|
||||
if ((index < 0) || (index >= fRunSingleHistoList.size())) {
|
||||
if (index >= fRunSingleHistoList.size()) {
|
||||
cerr << endl << ">> PRunListCollection::GetSingleHisto(): **ERROR** index = " << index << " out of bounds";
|
||||
cerr << endl;
|
||||
return 0;
|
||||
@@ -831,7 +831,7 @@ PRunData* PRunListCollection::GetSingleHistoRRF(UInt_t index, EDataSwitch tag)
|
||||
|
||||
switch (tag) {
|
||||
case kIndex:
|
||||
if ((index < 0) || (index >= fRunSingleHistoRRFList.size())) {
|
||||
if (index >= fRunSingleHistoRRFList.size()) {
|
||||
cerr << endl << ">> PRunListCollection::GetSingleHistoRRF(): **ERROR** index = " << index << " out of bounds";
|
||||
cerr << endl;
|
||||
return 0;
|
||||
@@ -874,7 +874,7 @@ PRunData* PRunListCollection::GetAsymmetry(UInt_t index, EDataSwitch tag)
|
||||
|
||||
switch (tag) {
|
||||
case kIndex: // called from musrfit when dumping the data
|
||||
if ((index < 0) || (index > fRunAsymmetryList.size())) {
|
||||
if (index > fRunAsymmetryList.size()) {
|
||||
cerr << endl << ">> PRunListCollection::GetAsymmetry(): **ERROR** index = " << index << " out of bounds";
|
||||
cerr << endl;
|
||||
return 0;
|
||||
@@ -917,7 +917,7 @@ PRunData* PRunListCollection::GetAsymmetryRRF(UInt_t index, EDataSwitch tag)
|
||||
|
||||
switch (tag) {
|
||||
case kIndex: // called from musrfit when dumping the data
|
||||
if ((index < 0) || (index > fRunAsymmetryRRFList.size())) {
|
||||
if (index > fRunAsymmetryRRFList.size()) {
|
||||
cerr << endl << ">> PRunListCollection::GetAsymmetryRRF(): **ERROR** index = " << index << " out of bounds";
|
||||
cerr << endl;
|
||||
return 0;
|
||||
@@ -960,7 +960,7 @@ PRunData* PRunListCollection::GetMuMinus(UInt_t index, EDataSwitch tag)
|
||||
|
||||
switch (tag) {
|
||||
case kIndex:
|
||||
if ((index < 0) || (index > fRunMuMinusList.size())) {
|
||||
if (index > fRunMuMinusList.size()) {
|
||||
cerr << endl << ">> PRunListCollection::GetMuMinus(): **ERROR** index = " << index << " out of bounds";
|
||||
cerr << endl;
|
||||
return 0;
|
||||
@@ -1002,7 +1002,7 @@ PRunData* PRunListCollection::GetNonMusr(UInt_t index, EDataSwitch tag)
|
||||
|
||||
switch (tag) {
|
||||
case kIndex:
|
||||
if ((index < 0) || (index > fRunNonMusrList.size())) {
|
||||
if (index > fRunNonMusrList.size()) {
|
||||
cerr << endl << ">> PRunListCollection::GetNonMusr(): **ERROR** index = " << index << " out of bounds";
|
||||
cerr << endl;
|
||||
return 0;
|
||||
|
||||
@@ -27,6 +27,14 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GOMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
@@ -512,7 +520,7 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(histoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if ((j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) {
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k]);
|
||||
}
|
||||
}
|
||||
@@ -530,7 +538,7 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
for (UInt_t i=1; i<histoNo.size(); i++) { // loop over the groupings
|
||||
for (UInt_t j=0; j<runData->GetDataBin(histoNo[i])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays within proper range
|
||||
if ((j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) {
|
||||
if (((Int_t)j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) {
|
||||
fForward[j] += forward[i][j+(Int_t)fT0s[i]-(Int_t)fT0s[0]];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ PRunNonMusr::PRunNonMusr() : PRunBase()
|
||||
{
|
||||
fNoOfFitBins = 0;
|
||||
fPacking = 1;
|
||||
fStartTimeBin = 0;
|
||||
fEndTimeBin = 0;
|
||||
|
||||
fHandleTag = kEmpty;
|
||||
|
||||
@@ -105,13 +107,11 @@ Double_t PRunNonMusr::CalcChiSquare(const std::vector<Double_t>& par)
|
||||
}
|
||||
|
||||
// calculate chi square
|
||||
Double_t x;
|
||||
for (UInt_t i=0; i<fData.GetValue()->size(); i++) {
|
||||
Double_t x(1.0);
|
||||
for (UInt_t i=fStartTimeBin; i<=fEndTimeBin; i++) {
|
||||
x = fData.GetX()->at(i);
|
||||
if ((x>=fFitStartTime) && (x<=fFitEndTime)) {
|
||||
diff = fData.GetValue()->at(i) - fTheory->Func(x, par, fFuncValues);
|
||||
chisq += diff*diff / (fData.GetError()->at(i)*fData.GetError()->at(i));
|
||||
}
|
||||
diff = fData.GetValue()->at(i) - fTheory->Func(x, par, fFuncValues);
|
||||
chisq += diff*diff / (fData.GetError()->at(i)*fData.GetError()->at(i));
|
||||
}
|
||||
|
||||
return chisq;
|
||||
@@ -279,6 +279,17 @@ Bool_t PRunNonMusr::PrepareFitData()
|
||||
fNoOfFitBins++;
|
||||
}
|
||||
|
||||
// get start/end bin
|
||||
const PDoubleVector *xx = fData.GetX();
|
||||
fStartTimeBin = 0;
|
||||
fEndTimeBin = xx->size()-1;
|
||||
for (UInt_t i=0; i<xx->size(); i++) {
|
||||
if (xx->at(i) < fFitStartTime)
|
||||
fStartTimeBin = i;
|
||||
if (xx->at(i) < fFitEndTime)
|
||||
fEndTimeBin = i;
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
@@ -764,7 +764,7 @@ Bool_t PRunSingleHisto::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(histoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if ((j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) {
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k]);
|
||||
}
|
||||
}
|
||||
@@ -782,7 +782,7 @@ Bool_t PRunSingleHisto::PrepareData()
|
||||
for (UInt_t i=1; i<histoNo.size(); i++) { // loop over the groupings
|
||||
for (UInt_t j=0; j<runData->GetDataBin(histoNo[i])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays within proper range
|
||||
if ((j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) {
|
||||
if (((Int_t)j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) {
|
||||
fForward[j] += forward[i][j+(Int_t)fT0s[i]-(Int_t)fT0s[0]];
|
||||
}
|
||||
}
|
||||
@@ -1766,7 +1766,7 @@ Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo)
|
||||
}
|
||||
|
||||
// check if start is within histogram bounds
|
||||
if ((start < 0) || (start >= fForward.size())) {
|
||||
if (start >= fForward.size()) {
|
||||
cerr << endl << ">> PRunSingleHisto::EstimatBkg(): **ERROR** background bin values out of bound!";
|
||||
cerr << endl << ">> histo lengths = " << fForward.size();
|
||||
cerr << endl << ">> background start = " << start;
|
||||
@@ -1775,7 +1775,7 @@ Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo)
|
||||
}
|
||||
|
||||
// check if end is within histogram bounds
|
||||
if ((end < 0) || (end >= fForward.size())) {
|
||||
if (end >= fForward.size()) {
|
||||
cerr << endl << ">> PRunSingleHisto::EstimatBkg(): **ERROR** background bin values out of bound!";
|
||||
cerr << endl << ">> histo lengths = " << fForward.size();
|
||||
cerr << endl << ">> background end = " << end;
|
||||
|
||||
@@ -493,7 +493,7 @@ Bool_t PRunSingleHistoRRF::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(histoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if ((j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) {
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k]);
|
||||
}
|
||||
}
|
||||
@@ -511,7 +511,7 @@ Bool_t PRunSingleHistoRRF::PrepareData()
|
||||
for (UInt_t i=1; i<histoNo.size(); i++) { // loop over the groupings
|
||||
for (UInt_t j=0; j<runData->GetDataBin(histoNo[i])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays within proper range
|
||||
if ((j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) {
|
||||
if (((Int_t)j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) {
|
||||
fForward[j] += forward[i][j+(Int_t)fT0s[i]-(Int_t)fT0s[0]];
|
||||
}
|
||||
}
|
||||
@@ -1173,7 +1173,7 @@ Bool_t PRunSingleHistoRRF::EstimateBkg(UInt_t histoNo)
|
||||
}
|
||||
|
||||
// check if start is within histogram bounds
|
||||
if ((start < 0) || (start >= fForward.size())) {
|
||||
if (start >= fForward.size()) {
|
||||
cerr << endl << ">> PRunSingleHistoRRF::EstimatBkg(): **ERROR** background bin values out of bound!";
|
||||
cerr << endl << ">> histo lengths = " << fForward.size();
|
||||
cerr << endl << ">> background start = " << start;
|
||||
@@ -1182,7 +1182,7 @@ Bool_t PRunSingleHistoRRF::EstimateBkg(UInt_t histoNo)
|
||||
}
|
||||
|
||||
// check if end is within histogram bounds
|
||||
if ((end < 0) || (end >= fForward.size())) {
|
||||
if (end >= fForward.size()) {
|
||||
cerr << endl << ">> PRunSingleHistoRRF::EstimatBkg(): **ERROR** background bin values out of bound!";
|
||||
cerr << endl << ">> histo lengths = " << fForward.size();
|
||||
cerr << endl << ">> background end = " << end;
|
||||
|
||||
Reference in New Issue
Block a user