Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to switch between hierarchy and averaging constraints in MP-b... #7323

Merged
merged 1 commit into from Mar 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -151,11 +151,15 @@ class AlignmentParameterStore
AlignmentCorrelationsStore* theCorrelationsStore;

private:
enum TypeOfConstraints { NONE, HIERARCHY_CONSTRAINTS, APPROX_AVERAGING_CONSTRAINTS };

// data members

/// alignables
align::Alignables theAlignables;

/// type of constraints
TypeOfConstraints theTypeOfConstraints;
};

#endif
Expand Up @@ -7,7 +7,8 @@
Weight = cms.double(0.5),
MaxUpdates = cms.int32(5000)
),
UseExtendedCorrelations = cms.untracked.bool(False)
UseExtendedCorrelations = cms.untracked.bool(False),
TypeOfConstraints = cms.string('approximate_averaging'),
)
)

Expand Up @@ -36,6 +36,26 @@ AlignmentParameterStore::AlignmentParameterStore( const align::Alignables &alis,

edm::LogInfo("Alignment") << "@SUB=AlignmentParameterStore"
<< "Created with " << theAlignables.size() << " alignables.";

// set hierarchy vs averaging constraints
theTypeOfConstraints = NONE;
const std::string cfgStrTypeOfConstraints(config.getParameter<std::string>("TypeOfConstraints"));
if( cfgStrTypeOfConstraints == "hierarchy" ) {
theTypeOfConstraints = HIERARCHY_CONSTRAINTS;
edm::LogWarning("Alignment") << "@SUB=AlignmentParameterStore"
<< "\n\n\n******* WARNING ******************************************\n"
<< "Using hierarchy constraints that have a not-understood bug.\n"
<< "It is strongly recommended to use averaging constraints for\n"
<< "the time being!\n\n\n";

} else if( cfgStrTypeOfConstraints == "approximate_averaging" ) {
theTypeOfConstraints = APPROX_AVERAGING_CONSTRAINTS;
edm::LogWarning("Alignment") << "@SUB=AlignmentParameterStore"
<< "Using approximate implementation of averaging constraints";
} else {
edm::LogError("BadArgument") << "@SUB=AlignmentParameterStore"
<< "Unknown type of hierarchy constraints '" << cfgStrTypeOfConstraints << "'";
}
}

//__________________________________________________________________________________________________
Expand Down Expand Up @@ -681,7 +701,15 @@ ::hierarchyConstraints(const Alignable *ali, const align::Alignables &aliComps,
}
for (unsigned int iParComp = 0; iParComp < aliCompSel.size(); ++iParComp) {
if (aliCompSel[iParComp]) {
const double factor = p2pDerivs(iParMast, iParComp);
double factor = 0.;
if( theTypeOfConstraints == HIERARCHY_CONSTRAINTS ) {
// hierachy constraints
factor = p2pDerivs(iParMast, iParComp);
} else if( theTypeOfConstraints == APPROX_AVERAGING_CONSTRAINTS ) {
// CHK poor mans averaging constraints
factor = p2pDerivs(iParMast, iParComp);
if (iParMast < 3 && (iParComp % 9) >= 3) factor = 0.;
}
if (fabs(factor) > epsilon) {
paramIdsVecOut[iParMastUsed].push_back(ParameterId(*iComp, iParComp));
factorsVecOut[iParMastUsed].push_back(factor);
Expand Down