BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/MdcRecoUtil/MdcRecoUtil/BesCollectionUtils.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3//
4// Description:
5//
6//
7//
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Author List:
12// Matthias Steinke
13//
14//
15// Copyright Information:
16//
17//------------------------------------------------------------------------
18
19#ifndef BBRCOLLECTIONUTILS_HH
20#define BBRCOLLECTIONUTILS_HH
21
22#include <algorithm>
23
24//CHANGE namespace babar {
25namespace bes {
26 namespace Collection {
27
28#ifdef OO_DDL_TRANSLATION
29 struct PtrLess;
30#else
31 struct PtrLess {
32 template<class PtrType>
33 bool operator()(PtrType ptr1, PtrType ptr2) const {
34 return (*ptr1) < (*ptr2);
35 }
36 };
37#endif
38
40
41 // Sun does not like typename, have to use class
42 // template< typename T >
43 template< class T >
44 void operator()(const T* ptr) const {
45 delete ptr;
46 }
47 };
48
50
51 // Sun does not like typename, have to use class
52 // template< typename T >
53 template< class T >
54 void operator()(const T array[]) const {
55 delete[] array;
56 }
57 };
58
59 /**
60 * Determines the offset of the first occurrence of a specified
61 * value in a container. This is _not_ an STL-ish way to work;
62 * the use of std::find() and iterators instead of offsets is
63 * _strongly_ preferred, even for vectors.
64 *
65 * This function is supplied only as a migration aid for previous users
66 * of the Rogue Wave vector classes.
67 *
68 * It is valid for any container type C for whose iterators
69 * operator- is defined. When a restriction in the STL supplied
70 * by RW for Sun is removed in the future (see below),
71 * it could be rewritten to work for all containers.
72 */
73 template < class C, class T >
74 typename C::difference_type
75 findIndex( const C& container, const T& value ) {
76 typename C::const_iterator found
77 = std::find( container.begin(), container.end(), value );
78
79 // Were std::distance available, one would write: FIXME
80 //// return std::distance( container.begin(), found );
81
82 // Meanwhile, this should only compile for iterators for which it is efficient:
83 return found - container.begin();
84 }
85
86 }
87}
88
89#endif
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
Definition: RRes.h:29
C::difference_type findIndex(const C &container, const T &value)