#include <PedeSteerer.h>
Public Member Functions | |
std::string | buildMasterSteer (const std::vector< std::string > &binaryFiles) |
construct (and return name of) master steering file from config, binaryFiles etc. More... | |
void | buildSubSteer (AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras) |
construct steering files about hierarchy, fixing etc. an keep track of their names More... | |
double | cmsToPedeFactor (unsigned int parNum) const |
void | correctToReferenceSystem () |
const std::string & | directory () const |
directory from constructor input, '/' is attached if needed More... | |
bool | isCorrectToRefSystem (const align::Alignables &coordDefiners) const |
bool | isNoHiera (const Alignable *ali) const |
True if 'ali' was deselected from hierarchy and any ancestor (e.g. mother) has parameters. More... | |
int | parameterSign () const |
results from pede (and start values for pede) might need a sign flip More... | |
PedeSteerer (AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras, AlignmentParameterStore *store, const PedeLabelerBase *labels, const edm::ParameterSet &config, const std::string &defaultDir, bool noSteerFiles) | |
int | runPede (const std::string &masterSteer) const |
run pede, masterSteer should be as returned from buildMasterSteer(...) More... | |
~PedeSteerer () | |
Private Types | |
typedef std::map< const Alignable *, std::vector< float > > | AlignablePresigmasMap |
Private Member Functions | |
unsigned int | buildNoHierarchyCollection (const align::Alignables &) |
bool | checkParameterChoices (const align::Alignables &) const |
std::ofstream * | createSteerFile (const std::string &name, bool addToList) |
create and open file with name, if (addToList) append to mySteeringFiles More... | |
void | defineCoordinates (const align::Alignables &, Alignable *aliMaster, const std::string &fileName) |
std::string | fileName (const std::string &addendum) const |
full name with directory and 'idenitfier' More... | |
int | fixParameter (Alignable *ali, unsigned int iRunRange, unsigned int iParam, char selector, std::ofstream *&filePtr, const std::string &fileName) |
std::pair< unsigned int, unsigned int > | fixParameters (const align::Alignables &, const std::string &file) |
void | hierarchyConstraint (const Alignable *ali, const align::Alignables &components, std::ofstream &file) const |
unsigned int | hierarchyConstraints (const align::Alignables &, const std::string &file) |
unsigned int | presigmas (const std::vector< edm::ParameterSet > &cffPresi, const std::string &fileName, const align::Alignables &, AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras) |
interprete content of presigma VPSet 'cffPresi' and call presigmasFile More... | |
unsigned int | presigmasFile (const std::string &fileName, const align::Alignables &, const AlignablePresigmasMap &aliPresisMap) |
look for active 'alis' in map of presigma values and create steering file More... | |
align::Alignables | selectCoordinateAlis (const align::Alignables &) const |
Private Attributes | |
const AlignableObjectId | alignableObjectId_ |
pointer to labeler (not the owner) More... | |
const edm::ParameterSet | myConfig |
std::string | myDirectory |
bool | myIsSteerFileDebug |
flag to write steering files to /dev/null More... | |
const PedeLabelerBase * | myLabels |
not the owner! More... | |
std::set< const Alignable * > | myNoHieraCollection |
keeps track of created 'secondary' steering files More... | |
bool | myNoSteerFiles |
directory of all files More... | |
int | myParameterSign |
whether or not to fill pede steering files with debug info More... | |
const AlignmentParameterStore * | myParameterStore |
std::vector< std::string > | mySteeringFiles |
precision for writing constraints to text file More... | |
unsigned int | theConstrPrecision |
hierarchy constraints with less params are ignored More... | |
align::Alignables | theCoordDefiners |
master coordinates, must (?) be global frame More... | |
Alignable * | theCoordMaster |
Alignables deselected for hierarchy constr. More... | |
double | theMinHieraConstrCoeff |
old pede versions (before May '07) need a sign flip... More... | |
unsigned int | theMinHieraParPerConstr |
min absolute value of coefficients in hierarchy constraints More... | |
provides steering for pede according to configuration
(last update by
)
Definition at line 36 of file PedeSteerer.h.
|
private |
Definition at line 72 of file PedeSteerer.h.
PedeSteerer::PedeSteerer | ( | AlignableTracker * | aliTracker, |
AlignableMuon * | aliMuon, | ||
AlignableExtras * | aliExtras, | ||
AlignmentParameterStore * | store, | ||
const PedeLabelerBase * | labels, | ||
const edm::ParameterSet & | config, | ||
const std::string & | defaultDir, | ||
bool | noSteerFiles | ||
) |
constructor from AlignableTracker/AlignableMuon, their AlignmentParameterStore and the labeler (NOTE: The latter two must live longer than the constructed PedeSteerer!)
Definition at line 53 of file PedeSteerer.cc.
References AlignableObjectId::commonObjectIdProvider().
PedeSteerer::~PedeSteerer | ( | ) |
non-virtual destructor: do not inherit from this class
Definition at line 131 of file PedeSteerer.cc.
std::string PedeSteerer::buildMasterSteer | ( | const std::vector< std::string > & | binaryFiles | ) |
construct (and return name of) master steering file from config, binaryFiles etc.
Definition at line 746 of file PedeSteerer.cc.
References createSteerFile(), fileName(), edm::ParameterSet::getParameter(), mps_fire::i, myConfig, mySteeringFiles, runTheMatrix::opt, and AlCaHLTBitMon_QueryRunRegistry::string.
|
private |
Store Alignables that have SelectionUserVariables attached to their AlignmentParameters (these must exist) that indicate removal from hierarchy, i.e. make it 'top level'.
Definition at line 161 of file PedeSteerer.cc.
References Exception, SelectionUserVariables::fullSelection(), myNoHieraCollection, and CalibrationSummaryClient_cfi::params.
Referenced by buildSubSteer().
void PedeSteerer::buildSubSteer | ( | AlignableTracker * | aliTracker, |
AlignableMuon * | aliMuon, | ||
AlignableExtras * | aliExtras | ||
) |
construct steering files about hierarchy, fixing etc. an keep track of their names
Definition at line 668 of file PedeSteerer.cc.
References AlignmentParameterStore::alignables(), buildNoHierarchyCollection(), PedeSteererWeakModeConstraints::constructConstraints(), defineCoordinates(), fileName(), fixParameters(), PedeSteererWeakModeConstraints::getConfigData(), edm::ParameterSet::getParameter(), hierarchyConstraints(), myConfig, myLabels, myNoHieraCollection, myParameterStore, presigmas(), AlCaHLTBitMon_QueryRunRegistry::string, theCoordDefiners, and theCoordMaster.
|
private |
Checks whether SelectionUserVariables that might be attached to alis' AlignmentParameters (these must exist) are all known.
Definition at line 205 of file PedeSteerer.cc.
References Exception, SelectionUserVariables::fullSelection(), EgammaValidation_Wenu_cff::sel, AlignmentParameters::size(), and AlignmentParameters::userVariables().
double PedeSteerer::cmsToPedeFactor | ( | unsigned int | parNum | ) | const |
Definition at line 141 of file PedeSteerer.cc.
References RigidBodyAlignmentParameters::dalpha, RigidBodyAlignmentParameters::dbeta, RigidBodyAlignmentParameters::dgamma, RigidBodyAlignmentParameters::dx, RigidBodyAlignmentParameters::dy, and RigidBodyAlignmentParameters::dz.
Referenced by fixParameter(), presigmasFile(), and PedeReader::setParameter().
void PedeSteerer::correctToReferenceSystem | ( | ) |
If reference alignables have been configured, shift everything such that mean position and orientation of dets in these alignables are zero.
Definition at line 393 of file PedeSteerer.cc.
References AlCaHLTBitMon_QueryRunRegistry::comp, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, MillePedeFileConverter_cfg::e, Alignable::move(), Alignable::rotateInGlobalFrame(), theCoordDefiners, theCoordMaster, and align::toMatrix().
|
private |
create and open file with name, if (addToList) append to mySteeringFiles
Definition at line 642 of file PedeSteerer.cc.
References Exception, myNoSteerFiles, mySteeringFiles, Skims_PA_cff::name, MillePedeFileConverter_cfg::out, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by buildMasterSteer(), defineCoordinates(), fixParameter(), hierarchyConstraints(), and presigmasFile().
|
private |
Create steering file with constraints defining coordinate system via hierarchy constraints between 'aliMaster' and 'alis'; 'aliMaster' must not have parameters: would not make sense!
Definition at line 346 of file PedeSteerer.cc.
References Alignable::alignmentParameters(), createSteerFile(), Exception, hierarchyConstraint(), myIsSteerFileDebug, and Alignable::setAlignmentParameters().
Referenced by buildSubSteer().
|
inline |
directory from constructor input, '/' is attached if needed
Definition at line 69 of file PedeSteerer.h.
Referenced by PedeReader::PedeReader().
|
private |
full name with directory and 'idenitfier'
Definition at line 658 of file PedeSteerer.cc.
References edm::ParameterSet::getParameter(), myConfig, myDirectory, Skims_PA_cff::name, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by buildMasterSteer(), buildSubSteer(), and fixParameters().
|
private |
If 'selector' means fixing, create corresponding steering file line in file pointed to by 'filePtr'. If 'filePtr == 0' create file with name 'fileName' (and return pointer via reference).
Definition at line 264 of file PedeSteerer.cc.
References PedeLabelerBase::alignableLabelFromParamAndInstance(), Alignable::alignmentParameters(), cmsToPedeFactor(), createSteerFile(), Exception, FrontierConditions_GlobalTag_cff::file, Alignable::globalPosition(), Alignable::id(), AlignmentParametersFactory::kRigidBody, myIsSteerFileDebug, myLabels, PedeLabelerBase::parameterLabel(), AlignmentParameters::parameters(), parameterSign(), position, mps_fire::result, and AlignmentParameters::type().
Referenced by fixParameters().
|
private |
Checks whether 'alignables' have SelectionUserVariables attached to their AlignmentParameters (these must exist) that indicate fixation of a parameter, a steering 'file' is created accordingly. Returns number of parameters fixed at 0 and at 'nominal truth'.
Definition at line 232 of file PedeSteerer.cc.
References fileName(), fixParameter(), SelectionUserVariables::fullSelection(), myLabels, PedeLabelerBase::numberOfParameterInstances(), and CalibrationSummaryClient_cfi::params.
Referenced by buildSubSteer().
|
private |
Definition at line 474 of file PedeSteerer.cc.
References PedeLabelerBase::alignableLabel(), Alignable::alignableObjectId(), alignableObjectId_, makeMuonMisalignmentScenario::components, FrontierConditions_GlobalTag_cff::file, Alignable::globalPosition(), AlignmentParameterStore::hierarchyConstraints(), AlignableObjectId::idToString(), isNoHiera(), myIsSteerFileDebug, myLabels, myParameterStore, PedeLabelerBase::parameterLabel(), volumeBasedMagneticField_160812_cfi::paramLabel, PV3DBase< T, PVType, FrameType >::perp(), theConstrPrecision, theMinHieraConstrCoeff, and theMinHieraParPerConstr.
Referenced by defineCoordinates(), and hierarchyConstraints().
|
private |
Definition at line 440 of file PedeSteerer.cc.
References alignableObjectId_, createSteerFile(), hierarchyConstraint(), and AlignableObjectId::idToString().
Referenced by buildSubSteer().
bool PedeSteerer::isCorrectToRefSystem | ( | const align::Alignables & | coordDefiners | ) | const |
Definition at line 366 of file PedeSteerer.cc.
References Exception, SelectionUserVariables::fullSelection(), and mps_fire::i.
bool PedeSteerer::isNoHiera | ( | const Alignable * | ali | ) | const |
True if 'ali' was deselected from hierarchy and any ancestor (e.g. mother) has parameters.
Definition at line 136 of file PedeSteerer.cc.
References myNoHieraCollection.
Referenced by hierarchyConstraint().
|
inline |
results from pede (and start values for pede) might need a sign flip
Definition at line 67 of file PedeSteerer.h.
Referenced by fixParameter(), PedeReader::setCalibrationParameter(), and PedeReader::setParameter().
|
private |
interprete content of presigma VPSet 'cffPresi' and call presigmasFile
Definition at line 542 of file PedeSteerer.cc.
References AlignmentParameterSelector::addSelections(), alignableObjectId_, AlignmentParameterSelector::clear(), Exception, AlignableObjectId::idToString(), presigmasFile(), AlignmentParameterSelector::selectedAlignables(), AlignmentParameterSelector::selectedParameters(), and nanoDQM_cfi::sels.
Referenced by buildSubSteer(), and presigmasFile().
|
private |
look for active 'alis' in map of presigma values and create steering file
Definition at line 591 of file PedeSteerer.cc.
References PedeLabelerBase::alignableLabel(), alignableObjectId_, cmsToPedeFactor(), createSteerFile(), SelectionUserVariables::fullSelection(), AlignableObjectId::idToString(), myIsSteerFileDebug, myLabels, PedeLabelerBase::parameterLabel(), and presigmas().
Referenced by presigmas().
int PedeSteerer::runPede | ( | const std::string & | masterSteer | ) | const |
run pede, masterSteer should be as returned from buildMasterSteer(...)
Definition at line 784 of file PedeSteerer.cc.
References mps_check::command, FrontierConditions_GlobalTag_cff::dump, edm::ParameterSet::getUntrackedParameter(), myConfig, myDirectory, and AlCaHLTBitMon_QueryRunRegistry::string.
|
private |
Return 'alignables' that have SelectionUserVariables attached to their AlignmentParameters (these must exist) that indicate a definition of a coordinate system. Throws if ill defined reference objects.
Definition at line 304 of file PedeSteerer.cc.
References Exception, SelectionUserVariables::fullSelection(), and CalibrationSummaryClient_cfi::params.
|
private |
pointer to labeler (not the owner)
Definition at line 124 of file PedeSteerer.h.
Referenced by hierarchyConstraint(), hierarchyConstraints(), presigmas(), and presigmasFile().
|
private |
Definition at line 126 of file PedeSteerer.h.
Referenced by buildMasterSteer(), buildSubSteer(), fileName(), and runPede().
|
private |
Definition at line 127 of file PedeSteerer.h.
Referenced by fileName(), and runPede().
|
private |
flag to write steering files to /dev/null
Definition at line 129 of file PedeSteerer.h.
Referenced by defineCoordinates(), fixParameter(), hierarchyConstraint(), and presigmasFile().
|
private |
not the owner!
Definition at line 123 of file PedeSteerer.h.
Referenced by buildSubSteer(), fixParameter(), fixParameters(), hierarchyConstraint(), and presigmasFile().
|
private |
keeps track of created 'secondary' steering files
Definition at line 137 of file PedeSteerer.h.
Referenced by buildNoHierarchyCollection(), buildSubSteer(), and isNoHiera().
|
private |
directory of all files
Definition at line 128 of file PedeSteerer.h.
Referenced by createSteerFile().
|
private |
whether or not to fill pede steering files with debug info
Definition at line 130 of file PedeSteerer.h.
|
private |
Definition at line 122 of file PedeSteerer.h.
Referenced by buildSubSteer(), and hierarchyConstraint().
|
private |
precision for writing constraints to text file
Definition at line 135 of file PedeSteerer.h.
Referenced by buildMasterSteer(), and createSteerFile().
|
private |
hierarchy constraints with less params are ignored
Definition at line 133 of file PedeSteerer.h.
Referenced by hierarchyConstraint().
|
private |
master coordinates, must (?) be global frame
Definition at line 139 of file PedeSteerer.h.
Referenced by buildSubSteer(), and correctToReferenceSystem().
|
private |
Alignables deselected for hierarchy constr.
Definition at line 138 of file PedeSteerer.h.
Referenced by buildSubSteer(), and correctToReferenceSystem().
|
private |
old pede versions (before May '07) need a sign flip...
Definition at line 131 of file PedeSteerer.h.
Referenced by hierarchyConstraint().
|
private |
min absolute value of coefficients in hierarchy constraints
Definition at line 132 of file PedeSteerer.h.
Referenced by hierarchyConstraint().