Commit 944ec570 authored by Munken's avatar Munken
Browse files

Merge remote-tracking branch 'origin/master' into telescope

parents f93a476a 5e7f6af6
......@@ -9,8 +9,20 @@ namespace AUSA {
* Output from LabToCM
*/
struct TransformedValues {
/**
* Energy in CM.
* Same units as input.
*/
double energy;
/**
* Angle in CM in radians
*/
double angle;
/**
* Jacobian defined here as sigma'/sigma
* CM solid angle = lab solid angle * 1/jabobian
*/
double jacobian;
};
......
......@@ -71,6 +71,22 @@ namespace AUSA {
* @param nMax maximum number of iterations. Default value is nMax=50.
*/
void setMaxIterations(int nMax);
/**
* Get number of known (i.e. measured) kinematic quantities
*/
inline int getNumberOfKnowns() const { return N; };
/**
* Get number of unknown (i.e. not measured) kinematic quantities
*/
inline int getNumberOfUnknowns() const { return J; };
/**
* Get number of constraints
*/
inline int getNumberOfConstraints() const { return K; };
private:
int N, J, K;
......
......@@ -286,6 +286,7 @@ namespace AUSA {
// replace measured values with fitted ones
for (Int_t i = 0; i < N; i++) values[i] = x(i, 0);
for (Int_t i = 0; i < J; i++) values[N+i] = xi(i, 0);
// set flag
newFitCompleted = true;
......
......@@ -64,6 +64,7 @@ namespace AUSA {
private:
Setup& setup;
std::unique_ptr<SortedReaderBackend> reader;
bool first;
};
}
}
......
......@@ -16,12 +16,14 @@ SortedReader::SortedReader(std::string file, Setup& setup) : SortedReader(setup)
add(file);
}
SortedReader::SortedReader(Setup& setup) : setup(setup) {
SortedReader::SortedReader(Setup& setup) : setup(setup), first(true) {
}
void SortedReader::run() {
reader->reset();
if (!first) reader->reset();
first = false;
AbstractSortedProvider::provider.notifyReset();
SortedSetupOutput& output = reader -> getOutput();
Output::setTotal(output, reader -> getEntries());
......
......@@ -37,9 +37,7 @@ SUITE(SRIM13TabulationTest) {
CHECK_EQUAL(tOld.second.front(), tNew.second.front());
auto content = AUSA::asciiFileToString(SRIM13Tabulation::getDownloadDirectory() + "/1_1/H1_1H.dat");
CHECK(content.find("Hydrogen in Hydrogen.txt") != std::string::npos);
AUSA::asciiFileToString(SRIM13Tabulation::getDownloadDirectory() + "/1_1/H1_1H.dat");
}
TEST(HydrogenInHydrogenGasLoads) {
......@@ -49,9 +47,7 @@ SUITE(SRIM13TabulationTest) {
SRIM13Tabulation tab{1, 1, Hgas};
tab.getRange();
auto content = AUSA::asciiFileToString(f);
CHECK(content.find("Hydrogen in Hydrogen (gas).txt") != std::string::npos);
AUSA::asciiFileToString(f);
}
......@@ -72,9 +68,7 @@ SUITE(SRIM13TabulationTest) {
tab.getTotalStoppingPower();
auto content = AUSA::asciiFileToString(f);
CHECK(content.find("Hydrogen in Hydrogen.txt") != std::string::npos);
AUSA::asciiFileToString(f);
}
TEST(TableDownloadsH7InHeIfMissing) {
......@@ -83,9 +77,7 @@ SUITE(SRIM13TabulationTest) {
SRIM13Tabulation tab{1, 7, He};
tab.getTotalStoppingPower();
auto content = AUSA::asciiFileToString(f);
CHECK(content.find("Hydrogen in Helium.txt") != std::string::npos);
AUSA::asciiFileToString(f);
}
TEST(TestCompoundMaterialDownloadsFine) {
......
......@@ -104,7 +104,7 @@ SUITE(IterativeKinFitter) {
CHECK_CLOSE(0.919, chisq, 1E-3);
CHECK_CLOSE(1.944, values[0], 1E-3);
CHECK_CLOSE(0.243, values[1], 1E-3);
CHECK_CLOSE(0.830, values[2], 1E-3);
CHECK_CLOSE(0.813, values[2], 1E-3);
// get covariance matrix
TMatrixD fitCovMat = kf.getCovarianceMatrix();
CHECK_CLOSE( 0.000324, fitCovMat(0,0), 1E-3);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment