ATLAS Offline Software
Loading...
Searching...
No Matches
EventShapeStore.h
Go to the documentation of this file.
1// -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef EVENTSHAPES_EVENTSHAPESTORE_H
8#define EVENTSHAPES_EVENTSHAPESTORE_H
9
11
12#include <vector>
13
15{
16 public:
17
18 template<class T>
20
22
24
25 bool get(const EventShapes::EventShapeType& type, double& value, unsigned int index = 0) const;
26
27 // bool get(const EventShapes::EventShapeType& type,
28 // std::vector<double>& values, unsigned int index = 0);
29 // bool get(const EventShapes::EventShapeType& type,
30 // std::vector<std::vector<double> >& valueBlock);
31
33 {
34 for(store_iter it=m_store.begin(); it!=m_store.end(); it++ )
35 if(it->getType()==es.getType())
36 {
37 it->swapValues( es );
38 return;
39 }
40 m_store.push_back(es);
41 };
42
44 {
45 for(store_iter it=m_store.begin(); it!=m_store.end(); it++ )
46 if(it->getType()==type)
47 {
48 it->setValue(value);
49 return;
50 }
51 m_store.push_back(EventShapes(type,value));
52 };
53
54 void insert(EventShapes::EventShapeType type, std::vector<double>& values, bool canSwap = false)
55 {
56 for(store_iter it=m_store.begin(); it!=m_store.end(); it++ )
57 if(it->getType()==type)
58 {
59 it->setValues(values, canSwap);
60 return;
61 }
62 m_store.push_back(EventShapes(type, values, canSwap));
63 };
64
65 private:
66
67 typedef std::vector<EventShapes> store_type;
68
69 typedef store_type::iterator store_iter;
70
71 typedef store_type::const_iterator store_Citer;
72
74
75};
76
78CLASS_DEF(EventShapeStore, 79242525, 1)
79
80#endif
81
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
bool get(const EventShapes::EventShapeType &type, double &value, unsigned int index=0) const
store_type::const_iterator store_Citer
std::vector< EventShapes > store_type
void insert(EventShapes &es)
friend class EventShapeStoreConverterBase
void insert(EventShapes::EventShapeType type, double value)
store_type::iterator store_iter
void insert(EventShapes::EventShapeType type, std::vector< double > &values, bool canSwap=false)
EventShapeType getType() const
Definition EventShapes.h:64
Definition index.py:1