CMS 3D CMS Logo

AlignmentSurfaceDeformations.h
Go to the documentation of this file.
1 #ifndef AlignmentSurfaceDeformations_H
2 #define AlignmentSurfaceDeformations_H
3 
5 
6 #include <vector>
7 
9 
19 
21 public:
22  struct Item {
25  int m_index;
26 
28  };
29 
30  typedef std::vector<Item> ItemVector;
31  typedef std::vector<align::Scalar>::const_iterator ParametersConstIterator;
32  typedef std::pair<ParametersConstIterator, ParametersConstIterator> ParametersConstIteratorPair;
33 
36 
38  inline bool empty() const { return m_items.empty(); }
39 
41  bool add(align::ID rawId, int type, const std::vector<align::Scalar>& parameters) {
42  Item item;
43  item.m_rawId = rawId;
44  item.m_parametrizationType = type;
45  item.m_index = m_parameters.size();
46  m_items.push_back(item);
47 
48  m_parameters.reserve(m_parameters.size() + parameters.size());
49  std::copy(parameters.begin(), parameters.end(), std::back_inserter(m_parameters));
50 
51  return true;
52  }
53 
55  const ItemVector& items() const { return m_items; }
56 
61  pair.first = m_parameters.begin() + m_items[index].m_index;
62  if (index < m_items.size() - 1) {
63  pair.second = m_parameters.begin() + m_items[index + 1].m_index;
64  } else {
65  pair.second = m_parameters.end();
66  }
67  return pair;
68  }
69 
70 private:
71  std::vector<align::Scalar> m_parameters;
73 
75 };
76 
77 #endif // AlignmentSurfaceDeformations_H
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
AlignmentSurfaceDeformations::m_items
ItemVector m_items
Definition: AlignmentSurfaceDeformations.h:72
AlignmentSurfaceDeformations::ItemVector
std::vector< Item > ItemVector
Definition: AlignmentSurfaceDeformations.h:30
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
AlignmentSurfaceDeformations::Item::m_parametrizationType
int m_parametrizationType
Definition: AlignmentSurfaceDeformations.h:24
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
AlignmentSurfaceDeformations::~AlignmentSurfaceDeformations
virtual ~AlignmentSurfaceDeformations()
Definition: AlignmentSurfaceDeformations.h:35
AlignmentSurfaceDeformations::empty
bool empty() const
Test of empty vector without having to look into internals:
Definition: AlignmentSurfaceDeformations.h:38
align::ID
uint32_t ID
Definition: Definitions.h:24
AlignmentSurfaceDeformations::m_parameters
std::vector< align::Scalar > m_parameters
Definition: AlignmentSurfaceDeformations.h:71
AlignmentSurfaceDeformations::Item
Definition: AlignmentSurfaceDeformations.h:22
Definitions.h
AlignmentSurfaceDeformations::add
bool add(align::ID rawId, int type, const std::vector< align::Scalar > &parameters)
Add a new item.
Definition: AlignmentSurfaceDeformations.h:41
AlignmentSurfaceDeformations::AlignmentSurfaceDeformations
AlignmentSurfaceDeformations()
Definition: AlignmentSurfaceDeformations.h:34
Serializable.h
AlignmentSurfaceDeformations::ParametersConstIterator
std::vector< align::Scalar >::const_iterator ParametersConstIterator
Definition: AlignmentSurfaceDeformations.h:31
AlignmentSurfaceDeformations
Definition: AlignmentSurfaceDeformations.h:20
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
type
type
Definition: HCALResponse.h:21
AlignmentSurfaceDeformations::Item::m_rawId
align::ID m_rawId
Definition: AlignmentSurfaceDeformations.h:23
AlignmentSurfaceDeformations::parameters
ParametersConstIteratorPair parameters(size_t index) const
Definition: AlignmentSurfaceDeformations.h:59
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
AlignmentSurfaceDeformations::items
const ItemVector & items() const
Get vector of all items.
Definition: AlignmentSurfaceDeformations.h:55
AlignmentSurfaceDeformations::ParametersConstIteratorPair
std::pair< ParametersConstIterator, ParametersConstIterator > ParametersConstIteratorPair
Definition: AlignmentSurfaceDeformations.h:32
AlignmentSurfaceDeformations::Item::m_index
int m_index
Definition: AlignmentSurfaceDeformations.h:25