#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 | |
edm::ParameterSet | myConfig |
pointer to labeler (not the owner) More... | |
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 35 of file PedeSteerer.h.
|
private |
Definition at line 69 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 54 of file PedeSteerer.cc.
References Alignable::addComponent(), AlignmentParameterStore::alignables(), checkParameterChoices(), AlignableExtras::components(), correctToReferenceSystem(), edm::hlt::Exception, Alignable::globalPosition(), Alignable::id(), align::invalid, isCorrectToRefSystem(), GloballyPositioned< T >::move(), myDirectory, myParameterSign, myParameterStore, selectCoordinateAlis(), Alignable::surface(), theCoordDefiners, theCoordMaster, 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 127 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 754 of file PedeSteerer.cc.
References createSteerFile(), fileName(), edm::ParameterSet::getParameter(), i, myConfig, mySteeringFiles, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by MillePedeAlignmentAlgorithm::terminate().
|
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 160 of file PedeSteerer.cc.
References Alignable::alignmentParameters(), edm::hlt::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 673 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.
Referenced by MillePedeAlignmentAlgorithm::initialize().
|
private |
Checks whether SelectionUserVariables that might be attached to alis' AlignmentParameters (these must exist) are all known.
Definition at line 202 of file PedeSteerer.cc.
References edm::hlt::Exception, SelectionUserVariables::fullSelection(), EgammaValidation_Wenu_cff::sel, AlignmentParameters::size(), and AlignmentParameters::userVariables().
Referenced by PedeSteerer().
double PedeSteerer::cmsToPedeFactor | ( | unsigned int | parNum | ) | const |
Definition at line 139 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 394 of file PedeSteerer.cc.
References AlCaHLTBitMon_QueryRunRegistry::comp, alignCSCRings::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 642 of file PedeSteerer.cc.
References edm::hlt::Exception, myNoSteerFiles, mySteeringFiles, dbtoconf::out, query::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(), edm::hlt::Exception, hierarchyConstraint(), myIsSteerFileDebug, and Alignable::setAlignmentParameters().
Referenced by buildSubSteer().
|
inline |
directory from constructor input, '/' is attached if needed
Definition at line 66 of file PedeSteerer.h.
References myDirectory.
Referenced by PedeReader::PedeReader().
|
private |
full name with directory and 'idenitfier'
Definition at line 661 of file PedeSteerer.cc.
References edm::ParameterSet::getParameter(), myConfig, myDirectory, mergeVDriftHistosByStation::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(), edm::hlt::Exception, mergeVDriftHistosByStation::file, Alignable::globalPosition(), Alignable::id(), AlignmentParametersFactory::kRigidBody, myIsSteerFileDebug, myLabels, PedeLabelerBase::parameterLabel(), AlignmentParameters::parameters(), parameterSign(), position, query::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 230 of file PedeSteerer.cc.
References fileName(), fixParameter(), SelectionUserVariables::fullSelection(), myLabels, PedeLabelerBase::numberOfParameterInstances(), AlignmentParameters::size(), and AlignmentParameters::userVariables().
Referenced by buildSubSteer().
|
private |
Definition at line 478 of file PedeSteerer.cc.
References PedeLabelerBase::alignableLabel(), Alignable::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 442 of file PedeSteerer.cc.
References createSteerFile(), hierarchyConstraint(), and AlignableObjectId::idToString().
Referenced by buildSubSteer().
bool PedeSteerer::isCorrectToRefSystem | ( | const std::vector< Alignable * > & | coordDefiners | ) | const |
Definition at line 368 of file PedeSteerer.cc.
References edm::hlt::Exception, SelectionUserVariables::fullSelection(), and 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 133 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 64 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 548 of file PedeSteerer.cc.
References AlignmentParameterSelector::addSelections(), AlignmentParameterSelector::clear(), edm::hlt::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 593 of file PedeSteerer.cc.
References PedeLabelerBase::alignableLabel(), 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 794 of file PedeSteerer.cc.
References edmPickEvents::command, hcal_timing_source_file_cfg::dump, edm::ParameterSet::getUntrackedParameter(), myConfig, myDirectory, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by MillePedeAlignmentAlgorithm::terminate().
|
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 303 of file PedeSteerer.cc.
References Alignable::alignmentParameters(), edm::hlt::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 buildMasterSteer(), buildSubSteer(), fileName(), and runPede().
|
private |
Definition at line 119 of file PedeSteerer.h.
Referenced by directory(), fileName(), PedeSteerer(), and runPede().
|
private |
flag to write steering files to /dev/null
Definition at line 121 of file PedeSteerer.h.
Referenced by defineCoordinates(), fixParameter(), hierarchyConstraint(), and presigmasFile().
|
private |
not the owner!
Definition at line 116 of file PedeSteerer.h.
Referenced by buildSubSteer(), fixParameter(), fixParameters(), hierarchyConstraint(), and presigmasFile().
|
private |
keeps track of created 'secondary' steering files
Definition at line 129 of file PedeSteerer.h.
Referenced by buildNoHierarchyCollection(), buildSubSteer(), and isNoHiera().
|
private |
directory of all files
Definition at line 120 of file PedeSteerer.h.
Referenced by createSteerFile().
|
private |
whether or not to fill pede steering files with debug info
Definition at line 122 of file PedeSteerer.h.
Referenced by parameterSign(), and PedeSteerer().
|
private |
Definition at line 115 of file PedeSteerer.h.
Referenced by buildSubSteer(), hierarchyConstraint(), and PedeSteerer().
|
private |
precision for writing constraints to text file
Definition at line 127 of file PedeSteerer.h.
Referenced by buildMasterSteer(), and createSteerFile().
|
private |
hierarchy constraints with less params are ignored
Definition at line 125 of file PedeSteerer.h.
Referenced by hierarchyConstraint().
|
private |
master coordinates, must (?) be global frame
Definition at line 131 of file PedeSteerer.h.
Referenced by buildSubSteer(), correctToReferenceSystem(), and PedeSteerer().
|
private |
Alignables deselected for hierarchy constr.
Definition at line 130 of file PedeSteerer.h.
Referenced by buildSubSteer(), correctToReferenceSystem(), and PedeSteerer().
|
private |
old pede versions (before May '07) need a sign flip...
Definition at line 123 of file PedeSteerer.h.
Referenced by hierarchyConstraint().
|
private |
min absolute value of coefficients in hierarchy constraints
Definition at line 124 of file PedeSteerer.h.
Referenced by hierarchyConstraint().