Skip to content

Commit

Permalink
Merge pull request #13711 from ghellwig/multi-iov_weak-mode-constrain…
Browse files Browse the repository at this point in the history
…ts_80X

Multi-IOV weak mode constraints (Backport of #13710)
  • Loading branch information
davidlange6 committed Mar 22, 2016
2 parents 937bbaa + 55b7331 commit 23c6506
Show file tree
Hide file tree
Showing 5 changed files with 415 additions and 326 deletions.
5 changes: 5 additions & 0 deletions Alignment/CommonAlignment/interface/Alignable.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ class Alignable
/// or if all branches of components end with such components (i.e. 'consistent').
bool firstCompsWithParams(Alignables &paramComps) const;

/// Steps down hierarchy to the lowest level of components with AlignmentParameters
/// and adds them to argument. True either if no such components are found
/// or if all branches of components end with such components (i.e. 'consistent').
bool lastCompsWithParams(Alignables& paramComps) const;

/// Return pointer to container alignable (if any)
Alignable* mother() const { return theMother; }

Expand Down
29 changes: 29 additions & 0 deletions Alignment/CommonAlignment/src/Alignable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,35 @@ bool Alignable::firstCompsWithParams(Alignables &paramComps) const
return isConsistent;
}

//__________________________________________________________________________________________________
bool Alignable::lastCompsWithParams(Alignables& paramComps) const
{
bool isConsistent = true;
bool hasAliComp = false;
bool first = true;
const Alignables comps(this->components());
for (const auto& iComp: comps) {
const auto nCompsBefore = paramComps.size();
isConsistent = iComp->lastCompsWithParams(paramComps);
if (paramComps.size() == nCompsBefore) {
if (iComp->alignmentParameters()) {
paramComps.push_back(iComp);
if (!first && !hasAliComp) isConsistent = false;
hasAliComp = true;
}
} else {
if (hasAliComp) {
isConsistent = false;
}
if (!first && !hasAliComp) isConsistent = false;
hasAliComp = true;
}
first = false;
}

return isConsistent;
}

//__________________________________________________________________________________________________
void Alignable::setAlignmentParameters( AlignmentParameters* dap )
{
Expand Down
16 changes: 6 additions & 10 deletions Alignment/MillePedeAlignmentAlgorithm/src/PedeSteerer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -714,19 +714,15 @@ void PedeSteerer::buildSubSteer(AlignableTracker *aliTracker, AlignableMuon *ali
//prepare the output files
//Get the data structure in which the configuration data are stored.
//The relation between the ostream* and the corresponding file name needs to be filled
std::list<GeometryConstraintConfigData>* ConstraintsConfigContainer = GeometryConstraints.getConfigData();
auto& ConstraintsConfigContainer = GeometryConstraints.getConfigData();

//loop over all configured constraints
for(std::list<GeometryConstraintConfigData>::iterator it = ConstraintsConfigContainer->begin();
it != ConstraintsConfigContainer->end(); it++) {
for(auto& it: ConstraintsConfigContainer) {
//each level has its own constraint which means the output is stored in a separate file
for(std::vector<std::pair<Alignable*, std::string> >::const_iterator ilevelsFilename = it->levelsFilenames_.begin();
ilevelsFilename != it->levelsFilenames_.end(); ilevelsFilename++) {
it->mapFileName_.insert(
std::pair<std::string, std::ofstream*>
(ilevelsFilename->second,this->createSteerFile(ilevelsFilename->second,true))
);

for(const auto& ilevelsFilename: it.levelsFilenames_) {
it.mapFileName_.insert(std::make_pair
(ilevelsFilename.second,this->createSteerFile(ilevelsFilename.second,true))
);
}
}

Expand Down

0 comments on commit 23c6506

Please sign in to comment.