Skip to content
Snippets Groups Projects
Commit 685b359d authored by Markus Frank's avatar Markus Frank Committed by MarkusFrankATcernch
Browse files

Add study for new Velo-Pixel Detector element conditions. Include fixes from...

Add study for new Velo-Pixel Detector element conditions. Include fixes from Chris Burr for alignment computations
parent 03eb1a11
No related branches found
No related tags found
No related merge requests found
...@@ -188,9 +188,23 @@ Result AlignmentsCalculator::compute(const std::map<DetElement, Delta>& deltas, ...@@ -188,9 +188,23 @@ Result AlignmentsCalculator::compute(const std::map<DetElement, Delta>& deltas,
Result result; Result result;
Calculator obj; Calculator obj;
Calculator::Context context(alignments); Calculator::Context context(alignments);
// This is a tricky one. We absolutely need the detector elements ordered
// by their depth aka. the distance to /world.
// Unfortunately one cannot use the raw pointer of the DetElement here,
// But has to insert them in a map which is ordered by the DetElement path.
//
// Otherwise memory randomization gives us the wrong order and the
// corrections are calculated in the wrong order ie. not top -> down the
// hierarchy, but in "some" order depending on the pointer values!
//
std::map<DetElement,Delta,Calculator::Context::PathOrdering> ordered_deltas;
for( const auto& i : deltas ) for( const auto& i : deltas )
ordered_deltas.insert(i);
for( const auto& i : ordered_deltas )
context.insert(i.first, &(i.second)); context.insert(i.first, &(i.second));
for( const auto& i : deltas ) for( const auto& i : ordered_deltas )
obj.resolve(context,i.first); obj.resolve(context,i.first);
for( auto& i : context.entries ) for( auto& i : context.entries )
result += obj.compute(context, i); result += obj.compute(context, i);
......
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