CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes
PedeLabelerBase Class Referenceabstract

#include <PedeLabelerBase.h>

Inheritance diagram for PedeLabelerBase:
MomentumDependentPedeLabeler PedeLabeler RunRangeDependentPedeLabeler

Classes

class  TopLevelAlignables
 

Public Types

using RunNumber = align::RunNumber
 
using RunRange = align::RunRange
 
using RunRanges = align::RunRanges
 

Public Member Functions

virtual void addCalibrations (const std::vector< IntegratedCalibrationBase * > &iCals)
 tell labeler to treat also integrated calibrations More...
 
const AlignableExtrasalignableExtras () const
 
virtual AlignablealignableFromLabel (unsigned int label) const =0
 
virtual unsigned int alignableLabel (Alignable *alignable) const =0
 
virtual unsigned int alignableLabelFromLabel (unsigned int label) const =0
 alignable label from parameter label (works also for alignable label...) More...
 
virtual unsigned int alignableLabelFromParamAndInstance (Alignable *alignable, unsigned int param, unsigned int instance) const =0
 
const AlignableMuonalignableMuon () const
 
const AlignableTrackeralignableTracker () const
 
virtual unsigned int calibrationLabel (const IntegratedCalibrationBase *calib, unsigned int paramNum) const
 label for parameter 'paramNum' (counted from 0) of an integrated calibration More...
 
virtual std::pair< IntegratedCalibrationBase *, unsigned int > calibrationParamFromLabel (unsigned int label) const
 
virtual unsigned int firstFreeLabel () const
 
virtual bool hasSplitParameters (Alignable *alignable) const =0
 returns true if the alignable has parameters that are split into various bins More...
 
virtual unsigned int lasBeamIdFromLabel (unsigned int label) const =0
 
virtual unsigned int lasBeamLabel (unsigned int lasBeamId) const =0
 
virtual unsigned int maxNumberOfParameterInstances () const =0
 returns the maximum number of instances for any parameter of an Alignable* More...
 
virtual unsigned int numberOfParameterInstances (Alignable *alignable, int param=-1) const =0
 returns the number of instances for a given parameter More...
 
unsigned int parameterInstanceOffset () const
 offset in labels between consecutive parameter instances of Alignable*s More...
 
virtual unsigned int parameterLabel (Alignable *alignable, unsigned int parNum, const AlignmentAlgorithmBase::EventInfo &eventInfo, const TrajectoryStateOnSurface &tsos) const =0
 
virtual unsigned int parameterLabel (unsigned int aliLabel, unsigned int parNum) const =0
 returns the label for a given alignable parameter number combination More...
 
virtual unsigned int paramNumFromLabel (unsigned int paramLabel) const =0
 parameter number, 0 <= .. < theMaxNumParam, belonging to unique parameter label More...
 
 PedeLabelerBase (const TopLevelAlignables &alignables, const edm::ParameterSet &config)
 constructor from three Alignables (null pointers allowed ) More...
 
virtual const RunRangerunRangeFromLabel (unsigned int label) const
 
virtual ~PedeLabelerBase ()
 

Static Public Attributes

static const unsigned int theMaxNumParam = RigidBodyAlignmentParameters::N_PARAM + 14
 
static const unsigned int theMinLabel = 1
 
static const unsigned int theParamInstanceOffset = 700000
 

Protected Member Functions

virtual unsigned int firstNonAlignableLabel () const
 
const AlignableObjectIdobjectIdProvider () const
 Return tracker alignable object ID provider derived from the tracker's geometry. More...
 

Protected Attributes

const RunRange theOpenRunRange
 

Private Attributes

const AlignableObjectId alignableObjectId_
 
std::vector< std::pair< IntegratedCalibrationBase *, unsigned int > > theCalibrationLabels
 pairs of calibrations and their first label More...
 
const TopLevelAlignables topLevelAlignables_
 

Detailed Description

Baseclass for pede labelers

Original author: Andreas Mussgiller, January 2011

Date
2011/02/18 17:08:13
Revision
1.2

(last update by

Author
mussgill

)

Definition at line 33 of file PedeLabelerBase.h.

Member Typedef Documentation

◆ RunNumber

Definition at line 35 of file PedeLabelerBase.h.

◆ RunRange

Definition at line 36 of file PedeLabelerBase.h.

◆ RunRanges

Definition at line 37 of file PedeLabelerBase.h.

Constructor & Destructor Documentation

◆ PedeLabelerBase()

PedeLabelerBase::PedeLabelerBase ( const TopLevelAlignables alignables,
const edm::ParameterSet config 
)

constructor from three Alignables (null pointers allowed )

Definition at line 28 of file PedeLabelerBase.cc.

29  : theOpenRunRange(std::make_pair<RunNumber, RunNumber>(
30  RunNumber(cond::timeTypeSpecs[cond::runnumber].beginValue), // since we know we have a runnumber here, we can
31  RunNumber(
32  cond::timeTypeSpecs[cond::runnumber].endValue))), // simply convert the Time_t to make the compiler happy
33  topLevelAlignables_(alignables),
34  alignableObjectId_{AlignableObjectId::commonObjectIdProvider(alignables.aliTracker_, alignables.aliMuon_)} {}

References PedeLabelerBase::TopLevelAlignables::aliMuon_, PedeLabelerBase::TopLevelAlignables::aliTracker_, and AlignableObjectId::commonObjectIdProvider().

◆ ~PedeLabelerBase()

virtual PedeLabelerBase::~PedeLabelerBase ( )
inlinevirtual

Definition at line 50 of file PedeLabelerBase.h.

51 {}

Member Function Documentation

◆ addCalibrations()

void PedeLabelerBase::addCalibrations ( const std::vector< IntegratedCalibrationBase * > &  iCals)
virtual

tell labeler to treat also integrated calibrations

Definition at line 101 of file PedeLabelerBase.cc.

101  {
102  unsigned int nextId = this->firstFreeLabel(); // so far next free label
103 
104  // Now foresee labels for new calibrations:
105  for (auto iCal = iCals.begin(); iCal != iCals.end(); ++iCal) {
106  if (*iCal) {
107  theCalibrationLabels.push_back(std::make_pair(*iCal, nextId));
108  nextId += (*iCal)->numParameters();
109  } else {
110  edm::LogError("LogicError") << "@SUB=PedeLabelerBase::addCalibrations"
111  << "Ignoring nullPtr.";
112  }
113  }
114 }

References firstFreeLabel(), and theCalibrationLabels.

◆ alignableExtras()

const AlignableExtras* PedeLabelerBase::alignableExtras ( ) const
inline

◆ alignableFromLabel()

virtual Alignable* PedeLabelerBase::alignableFromLabel ( unsigned int  label) const
pure virtual

Alignable from alignable or parameter label, null if no alignable (but error only if not las beam, either!)

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

Referenced by PedeReader::setParameter().

◆ alignableLabel()

virtual unsigned int PedeLabelerBase::alignableLabel ( Alignable alignable) const
pure virtual

uniqueId of Alignable, 0 if alignable not known between this ID and the next there is enough 'space' to add parameter numbers 0...nPar-1 to make unique IDs for the labels of active parameters

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

Referenced by PedeReader::checkAliParams(), PedeSteerer::hierarchyConstraint(), PedeSteerer::presigmasFile(), and PedeReader::setParameter().

◆ alignableLabelFromLabel()

virtual unsigned int PedeLabelerBase::alignableLabelFromLabel ( unsigned int  label) const
pure virtual

alignable label from parameter label (works also for alignable label...)

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

◆ alignableLabelFromParamAndInstance()

virtual unsigned int PedeLabelerBase::alignableLabelFromParamAndInstance ( Alignable alignable,
unsigned int  param,
unsigned int  instance 
) const
pure virtual

uniqueId of Alignable for a given parameter index and instance, 0 if alignable not known between this ID and the next there is enough 'space' to add parameter numbers 0...nPar-1 to make unique IDs for the labels of active parameters

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

Referenced by PedeSteererWeakModeConstraints::constructConstraints(), and PedeSteerer::fixParameter().

◆ alignableMuon()

const AlignableMuon* PedeLabelerBase::alignableMuon ( ) const
inline

◆ alignableTracker()

const AlignableTracker* PedeLabelerBase::alignableTracker ( ) const
inline

Definition at line 104 of file PedeLabelerBase.h.

Referenced by PedeReader::checkAliParams().

◆ calibrationLabel()

unsigned int PedeLabelerBase::calibrationLabel ( const IntegratedCalibrationBase calib,
unsigned int  paramNum 
) const
virtual

label for parameter 'paramNum' (counted from 0) of an integrated calibration

Definition at line 75 of file PedeLabelerBase.cc.

75  {
76  if (!calib) {
77  throw cms::Exception("LogicError") << "PedeLabelerBase::calibrationLabel: "
78  << "nullPtr passed!\n";
79  }
80 
81  // loop on all known IntegratedCalibration's
82  for (auto iCal = theCalibrationLabels.begin(); iCal != theCalibrationLabels.end(); ++iCal) {
83  if (iCal->first == calib) { // found IntegratedCalibrationBase
84  if (paramNum < iCal->first->numParameters()) {
85  return iCal->second + paramNum;
86  } else { // paramNum out of range!
87  edm::LogError("LogicError") << "@SUB=PedeLabelerBase::calibrationLabel"
88  << "IntegratedCalibration " << calib->name() << " has only "
89  << iCal->first->numParameters() << " parameters, but " << paramNum << "requested!";
90  }
91  }
92  }
93 
94  edm::LogError("LogicError") << "@SUB=PedeLabelerBase::calibrationLabel"
95  << "IntegratedCalibration " << calib->name() << " not known or too few parameters.";
96 
97  return 0;
98 }

References Exception, first, and theCalibrationLabels.

◆ calibrationParamFromLabel()

std::pair< IntegratedCalibrationBase *, unsigned int > PedeLabelerBase::calibrationParamFromLabel ( unsigned int  label) const
virtual

calibration and its parameter number from label, if label does not belong to any calibration return nullptr as pair.first

Definition at line 37 of file PedeLabelerBase.cc.

38  {
39  // Quick check whether label is in range of calibration labels:
40  if (!theCalibrationLabels.empty() && label >= theCalibrationLabels.front().second) {
41  // Loop on all known IntegratedCalibration's:
42  for (auto iCal = theCalibrationLabels.begin(); iCal != theCalibrationLabels.end(); ++iCal) {
43  if (label >= iCal->second && label < iCal->second + iCal->first->numParameters()) {
44  // Label fits in range for this calibration, so return calibration
45  // and subtract first label of this calibration from label.
46  return std::make_pair(iCal->first, label - iCal->second);
47  }
48  }
49  edm::LogError("LogicError") << "@SUB=PedeLabelerBase::calibrationParamFromLabel"
50  << "Label " << label << "larger than first calibration's label, "
51  << "but no calibration fits!";
52  }
53 
54  // Return that nothing fits:
55  return std::pair<IntegratedCalibrationBase *, unsigned int>(nullptr, 0);
56 }

References label, edm::second(), and theCalibrationLabels.

Referenced by PedeReader::read().

◆ firstFreeLabel()

unsigned int PedeLabelerBase::firstFreeLabel ( ) const
virtual

first free label not yet used (for hacks within millepede...) valid only after last call to addCalibrations(..)

Definition at line 59 of file PedeLabelerBase.cc.

59  {
60  unsigned int nextId = this->firstNonAlignableLabel();
61 
62  for (auto iCal = theCalibrationLabels.begin(); iCal != theCalibrationLabels.end(); ++iCal) {
63  nextId += iCal->first->numParameters();
64  }
65 
66  return nextId;
67 }

References firstNonAlignableLabel(), and theCalibrationLabels.

Referenced by addCalibrations().

◆ firstNonAlignableLabel()

unsigned int PedeLabelerBase::firstNonAlignableLabel ( ) const
protectedvirtual

first free label after everything about Alignables and LAS beams (to be used for calibrations)

Definition at line 70 of file PedeLabelerBase.cc.

70  {
71  return this->parameterInstanceOffset() * this->maxNumberOfParameterInstances() + 1;
72 }

References maxNumberOfParameterInstances(), and parameterInstanceOffset().

Referenced by firstFreeLabel().

◆ hasSplitParameters()

virtual bool PedeLabelerBase::hasSplitParameters ( Alignable alignable) const
pure virtual

returns true if the alignable has parameters that are split into various bins

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

◆ lasBeamIdFromLabel()

virtual unsigned int PedeLabelerBase::lasBeamIdFromLabel ( unsigned int  label) const
pure virtual

las beam id from las beam or parameter label zero and error if not a valid las beam label

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

Referenced by PedeReader::setParameter().

◆ lasBeamLabel()

virtual unsigned int PedeLabelerBase::lasBeamLabel ( unsigned int  lasBeamId) const
pure virtual

◆ maxNumberOfParameterInstances()

virtual unsigned int PedeLabelerBase::maxNumberOfParameterInstances ( ) const
pure virtual

returns the maximum number of instances for any parameter of an Alignable*

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

Referenced by firstNonAlignableLabel().

◆ numberOfParameterInstances()

virtual unsigned int PedeLabelerBase::numberOfParameterInstances ( Alignable alignable,
int  param = -1 
) const
pure virtual

returns the number of instances for a given parameter

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

Referenced by PedeSteerer::fixParameters().

◆ objectIdProvider()

const AlignableObjectId& PedeLabelerBase::objectIdProvider ( ) const
inlineprotected

Return tracker alignable object ID provider derived from the tracker's geometry.

Definition at line 118 of file PedeLabelerBase.h.

119 { return alignableObjectId_; }

Referenced by MomentumDependentPedeLabeler::buildMomentumDependencyMap(), and RunRangeDependentPedeLabeler::buildRunRangeDependencyMap().

◆ parameterInstanceOffset()

unsigned int PedeLabelerBase::parameterInstanceOffset ( ) const
inline

offset in labels between consecutive parameter instances of Alignable*s

Definition at line 81 of file PedeLabelerBase.h.

82 { return theParamInstanceOffset; }

Referenced by firstNonAlignableLabel().

◆ parameterLabel() [1/2]

virtual unsigned int PedeLabelerBase::parameterLabel ( Alignable alignable,
unsigned int  parNum,
const AlignmentAlgorithmBase::EventInfo eventInfo,
const TrajectoryStateOnSurface tsos 
) const
pure virtual

returns the label for a given alignable parameter number combination in case the parameters are split into various instances

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

◆ parameterLabel() [2/2]

virtual unsigned int PedeLabelerBase::parameterLabel ( unsigned int  aliLabel,
unsigned int  parNum 
) const
pure virtual

◆ paramNumFromLabel()

virtual unsigned int PedeLabelerBase::paramNumFromLabel ( unsigned int  paramLabel) const
pure virtual

parameter number, 0 <= .. < theMaxNumParam, belonging to unique parameter label

Implemented in RunRangeDependentPedeLabeler, MomentumDependentPedeLabeler, and PedeLabeler.

Referenced by PedeReader::setParameter().

◆ runRangeFromLabel()

virtual const RunRange& PedeLabelerBase::runRangeFromLabel ( unsigned int  label) const
inlinevirtual

Reimplemented in RunRangeDependentPedeLabeler.

Definition at line 97 of file PedeLabelerBase.h.

98 { return theOpenRunRange; }

References theOpenRunRange.

Referenced by PedeReader::read().

Member Data Documentation

◆ alignableObjectId_

const AlignableObjectId PedeLabelerBase::alignableObjectId_
private

Definition at line 124 of file PedeLabelerBase.h.

◆ theCalibrationLabels

std::vector<std::pair<IntegratedCalibrationBase *, unsigned int> > PedeLabelerBase::theCalibrationLabels
private

pairs of calibrations and their first label

Definition at line 127 of file PedeLabelerBase.h.

Referenced by addCalibrations(), calibrationLabel(), calibrationParamFromLabel(), and firstFreeLabel().

◆ theMaxNumParam

const unsigned int PedeLabelerBase::theMaxNumParam = RigidBodyAlignmentParameters::N_PARAM + 14
static

◆ theMinLabel

const unsigned int PedeLabelerBase::theMinLabel = 1
static

◆ theOpenRunRange

const RunRange PedeLabelerBase::theOpenRunRange
protected

◆ theParamInstanceOffset

const unsigned int PedeLabelerBase::theParamInstanceOffset = 700000
static

◆ topLevelAlignables_

const TopLevelAlignables PedeLabelerBase::topLevelAlignables_
private

Definition at line 123 of file PedeLabelerBase.h.

Referenced by alignableExtras(), and alignableMuon().

PedeLabelerBase::parameterInstanceOffset
unsigned int parameterInstanceOffset() const
offset in labels between consecutive parameter instances of Alignable*s
Definition: PedeLabelerBase.h:81
PedeLabelerBase::alignableObjectId_
const AlignableObjectId alignableObjectId_
Definition: PedeLabelerBase.h:124
PedeLabelerBase::firstNonAlignableLabel
virtual unsigned int firstNonAlignableLabel() const
Definition: PedeLabelerBase.cc:70
PedeLabelerBase::theCalibrationLabels
std::vector< std::pair< IntegratedCalibrationBase *, unsigned int > > theCalibrationLabels
pairs of calibrations and their first label
Definition: PedeLabelerBase.h:127
AlignableObjectId::commonObjectIdProvider
static AlignableObjectId commonObjectIdProvider(const AlignableObjectId &, const AlignableObjectId &)
Definition: AlignableObjectId.cc:335
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
PedeLabelerBase::TopLevelAlignables::aliTracker_
AlignableTracker * aliTracker_
Definition: PedeLabelerBase.h:43
cond::timeTypeSpecs
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:16
PedeLabelerBase::maxNumberOfParameterInstances
virtual unsigned int maxNumberOfParameterInstances() const =0
returns the maximum number of instances for any parameter of an Alignable*
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
PedeLabelerBase::topLevelAlignables_
const TopLevelAlignables topLevelAlignables_
Definition: PedeLabelerBase.h:123
calib
Definition: CalibElectron.h:12
cond::runnumber
Definition: Time.h:19
PedeLabelerBase::TopLevelAlignables::aliMuon_
AlignableMuon * aliMuon_
Definition: PedeLabelerBase.h:44
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PedeLabelerBase::theParamInstanceOffset
static const unsigned int theParamInstanceOffset
Definition: PedeLabelerBase.h:109
Exception
Definition: hltDiff.cc:245
PedeLabelerBase::RunNumber
align::RunNumber RunNumber
Definition: PedeLabelerBase.h:35
PedeLabelerBase::theOpenRunRange
const RunRange theOpenRunRange
Definition: PedeLabelerBase.h:120
label
const char * label
Definition: PFTauDecayModeTools.cc:11
PedeLabelerBase::firstFreeLabel
virtual unsigned int firstFreeLabel() const
Definition: PedeLabelerBase.cc:59