Commit 76e206d3 authored by Morag Jean Williams's avatar Morag Jean Williams
Browse files

Merge branch 'fix_magnus' into 'master'

Alignment Millepede: Fix DUT enumeration

See merge request !245
parents eafc6c57 41873337
Pipeline #1361389 passed with stages
in 22 minutes and 38 seconds
......@@ -55,6 +55,7 @@ The following authors, in alphabetical order, have contributed to Corryvreckan:
* Katharina Dort, University of Giessen/CERN, @kdort
* Adrian Fiergolski, CERN, @afiergol
* Lennart Huth, DESY, @lhuth
* Magnus Mager, CERN, @mmager
* Andreas Matthias Nürnberg, KIT, @nurnberg
* Florian Pitters, HEPHY Vienna, @fpipper
* Paul Schütze, DESY, @pschutze
......
......@@ -231,7 +231,9 @@ namespace corryvreckan {
/**
* @brief Base name of the file without the directory
*/
#ifndef __FILE_NAME__
#define __FILE_NAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#endif
/**
* @brief Execute a block only if the reporting level is high enough
......
......@@ -42,7 +42,7 @@ void AlignmentMillepede::initialise() {
// Renumber the planes in Millepede, ignoring masked planes.
unsigned int index = 0;
for(const auto& det : get_detectors()) {
if(det->isDUT()) {
if(det->isDUT() && m_excludeDUT) {
continue;
}
m_millePlanes[det->name()] = index;
......@@ -166,7 +166,7 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
// Calculate the mean z-position.
double avgz = 0.;
for(const auto& det : get_detectors()) {
if(det->isDUT()) {
if(det->isDUT() && m_excludeDUT) {
continue;
}
avgz += det->displacement().Z();
......@@ -175,7 +175,7 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
// Calculate the variance.
double varz = 0.0;
for(const auto& det : get_detectors()) {
if(det->isDUT()) {
if(det->isDUT() && m_excludeDUT) {
continue;
}
const double dz = det->displacement().Z() - avgz;
......@@ -197,7 +197,7 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
m_constraints.clear();
for(const auto& det : get_detectors()) {
if(det->isDUT()) {
if(det->isDUT() && m_excludeDUT) {
continue;
}
const unsigned int i = m_millePlanes[det->name()];
......@@ -574,13 +574,13 @@ bool AlignmentMillepede::fitTrack(const std::vector<Equation>& equations,
void AlignmentMillepede::updateGeometry() {
auto nPlanes = num_detectors();
for(const auto& det : get_detectors()) {
if(det->isDUT()) {
if(det->isDUT() && m_excludeDUT) {
nPlanes--;
}
}
for(const auto& det : get_detectors()) {
if(det->isDUT()) {
if(det->isDUT() && m_excludeDUT) {
continue;
}
auto plane = m_millePlanes[det->name()];
......
Markdown is supported
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