CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
cond::IOVRange Class Reference

#include <IOVProxy.h>

Public Types

typedef iov_range_iterator const_iterator
 

Public Member Functions

IOVElementProxy back () const
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator find (cond::Time_t time) const
 
IOVElementProxy front () const
 
 IOVRange ()
 
 IOVRange (const boost::shared_ptr< IOVProxyData > &iov, cond::Time_t since, cond::Time_t till, int selection=0)
 
 IOVRange (const boost::shared_ptr< IOVProxyData > &iov, int selection)
 
 IOVRange (const IOVRange &rhs)
 
IOVRangeoperator= (const IOVRange &rhs)
 
size_t size () const
 

Private Attributes

int m_high
 
boost::shared_ptr< IOVProxyDatam_iov
 
int m_low
 
cond::Time_t m_lowBound
 

Detailed Description

Definition at line 111 of file IOVProxy.h.

Member Typedef Documentation

Definition at line 114 of file IOVProxy.h.

Constructor & Destructor Documentation

cond::IOVRange::IOVRange ( )

Definition at line 82 of file IOVProxy.cc.

82  :
83  m_iov(),
84  m_low(-1),
85  m_high(-1),
86  m_lowBound(0){
87 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
cond::Time_t m_lowBound
Definition: IOVProxy.h:153
cond::IOVRange::IOVRange ( const boost::shared_ptr< IOVProxyData > &  iov,
cond::Time_t  since,
cond::Time_t  till,
int  selection = 0 
)

Definition at line 89 of file IOVProxy.cc.

References m_high, m_iov, m_low, m_lowBound, max(), and min.

92  :
93  m_iov( iov ),
94  m_low( -1 ),
95  m_high( -1 ),
96  m_lowBound(0){
97  std::pair<int,int> rg = m_iov->range( since, till );
98  m_low = rg.first;
99  m_high = rg.second;
100  if( selection > 0 ){
101  m_low = rg.first;
102  m_high = std::min( rg.first-selection-1, rg.second );
103  } else if( selection < 0 ){
104  m_low = std::max( rg.second-selection+1,rg.first);
105  m_high = rg.second;
106  }
107  cond::Time_t tlow = m_iov->data->iovs()[m_low].sinceTime();
108  if( since < tlow ) since = tlow;
109  m_lowBound = since;
110 }
selection
main part
Definition: corrVsCorr.py:98
#define min(a, b)
Definition: mlp_lapack.h:161
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
unsigned long long Time_t
Definition: Time.h:16
tuple iov
Definition: o2o.py:307
const T & max(const T &a, const T &b)
cond::Time_t m_lowBound
Definition: IOVProxy.h:153
cond::IOVRange::IOVRange ( const boost::shared_ptr< IOVProxyData > &  iov,
int  selection 
)

Definition at line 112 of file IOVProxy.cc.

References m_high, m_low, min, and corrVsCorr::selection.

113  :
114  m_iov(iov),
115  m_low(-1),
116  m_high(-1),
117  m_lowBound(0){
118  int sz = iov->data->iovs().size();
119  m_low = 0;
120  m_high = sz-1;
121  if( selection > 0 ){
122  m_high = std::min( selection, sz-1 );
123  } else if( selection < 0 ){
124  m_low = sz+selection;
125  if(m_low < 0) m_low = 0;
126  }
127 }
selection
main part
Definition: corrVsCorr.py:98
#define min(a, b)
Definition: mlp_lapack.h:161
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
tuple iov
Definition: o2o.py:307
cond::Time_t m_lowBound
Definition: IOVProxy.h:153
cond::IOVRange::IOVRange ( const IOVRange rhs)

Definition at line 129 of file IOVProxy.cc.

129  :
130  m_iov( rhs.m_iov ),
131  m_low( rhs.m_low ),
132  m_high( rhs.m_high ),
133  m_lowBound( rhs.m_lowBound){
134 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
cond::Time_t m_lowBound
Definition: IOVProxy.h:153

Member Function Documentation

cond::IOVElementProxy cond::IOVRange::back ( ) const

Definition at line 157 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

157  {
158  IterHelp helper(*m_iov, m_lowBound);
159  return helper( m_high );
160 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
cond::Time_t m_lowBound
Definition: IOVProxy.h:153
const_iterator cond::IOVRange::begin ( void  ) const
inline

Definition at line 128 of file IOVProxy.h.

References m_iov, m_low, and m_lowBound.

Referenced by BOOST_PYTHON_MODULE(), CondBasicIter::setMax(), CondBasicIter::setMin(), and CondBasicIter::setRange().

128  {
129  return boost::make_transform_iterator(boost::counting_iterator<int>(m_low),
130  IterHelp(*m_iov, m_lowBound));
131  }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
cond::Time_t m_lowBound
Definition: IOVProxy.h:153
const_iterator cond::IOVRange::end ( void  ) const
inline

Definition at line 133 of file IOVProxy.h.

References getHLTprescales::index, m_high, m_iov, and m_lowBound.

Referenced by BOOST_PYTHON_MODULE(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), CondBasicIter::setMax(), CondBasicIter::setMin(), and CondBasicIter::setRange().

133  {
134  // returns: 0 if not inizialized (m_low=m_high=-1)
135  // m_high + 1 = m_low + size elsewhere (since size = m_high - m_low + 1)
136  int index = m_high + 1;
137  return boost::make_transform_iterator(boost::counting_iterator<int>(index),
138  IterHelp(*m_iov, m_lowBound));
139  }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
cond::Time_t m_lowBound
Definition: IOVProxy.h:153
cond::IOVRange::const_iterator cond::IOVRange::find ( cond::Time_t  time) const

Definition at line 144 of file IOVProxy.cc.

References end, and n.

Referenced by BeautifulSoup.Tag::__getattr__(), and BeautifulSoup.Tag::firstText().

144  {
145  int n = m_iov->data->find(time)-m_iov->data->iovs().begin();
146  return (n<m_low || m_high<n ) ?
147  end() :
148  boost::make_transform_iterator(boost::counting_iterator<int>(n),
149  IterHelp(*m_iov, m_lowBound));
150 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
cond::Time_t m_lowBound
Definition: IOVProxy.h:153
const_iterator end() const
Definition: IOVProxy.h:133
cond::IOVElementProxy cond::IOVRange::front ( ) const

Definition at line 152 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

152  {
153  IterHelp helper(*m_iov, m_lowBound);
154  return helper( m_low );
155 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
cond::Time_t m_lowBound
Definition: IOVProxy.h:153
cond::IOVRange & cond::IOVRange::operator= ( const IOVRange rhs)

Definition at line 136 of file IOVProxy.cc.

References m_high, m_iov, m_low, and m_lowBound.

136  {
137  m_iov = rhs.m_iov;
138  m_low = rhs.m_low;
139  m_high = rhs.m_high;
140  m_lowBound = rhs.m_lowBound;
141  return *this;
142 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:150
cond::Time_t m_lowBound
Definition: IOVProxy.h:153
size_t cond::IOVRange::size ( void  ) const

Definition at line 162 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

162  {
163  size_t sz = 0;
164  if( m_high>=0 && m_low>=0 ) sz = m_high-m_low+1;
165  return sz;
166 }

Member Data Documentation

int cond::IOVRange::m_high
private

Definition at line 152 of file IOVProxy.h.

Referenced by end(), IOVRange(), and operator=().

boost::shared_ptr<IOVProxyData> cond::IOVRange::m_iov
private

Definition at line 150 of file IOVProxy.h.

Referenced by begin(), end(), IOVRange(), and operator=().

int cond::IOVRange::m_low
private

Definition at line 151 of file IOVProxy.h.

Referenced by begin(), IOVRange(), and operator=().

cond::Time_t cond::IOVRange::m_lowBound
private

Definition at line 153 of file IOVProxy.h.

Referenced by begin(), end(), IOVRange(), and operator=().