Jpp  15.0.5
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
Timestamp< T > Class Template Reference

Auxiliary class to remove bit-flipped ARS data. More...

#include <Timestamp.hh>

Inheritance diagram for Timestamp< T >:
std::pair< T, T >

Public Types

typedef T const_iterator
 

Public Member Functions

 Timestamp (T __begin, T __end)
 Constructor. More...
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
bool empty () const
 

Detailed Description

template<class T>
class Timestamp< T >

Auxiliary class to remove bit-flipped ARS data.

The input data are reshuffeld such that the pair container contains:

This class provides for the usual STL interface methods.

Definition at line 18 of file Timestamp.hh.

Member Typedef Documentation

template<class T >
typedef T Timestamp< T >::const_iterator

Definition at line 22 of file Timestamp.hh.

Constructor & Destructor Documentation

template<class T >
Timestamp< T >::Timestamp ( T  __begin,
T  __end 
)
inline

Constructor.

Parameters
__beginbegin of input data
__endend of input data

Definition at line 31 of file Timestamp.hh.

31  :
32  std::pair<T,T>(__begin, __end)
33  {
34  if (__begin != __end) {
35 
36  const_iterator p0 = __begin;
37  const_iterator p1 = p0;
38 
39  ++p1;
40 
41  /*
42  * assure following start conditions
43  *
44  * 1. p0 /= 0
45  * 2. p1 > p0
46  */
47  while (p1 != __end && (p0->timestamp == 0 || p1->timestamp < p0->timestamp)) {
48  ++p0;
49  ++p1;
50  }
51 
52  if (p1 != __end) {
53 
54  this->first = p0;
55  /*
56  * assume following start conditions
57  *
58  * 1. p0 /= 0
59  * 2. p1 > p0
60  */
61  for (const_iterator p2 = p1; ++p2 != __end; ) {
62 
63 
64  if (p2->timestamp > p1->timestamp) {
65  /*
66  * p2
67  * /
68  * p1
69  * /
70  * p0
71  */
72  *(++p0) = *p1;
73  *(++p1) = *p2;
74 
75  } else {
76 
77  if (p2->timestamp < p0->timestamp) {
78  /*
79  * p1
80  * / \
81  * / \
82  * p0 \
83  * p2
84  *
85  */
86  } else {
87  /*
88  * p1
89  * / \
90  * / p2
91  * /
92  * p0
93  */
94  *p1 = *p2;
95  }
96  }
97  }
98 
99  this->second = ++p1;
100 
101  } else {
102 
103  this->first = p0;
104  this->second = p1;
105  }
106  }
107  }
TPaveText * p1
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
p2
Definition: module-Z:fit.sh:74
T const_iterator
Definition: Timestamp.hh:22

Member Function Documentation

template<class T >
const_iterator Timestamp< T >::begin ( ) const
inline

Definition at line 109 of file Timestamp.hh.

109 { return this->first; }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
template<class T >
const_iterator Timestamp< T >::end ( ) const
inline

Definition at line 110 of file Timestamp.hh.

110 { return this->second; }
template<class T >
size_t Timestamp< T >::size ( ) const
inline

Definition at line 112 of file Timestamp.hh.

112 { return std::distance(this->begin(), this->end()); }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
const_iterator end() const
Definition: Timestamp.hh:110
const_iterator begin() const
Definition: Timestamp.hh:109
template<class T >
bool Timestamp< T >::empty ( ) const
inline

Definition at line 113 of file Timestamp.hh.

113 { return this->begin() == this->end(); }
const_iterator end() const
Definition: Timestamp.hh:110
const_iterator begin() const
Definition: Timestamp.hh:109

The documentation for this class was generated from the following file: