CMS 3D CMS Logo

PedeLabeler.h
Go to the documentation of this file.
1 #ifndef PEDELABELER_H
2 #define PEDELABELER_H
3 
16 #include <vector>
17 #include <map>
18 
20 
22 
23 /***************************************
24 ****************************************/
26 {
27  public:
28 
31  const edm::ParameterSet &config);
33  ~PedeLabeler() override;
34 
38  unsigned int alignableLabel(Alignable *alignable) const override;
39  unsigned int alignableLabelFromParamAndInstance(Alignable *alignable,
40  unsigned int param,
41  unsigned int instance) const override;
42  unsigned int lasBeamLabel(unsigned int lasBeamId) const override;
43  unsigned int parameterLabel(unsigned int aliLabel, unsigned int parNum) const override;
44  unsigned int parameterLabel(Alignable *alignable, unsigned int parNum,
46  const TrajectoryStateOnSurface &tsos) const override {
47  return parameterLabel(alignableLabel(alignable), parNum);
48  }
49  bool hasSplitParameters(Alignable *alignable) const override { return false; }
50  unsigned int numberOfParameterInstances(Alignable *alignable,
51  int param=-1) const override { return 1; }
52  unsigned int maxNumberOfParameterInstances() const override { return 1; }
53 
55  unsigned int paramNumFromLabel(unsigned int paramLabel) const override;
57  unsigned int alignableLabelFromLabel(unsigned int label) const override;
60  Alignable* alignableFromLabel(unsigned int label) const override;
63  unsigned int lasBeamIdFromLabel(unsigned int label) const override;
64 
65  private:
66  typedef std::map <Alignable*, unsigned int> AlignableToIdMap;
68  typedef std::map <unsigned int, Alignable*> IdToAlignableMap;
69  typedef std::map <unsigned int, unsigned int> UintUintMap;
70 
72  unsigned int buildMap(const std::vector<Alignable*> &alis);
74  unsigned int buildReverseMap();
75 
76  // data members
77  AlignableToIdMap theAlignableToIdMap;
78  IdToAlignableMap theIdToAlignableMap;
79  UintUintMap theLasBeamToLabelMap;
80  UintUintMap theLabelToLasBeamMap;
81 };
82 
83 #endif
unsigned int parameterLabel(Alignable *alignable, unsigned int parNum, const AlignmentAlgorithmBase::EventInfo &eventInfo, const TrajectoryStateOnSurface &tsos) const override
Definition: PedeLabeler.h:44
std::map< unsigned int, Alignable * > IdToAlignableMap
Definition: PedeLabeler.h:68
static PFTauRenderPlugin instance
Alignable * alignableFromLabel(unsigned int label) const override
Definition: PedeLabeler.cc:117
std::map< unsigned int, unsigned int > UintUintMap
Definition: PedeLabeler.h:69
unsigned int numberOfParameterInstances(Alignable *alignable, int param=-1) const override
returns the number of instances for a given parameter
Definition: PedeLabeler.h:50
std::map< Alignable *, unsigned int > AlignableToIdMap
Definition: PedeLabeler.h:66
unsigned int alignableLabelFromParamAndInstance(Alignable *alignable, unsigned int param, unsigned int instance) const override
Definition: PedeLabeler.cc:67
PedeLabeler(const PedeLabelerBase::TopLevelAlignables &alignables, const edm::ParameterSet &config)
constructor from three Alignables (null pointers allowed )
Definition: PedeLabeler.cc:22
unsigned int maxNumberOfParameterInstances() const override
returns the maximum number of instances for any parameter of an Alignable*
Definition: PedeLabeler.h:52
Definition: config.py:1
unsigned int lasBeamLabel(unsigned int lasBeamId) const override
Definition: PedeLabeler.cc:75
unsigned int buildReverseMap()
returns size of map
Definition: PedeLabeler.cc:194
define event information passed to algorithms
UintUintMap theLabelToLasBeamMap
labels for las beams
Definition: PedeLabeler.h:80
unsigned int paramNumFromLabel(unsigned int paramLabel) const override
parameter number, 0 <= .. < theMaxNumParam, belonging to unique parameter label
Definition: PedeLabeler.cc:100
AlignableToIdMap::value_type AlignableToIdPair
Definition: PedeLabeler.h:67
~PedeLabeler() override
destructor
Definition: PedeLabeler.cc:41
IdToAlignableMap theIdToAlignableMap
providing unique ID for alignable, space for param IDs
Definition: PedeLabeler.h:78
AlignableToIdMap theAlignableToIdMap
Definition: PedeLabeler.h:77
unsigned int alignableLabelFromLabel(unsigned int label) const override
alignable label from parameter label (works also for alignable label...)
Definition: PedeLabeler.cc:111
UintUintMap theLasBeamToLabelMap
reverse map
Definition: PedeLabeler.h:79
unsigned int lasBeamIdFromLabel(unsigned int label) const override
Definition: PedeLabeler.cc:137
unsigned int alignableLabel(Alignable *alignable) const override
Return 32-bit unique label for alignable, 0 indicates failure.
Definition: PedeLabeler.cc:47
bool hasSplitParameters(Alignable *alignable) const override
returns true if the alignable has parameters that are split into various bins
Definition: PedeLabeler.h:49
unsigned int parameterLabel(unsigned int aliLabel, unsigned int parNum) const override
returns the label for a given alignable parameter number combination
Definition: PedeLabeler.cc:89
eventInfo
add run, event number and lumi section
unsigned int buildMap(const std::vector< Alignable * > &alis)
returns size of map
Definition: PedeLabeler.cc:153