#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 std::vector< Alignable * > &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 std::vector< Alignable * > &alis) |
bool | checkParameterChoices (const std::vector< Alignable * > &alis) 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 std::vector< Alignable * > &alis, 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 std::vector< Alignable * > &alignables, const std::string &file) |
void | hierarchyConstraint (const Alignable *ali, const std::vector< Alignable * > &components, std::ofstream &file) const |
unsigned int | hierarchyConstraints (const std::vector< Alignable * > &alis, const std::string &file) |
unsigned int | presigmas (const std::vector< edm::ParameterSet > &cffPresi, const std::string &fileName, const std::vector< Alignable * > &alis, AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras) |
interprete content of presigma VPSet 'cffPresi' and call presigmasFile More... | |
unsigned int | presigmasFile (const std::string &fileName, const std::vector< Alignable * > &alis, const AlignablePresigmasMap &aliPresisMap) |
look for active 'alis' in map of presigma values and create steering file More... | |
std::vector< Alignable * > | selectCoordinateAlis (const std::vector< Alignable * > &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... | |
std::vector< Alignable * > | 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 70 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 Alignable::addComponent(), AlignmentParameterStore::alignables(), checkParameterChoices(), AlignableObjectId::commonObjectIdProvider(), correctToReferenceSystem(), Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), Alignable::globalPosition(), align::invalid, isCorrectToRefSystem(), GloballyPositioned< T >::move(), myConfig, myDirectory, myIsSteerFileDebug, myNoSteerFiles, myParameterSign, myParameterStore, selectCoordinateAlis(), AlCaHLTBitMon_QueryRunRegistry::string, Alignable::surface(), theConstrPrecision, theCoordDefiners, theCoordMaster, theMinHieraConstrCoeff, theMinHieraParPerConstr, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
PedeSteerer::~PedeSteerer | ( | ) |
non-virtual destructor: do not inherit from this class
Definition at line 128 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 751 of file PedeSteerer.cc.
References createSteerFile(), fileName(), edm::ParameterSet::getParameter(), mps_fire::i, myConfig, mySteeringFiles, 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 Alignable::alignmentParameters(), Exception, SelectionUserVariables::fullSelection(), Alignable::mother(), myNoHieraCollection, AlignmentParameters::size(), and AlignmentParameters::userVariables().
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 674 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 203 of file PedeSteerer.cc.
References Exception, SelectionUserVariables::fullSelection(), AlignmentParameters::size(), and AlignmentParameters::userVariables().
Referenced by PedeSteerer().
double PedeSteerer::cmsToPedeFactor | ( | unsigned int | parNum | ) | const |
Definition at line 140 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 395 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().
Referenced by PedeSteerer().
|
private |
create and open file with name, if (addToList) append to mySteeringFiles
Definition at line 643 of file PedeSteerer.cc.
References Exception, myNoSteerFiles, mySteeringFiles, 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 347 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 67 of file PedeSteerer.h.
References myDirectory.
Referenced by PedeReader::PedeReader().
|
private |
full name with directory and 'idenitfier'
Definition at line 662 of file PedeSteerer.cc.
References edm::ParameterSet::getParameter(), myConfig, myDirectory, dataset::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 265 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 231 of file PedeSteerer.cc.
References fileName(), fixParameter(), SelectionUserVariables::fullSelection(), myLabels, PedeLabelerBase::numberOfParameterInstances(), AlignmentParameters::size(), and AlignmentParameters::userVariables().
Referenced by buildSubSteer().
|
private |
Definition at line 479 of file PedeSteerer.cc.
References PedeLabelerBase::alignableLabel(), Alignable::alignableObjectId(), alignableObjectId_, plotBeamSpotDB::first, Alignable::globalPosition(), AlignmentParameterStore::hierarchyConstraints(), AlignableObjectId::idToString(), isNoHiera(), myIsSteerFileDebug, myLabels, myParameterStore, PedeLabelerBase::parameterLabel(), PV3DBase< T, PVType, FrameType >::perp(), theConstrPrecision, theMinHieraConstrCoeff, and theMinHieraParPerConstr.
Referenced by defineCoordinates(), and hierarchyConstraints().
|
private |
Definition at line 443 of file PedeSteerer.cc.
References alignableObjectId_, createSteerFile(), hierarchyConstraint(), and AlignableObjectId::idToString().
Referenced by buildSubSteer().
bool PedeSteerer::isCorrectToRefSystem | ( | const std::vector< Alignable * > & | coordDefiners | ) | const |
Definition at line 369 of file PedeSteerer.cc.
References Exception, SelectionUserVariables::fullSelection(), and mps_fire::i.
Referenced by PedeSteerer().
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 134 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 65 of file PedeSteerer.h.
References myParameterSign.
Referenced by fixParameter(), PedeReader::setCalibrationParameter(), and PedeReader::setParameter().
|
private |
interprete content of presigma VPSet 'cffPresi' and call presigmasFile
Definition at line 549 of file PedeSteerer.cc.
References AlignmentParameterSelector::addSelections(), alignableObjectId_, AlignmentParameterSelector::clear(), Exception, AlignableObjectId::idToString(), presigmasFile(), AlignmentParameterSelector::selectedAlignables(), and AlignmentParameterSelector::selectedParameters().
Referenced by buildSubSteer(), and presigmasFile().
|
private |
look for active 'alis' in map of presigma values and create steering file
Definition at line 594 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 791 of file PedeSteerer.cc.
References mps_alisetup::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 Alignable::alignmentParameters(), Exception, SelectionUserVariables::fullSelection(), Alignable::mother(), AlignmentParameters::size(), and AlignmentParameters::userVariables().
Referenced by PedeSteerer().
|
private |
pointer to labeler (not the owner)
Definition at line 118 of file PedeSteerer.h.
Referenced by hierarchyConstraint(), hierarchyConstraints(), presigmas(), and presigmasFile().
|
private |
Definition at line 120 of file PedeSteerer.h.
Referenced by buildMasterSteer(), buildSubSteer(), fileName(), PedeSteerer(), and runPede().
|
private |
Definition at line 121 of file PedeSteerer.h.
Referenced by directory(), fileName(), PedeSteerer(), and runPede().
|
private |
flag to write steering files to /dev/null
Definition at line 123 of file PedeSteerer.h.
Referenced by defineCoordinates(), fixParameter(), hierarchyConstraint(), PedeSteerer(), and presigmasFile().
|
private |
not the owner!
Definition at line 117 of file PedeSteerer.h.
Referenced by buildSubSteer(), fixParameter(), fixParameters(), hierarchyConstraint(), and presigmasFile().
|
private |
keeps track of created 'secondary' steering files
Definition at line 131 of file PedeSteerer.h.
Referenced by buildNoHierarchyCollection(), buildSubSteer(), and isNoHiera().
|
private |
directory of all files
Definition at line 122 of file PedeSteerer.h.
Referenced by createSteerFile(), and PedeSteerer().
|
private |
whether or not to fill pede steering files with debug info
Definition at line 124 of file PedeSteerer.h.
Referenced by parameterSign(), and PedeSteerer().
|
private |
Definition at line 116 of file PedeSteerer.h.
Referenced by buildSubSteer(), hierarchyConstraint(), and PedeSteerer().
|
private |
precision for writing constraints to text file
Definition at line 129 of file PedeSteerer.h.
Referenced by buildMasterSteer(), and createSteerFile().
|
private |
hierarchy constraints with less params are ignored
Definition at line 127 of file PedeSteerer.h.
Referenced by hierarchyConstraint(), and PedeSteerer().
|
private |
master coordinates, must (?) be global frame
Definition at line 133 of file PedeSteerer.h.
Referenced by buildSubSteer(), correctToReferenceSystem(), and PedeSteerer().
|
private |
Alignables deselected for hierarchy constr.
Definition at line 132 of file PedeSteerer.h.
Referenced by buildSubSteer(), correctToReferenceSystem(), and PedeSteerer().
|
private |
old pede versions (before May '07) need a sign flip...
Definition at line 125 of file PedeSteerer.h.
Referenced by hierarchyConstraint(), and PedeSteerer().
|
private |
min absolute value of coefficients in hierarchy constraints
Definition at line 126 of file PedeSteerer.h.
Referenced by hierarchyConstraint(), and PedeSteerer().