#include <MillePedeAlignmentAlgorithm.h>
Public Member Functions | |
virtual void | endRun (const EventInfo &eventInfo, const EndRunInfo &runInfo, const edm::EventSetup &setup) |
Run on run products, e.g. TkLAS. More... | |
virtual void | initialize (const edm::EventSetup &setup, AlignableTracker *tracker, AlignableMuon *muon, AlignableExtras *extras, AlignmentParameterStore *store) |
Call at beginning of job. More... | |
MillePedeAlignmentAlgorithm (const edm::ParameterSet &cfg) | |
Constructor. More... | |
virtual void | run (const edm::EventSetup &setup, const EventInfo &eventInfo) |
Run the algorithm on trajectories and tracks. More... | |
virtual bool | setParametersForRunRange (const RunRange &runrange) |
virtual void | terminate () |
Call at end of job. More... | |
virtual | ~MillePedeAlignmentAlgorithm () |
Destructor. More... | |
Public Member Functions inherited from AlignmentAlgorithmBase | |
AlignmentAlgorithmBase (const edm::ParameterSet &cfg) | |
Constructor. More... | |
virtual void | beginLuminosityBlock (const edm::EventSetup &setup) |
called at begin of luminosity block (no lumi block info passed yet) More... | |
virtual void | beginRun (const edm::EventSetup &setup) |
called at begin of run More... | |
virtual void | endLuminosityBlock (const edm::EventSetup &setup) |
called at end of luminosity block (no lumi block info passed yet) More... | |
virtual void | endRun (const EndRunInfo &runInfo, const edm::EventSetup &setup) |
called at end of run - order of arguments like in EDProducer etc. More... | |
virtual void | startNewLoop () |
virtual | ~AlignmentAlgorithmBase () |
Destructor. More... | |
Private Types | |
enum | EModeBit { myMilleBit = 1 << 0, myPedeRunBit = 1 << 1, myPedeSteerBit = 1 << 2, myPedeReadBit = 1 << 3 } |
enum | MeasurementDirection { kLocalX = 0, kLocalY } |
Private Member Functions | |
unsigned int | addHitCount (const std::vector< AlignmentParameters * > &parVec, const std::vector< bool > &validHitVecY) const |
bool | addHits (const std::vector< Alignable * > &alis, const std::vector< AlignmentUserVariables * > &mpVars) const |
bool | addHitStatistics (int fromLoop, const std::string &outFile, const std::vector< std::string > &inFiles) const |
void | addLasBeam (const EventInfo &eventInfo, const TkFittedLasBeam &lasBeam, const std::vector< TrajectoryStateOnSurface > &tsoses) |
void | addLaserData (const EventInfo &eventInfo, const TkFittedLasBeamCollection &tkLasBeams, const TsosVectorCollection &tkLasBeamTsoses) |
int | addMeasurementData (const EventInfo &eventInfo, const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iHit, AlignmentParameters *¶ms) |
void | addPxbSurvey (const edm::ParameterSet &pxbSurveyCfg) |
add measurement data from PXB survey More... | |
std::pair< unsigned int, unsigned int > | addReferenceTrajectory (const EventInfo &eventInfo, const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr) |
fill mille for a trajectory, returning number of x/y hits ([0,0] if 'bad' trajectory) More... | |
void | addRefTrackData2D (const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iTrajHit, TMatrixDSym &aHitCovarianceM, TMatrixF &aHitResidualsM, TMatrixF &aLocalDerivativesM) |
adds data from reference trajectory from a specific Hit More... | |
void | addRefTrackVirtualMeas1D (const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iVirtualMeas, TMatrixDSym &aHitCovarianceM, TMatrixF &aHitResidualsM, TMatrixF &aLocalDerivativesM) |
adds data for a specific virtual measurement from reference trajectory More... | |
void | addVirtualMeas (const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iVirtualMeas) |
adds data for virtual measurements from reference trajectory More... | |
bool | areEmptyParams (const std::vector< Alignable * > &alignables) const |
void | buildUserVariables (const std::vector< Alignable * > &alignables) const |
add MillePedeVariables for each AlignmentParameters (exception if no parameters...) More... | |
int | callMille (const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iTrajHit, const std::vector< int > &globalLabels, const std::vector< float > &globalDerivativesX, const std::vector< float > &globalDerivativesY) |
calls callMille1D or callMille2D More... | |
int | callMille1D (const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iTrajHit, const std::vector< int > &globalLabels, const std::vector< float > &globalDerivativesX) |
calls Mille for 1D hits More... | |
int | callMille2D (const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iTrajHit, const std::vector< int > &globalLabels, const std::vector< float > &globalDerivativesx, const std::vector< float > &globalDerivativesy) |
unsigned int | decodeMode (const std::string &mode) const |
void | diagonalize (TMatrixDSym &aHitCovarianceM, TMatrixF &aLocalDerivativesM, TMatrixF &aHitResidualsM, TMatrixF &theGlobalDerivativesM) const |
unsigned int | doIO (int loop) const |
bool | globalDerivativesHierarchy (const EventInfo &eventInfo, const TrajectoryStateOnSurface &tsos, Alignable *ali, const AlignableDetOrUnitPtr &alidet, std::vector< float > &globalDerivativesX, std::vector< float > &globalDerivativesY, std::vector< int > &globalLabels, AlignmentParameters *&lowestParams) const |
recursively adding derivatives and labels, false if problems More... | |
bool | is2D (const TransientTrackingRecHit::ConstRecHitPointer &recHit) const |
true if hit belongs to 2D detector (currently tracker specific) More... | |
bool | isMode (unsigned int testMode) const |
void | makeGlobDerivMatrix (const std::vector< float > &globalDerivativesx, const std::vector< float > &globalDerivativesy, TMatrixF &aGlobalDerivativesM) |
bool | readFromPede (const edm::ParameterSet &mprespset, bool setUserVars, const RunRange &runrange) |
read pede input defined by 'psetName', flag to create/not create MillePedeVariables More... | |
Private Attributes | |
AlignableNavigator * | theAlignableNavigator |
std::vector< Alignable * > | theAlignables |
AlignmentParameterStore * | theAlignmentParameterStore |
directory for all kind of files More... | |
edm::ParameterSet | theConfig |
std::string | theDir |
bool | theDoSurveyPixelBarrel |
std::vector< float > | theFloatBufferX |
std::vector< float > | theFloatBufferY |
std::vector< int > | theIntBuffer |
int | theLastWrittenIov |
double | theMaximalCor2D |
Mille * | theMille |
unsigned int | theMinNumHits |
unsigned int | theMode |
MillePedeMonitor * | theMonitor |
const PedeLabelerBase * | thePedeLabels |
PedeSteerer * | thePedeSteer |
TrajectoryFactoryBase * | theTrajectoryFactory |
Additional Inherited Members | |
Public Types inherited from AlignmentAlgorithmBase | |
typedef std::pair< const Trajectory *, const reco::Track * > | ConstTrajTrackPair |
typedef std::vector < ConstTrajTrackPair > | ConstTrajTrackPairCollection |
typedef cond::RealTimeType < cond::runnumber >::type | RunNumber |
typedef std::pair< RunNumber, RunNumber > | RunRange |
CMSSW interface to pede: produces pede's binary input and steering file(s)
(last update by
)
Definition at line 52 of file MillePedeAlignmentAlgorithm.h.
|
private |
Enumerator | |
---|---|
myMilleBit | |
myPedeRunBit | |
myPedeSteerBit | |
myPedeReadBit |
Definition at line 180 of file MillePedeAlignmentAlgorithm.h.
|
private |
MillePedeAlignmentAlgorithm::MillePedeAlignmentAlgorithm | ( | const edm::ParameterSet & | cfg | ) |
Constructor.
Definition at line 78 of file MillePedeAlignmentAlgorithm.cc.
References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), isMode(), myMilleBit, theConfig, theDir, and theMille.
|
virtual |
Destructor.
Definition at line 100 of file MillePedeAlignmentAlgorithm.cc.
References theAlignableNavigator, theMille, theMonitor, thePedeLabels, thePedeSteer, and theTrajectoryFactory.
|
private |
Increase hit counting of MillePedeVariables behind each parVec[i] (and also for parameters higher in hierarchy), assuming 'parVec' and 'validHitVecY' to be parallel. Returns number of valid y-hits.
Definition at line 367 of file MillePedeAlignmentAlgorithm.cc.
References Alignable::alignmentParameters(), MillePedeVariables::increaseHitsX(), MillePedeVariables::increaseHitsY(), Alignable::mother(), and AlignmentParameters::userVariables().
Referenced by addReferenceTrajectory().
|
private |
Definition at line 730 of file MillePedeAlignmentAlgorithm.cc.
References MillePedeVariables::hitsX(), MillePedeVariables::hitsY(), MillePedeVariables::increaseHitsX(), MillePedeVariables::increaseHitsY(), MillePedeVariables::size(), and AlignmentParameters::userVariables().
Referenced by addHitStatistics().
|
private |
Definition at line 703 of file MillePedeAlignmentAlgorithm.cc.
References addHits(), i, MillePedeVariablesIORoot::readMillePedeVariables(), theAlignables, and theDir.
Referenced by doIO().
|
private |
Definition at line 1038 of file MillePedeAlignmentAlgorithm.cc.
References AlignableNavigator::alignableFromDetId(), funct::derivative(), TkFittedLasBeam::derivatives(), Mille::end(), error, TkFittedLasBeam::firstFixedParameter(), TkLasBeam::getBeamId(), TkLasBeam::getData(), SiStripLaserRecHit2D::getDetId(), globalDerivativesHierarchy(), PedeLabelerBase::lasBeamLabel(), SiStripLaserRecHit2D::localPosition(), Mille::mille(), PedeLabelerBase::parameterLabel(), TkFittedLasBeam::parameters(), theAlignableNavigator, theFloatBufferX, theFloatBufferY, theIntBuffer, theMille, thePedeLabels, and PV3DBase< T, PVType, FrameType >::x().
Referenced by addLaserData().
|
private |
Definition at line 1019 of file MillePedeAlignmentAlgorithm.cc.
References addLasBeam().
Referenced by endRun().
|
private |
If hit is usable: callMille for x and (probably) y direction. If globalDerivatives fine: returns 2 if 2D-hit, 1 if 1D-hit, 0 if no Alignable for hit. Returns -1 if any problem (for params cf. globalDerivativesHierarchy)
Definition at line 407 of file MillePedeAlignmentAlgorithm.cc.
References AlignableNavigator::alignableFromDetId(), callMille(), globalDerivativesHierarchy(), theAlignableNavigator, theFloatBufferX, theFloatBufferY, and theIntBuffer.
Referenced by addReferenceTrajectory().
|
private |
add measurement data from PXB survey
Definition at line 1084 of file MillePedeAlignmentAlgorithm.cc.
References a, AlignableNavigator::alignableFromDetId(), PedeLabelerBase::alignableLabel(), gather_cfg::cout, SurveyPxbDicer::doDice(), Mille::end(), lut2db_cfg::filename, MillePedeMonitor::fillPxbSurveyHistsChi2(), MillePedeMonitor::fillPxbSurveyHistsLocalPars(), edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, j, Mille::mille(), SurveyPxbImageLocalFit::nMsrmts, EdgesToViz::outfile, matplotRender::reader, mathSSE::sqrt(), Alignable::surface(), theAlignableNavigator, theMille, theMonitor, thePedeLabels, AlignableSurface::toGlobal(), and AlignableSurface::toLocal().
Referenced by initialize().
|
private |
fill mille for a trajectory, returning number of x/y hits ([0,0] if 'bad' trajectory)
Definition at line 322 of file MillePedeAlignmentAlgorithm.cc.
References addHitCount(), addMeasurementData(), addVirtualMeas(), Mille::end(), Mille::kill(), theMille, and theMinNumHits.
Referenced by run().
|
private |
adds data from reference trajectory from a specific Hit
Definition at line 818 of file MillePedeAlignmentAlgorithm.cc.
References i.
|
private |
adds data for a specific virtual measurement from reference trajectory
Definition at line 791 of file MillePedeAlignmentAlgorithm.cc.
References i.
|
private |
adds data for virtual measurements from reference trajectory
Definition at line 995 of file MillePedeAlignmentAlgorithm.cc.
Referenced by addReferenceTrajectory().
|
private |
Definition at line 583 of file MillePedeAlignmentAlgorithm.cc.
References AlignmentParameters::covariance(), i, j, and AlignmentParameters::parameters().
Referenced by readFromPede().
|
private |
add MillePedeVariables for each AlignmentParameters (exception if no parameters...)
Definition at line 665 of file MillePedeAlignmentAlgorithm.cc.
References PedeLabelerBase::alignableLabel(), edm::hlt::Exception, AlignmentParameters::setUserVariables(), AlignmentParameters::size(), and thePedeLabels.
Referenced by initialize().
|
private |
calls callMille1D or callMille2D
Definition at line 851 of file MillePedeAlignmentAlgorithm.cc.
Referenced by addMeasurementData().
|
private |
calls Mille for 1D hits
Definition at line 869 of file MillePedeAlignmentAlgorithm.cc.
References i.
|
private |
calls Mille for x and possibly y component of hit, y is skipped for non-real 2D (e.g. SiStripRecHit2D), for TID/TEC first diagonalises if correlation is larger than configurable
Definition at line 908 of file MillePedeAlignmentAlgorithm.cc.
References corr, pat::helper::ParametrizationHelper::dimension(), mathSSE::sqrt(), std::swap(), SiStripDetId::TEC, SiStripDetId::TID, and DetId::Tracker.
|
private |
Definition at line 679 of file MillePedeAlignmentAlgorithm.cc.
References edm::hlt::Exception, myMilleBit, myPedeReadBit, myPedeRunBit, and myPedeSteerBit.
|
private |
Definition at line 766 of file MillePedeAlignmentAlgorithm.cc.
|
private |
Definition at line 605 of file MillePedeAlignmentAlgorithm.cc.
References addHitStatistics(), edm::ParameterSet::getParameter(), python.cmstools::loop(), GetRecoTauVFromDQM_MC_cff::outFile, query::result, theAlignables, theConfig, theDir, AlignmentIORoot::writeAlignableAbsolutePositions(), AlignmentIORoot::writeAlignableOriginalPositions(), MillePedeVariablesIORoot::writeMillePedeVariables(), and AlignmentIORoot::writeOrigRigidBodyAlignmentParameters().
Referenced by setParametersForRunRange(), and terminate().
|
virtual |
Run on run products, e.g. TkLAS.
Definition at line 397 of file MillePedeAlignmentAlgorithm.cc.
References addLaserData(), AlignmentAlgorithmBase::EndRunInfo::tkLasBeams_, and AlignmentAlgorithmBase::EndRunInfo::tkLasBeamTsoses_.
|
private |
recursively adding derivatives and labels, false if problems
Definition at line 438 of file MillePedeAlignmentAlgorithm.cc.
References Alignable::alignmentParameters(), AlignmentParameters::derivatives(), Alignable::mother(), and AlignmentParameters::selector().
Referenced by addLasBeam(), and addMeasurementData().
|
virtual |
Call at beginning of job.
Implements AlignmentAlgorithmBase.
Definition at line 118 of file MillePedeAlignmentAlgorithm.cc.
References addPxbSurvey(), edm::ParameterSet::addUntrackedParameter(), AlignmentParameterStore::alignables(), AlignmentParameterStore::applyParameters(), PedeSteerer::buildSubSteer(), buildUserVariables(), relativeConstraints::empty, edm::hlt::Exception, edm::ParameterSet::exists(), reco::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), isMode(), myMilleBit, myPedeSteerBit, readFromPede(), AlignmentParameterStore::resetParameters(), cond::runnumber, findQualityFiles::size, theAlignableNavigator, theAlignables, theAlignmentParameterStore, theConfig, theDir, theDoSurveyPixelBarrel, theMonitor, thePedeLabels, thePedeSteer, theTrajectoryFactory, and cond::timeTypeSpecs.
|
private |
true if hit belongs to 2D detector (currently tracker specific)
Definition at line 527 of file MillePedeAlignmentAlgorithm.cc.
|
inlineprivate |
Definition at line 183 of file MillePedeAlignmentAlgorithm.h.
References theMode.
Referenced by initialize(), MillePedeAlignmentAlgorithm(), run(), setParametersForRunRange(), and terminate().
|
private |
Definition at line 753 of file MillePedeAlignmentAlgorithm.cc.
References i.
|
private |
read pede input defined by 'psetName', flag to create/not create MillePedeVariables
Definition at line 546 of file MillePedeAlignmentAlgorithm.cc.
References areEmptyParams(), dbtoconf::out, PedeReader::read(), matplotRender::reader, theAlignables, thePedeLabels, and thePedeSteer.
Referenced by initialize(), and setParametersForRunRange().
|
virtual |
Run the algorithm on trajectories and tracks.
Implements AlignmentAlgorithmBase.
Definition at line 284 of file MillePedeAlignmentAlgorithm.cc.
References addReferenceTrajectory(), AlignmentAlgorithmBase::EventInfo::beamSpot_, MillePedeMonitor::fillRefTrajectory(), MillePedeMonitor::fillTrack(), MillePedeMonitor::fillUsedTrack(), isMode(), myMilleBit, theMonitor, theTrajectoryFactory, testEve_cfg::tracks, TrajectoryFactoryBase::trajectories(), and AlignmentAlgorithmBase::EventInfo::trajTrackPairs_.
Referenced by Types.LuminosityBlockID::cppID().
|
virtual |
called in order to pass parameters to alignables for a specific run range in case the algorithm supports run range dependent alignment.
Reimplemented from AlignmentAlgorithmBase.
Definition at line 228 of file MillePedeAlignmentAlgorithm.cc.
References AlignmentParameterStore::applyParameters(), doIO(), edm::ParameterSet::getParameter(), isMode(), myPedeReadBit, readFromPede(), AlignmentParameterStore::resetParameters(), AlignmentParameterStore::restoreCachedTransformations(), theAlignmentParameterStore, theConfig, and theLastWrittenIov.
|
virtual |
Call at end of job.
Implements AlignmentAlgorithmBase.
Definition at line 251 of file MillePedeAlignmentAlgorithm.cc.
References PedeSteerer::buildMasterSteer(), AlignmentParameterStore::cacheTransformations(), doIO(), linker::files, edm::ParameterSet::getParameter(), i, isMode(), myMilleBit, myPedeRunBit, PedeSteerer::runPede(), theAlignmentParameterStore, theConfig, theDir, theLastWrittenIov, theMille, and thePedeSteer.
|
private |
Definition at line 194 of file MillePedeAlignmentAlgorithm.h.
Referenced by addLasBeam(), addMeasurementData(), addPxbSurvey(), initialize(), and ~MillePedeAlignmentAlgorithm().
|
private |
Definition at line 193 of file MillePedeAlignmentAlgorithm.h.
Referenced by addHitStatistics(), doIO(), initialize(), and readFromPede().
|
private |
directory for all kind of files
Definition at line 192 of file MillePedeAlignmentAlgorithm.h.
Referenced by initialize(), setParametersForRunRange(), and terminate().
|
private |
Definition at line 189 of file MillePedeAlignmentAlgorithm.h.
Referenced by doIO(), initialize(), MillePedeAlignmentAlgorithm(), setParametersForRunRange(), and terminate().
|
private |
Definition at line 191 of file MillePedeAlignmentAlgorithm.h.
Referenced by addHitStatistics(), doIO(), initialize(), MillePedeAlignmentAlgorithm(), and terminate().
|
private |
Definition at line 207 of file MillePedeAlignmentAlgorithm.h.
Referenced by initialize().
|
private |
Definition at line 204 of file MillePedeAlignmentAlgorithm.h.
Referenced by addLasBeam(), and addMeasurementData().
|
private |
Definition at line 205 of file MillePedeAlignmentAlgorithm.h.
Referenced by addLasBeam(), and addMeasurementData().
|
private |
Definition at line 206 of file MillePedeAlignmentAlgorithm.h.
Referenced by addLasBeam(), and addMeasurementData().
|
private |
maximal correlation allowed for 2D hit in TID/TEC. If larger, the 2D measurement gets diagonalized!!!
Definition at line 203 of file MillePedeAlignmentAlgorithm.h.
Referenced by setParametersForRunRange(), and terminate().
|
private |
Definition at line 201 of file MillePedeAlignmentAlgorithm.h.
|
private |
Definition at line 196 of file MillePedeAlignmentAlgorithm.h.
Referenced by addLasBeam(), addPxbSurvey(), addReferenceTrajectory(), MillePedeAlignmentAlgorithm(), terminate(), and ~MillePedeAlignmentAlgorithm().
|
private |
Definition at line 200 of file MillePedeAlignmentAlgorithm.h.
Referenced by addReferenceTrajectory().
|
private |
Definition at line 190 of file MillePedeAlignmentAlgorithm.h.
Referenced by isMode().
|
private |
Definition at line 195 of file MillePedeAlignmentAlgorithm.h.
Referenced by addPxbSurvey(), initialize(), run(), and ~MillePedeAlignmentAlgorithm().
|
private |
Definition at line 197 of file MillePedeAlignmentAlgorithm.h.
Referenced by addLasBeam(), addPxbSurvey(), buildUserVariables(), initialize(), readFromPede(), and ~MillePedeAlignmentAlgorithm().
|
private |
Definition at line 198 of file MillePedeAlignmentAlgorithm.h.
Referenced by initialize(), readFromPede(), terminate(), and ~MillePedeAlignmentAlgorithm().
|
private |
Definition at line 199 of file MillePedeAlignmentAlgorithm.h.
Referenced by initialize(), run(), and ~MillePedeAlignmentAlgorithm().