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 85 of file IOVProxy.cc.

85  :
86  m_iov(),
87  m_low(-1),
88  m_high(-1),
89  m_lowBound(0){
90 }
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 92 of file IOVProxy.cc.

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

95  :
96  m_iov( iov ),
97  m_low( -1 ),
98  m_high( -1 ),
99  m_lowBound(0){
100  std::pair<int,int> rg = m_iov->range( since, till );
101  m_low = rg.first;
102  m_high = rg.second;
103  if( selection > 0 ){
104  m_low = rg.first;
105  m_high = std::min( rg.first-selection-1, rg.second );
106  } else if( selection < 0 ){
107  m_low = std::max( rg.second-selection+1,rg.first);
108  m_high = rg.second;
109  }
110  cond::Time_t tlow = m_iov->data->iovs()[m_low].sinceTime();
111  if( since < tlow ) since = tlow;
112  m_lowBound = since;
113 }
selection
main part
Definition: corrVsCorr.py:98
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 115 of file IOVProxy.cc.

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

116  :
117  m_iov(iov),
118  m_low(-1),
119  m_high(-1),
120  m_lowBound(0){
121  int sz = iov->data->iovs().size();
122  m_low = 0;
123  m_high = sz-1;
124  if( selection > 0 ){
125  m_high = std::min( selection, sz-1 );
126  } else if( selection < 0 ){
127  m_low = sz+selection;
128  if(m_low < 0) m_low = 0;
129  }
130 }
selection
main part
Definition: corrVsCorr.py:98
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 132 of file IOVProxy.cc.

132  :
133  m_iov( rhs.m_iov ),
134  m_low( rhs.m_low ),
135  m_high( rhs.m_high ),
136  m_lowBound( rhs.m_lowBound){
137 }
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 160 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE(), and cond::persistency::OraTagTable::select().

160  {
161  IterHelp helper(*m_iov, m_lowBound);
162  return helper( m_high );
163 }
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 cmsHarvester::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 147 of file IOVProxy.cc.

References end, and n.

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

147  {
148  int n = m_iov->data->find(time)-m_iov->data->iovs().begin();
149  return (n<m_low || m_high<n ) ?
150  end() :
151  boost::make_transform_iterator(boost::counting_iterator<int>(n),
152  IterHelp(*m_iov, m_lowBound));
153 }
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 155 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE(), and cond::persistency::OraTagTable::select().

155  {
156  IterHelp helper(*m_iov, m_lowBound);
157  return helper( m_low );
158 }
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 139 of file IOVProxy.cc.

References m_high, m_iov, m_low, and m_lowBound.

139  {
140  m_iov = rhs.m_iov;
141  m_low = rhs.m_low;
142  m_high = rhs.m_high;
143  m_lowBound = rhs.m_lowBound;
144  return *this;
145 }
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 165 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

165  {
166  size_t sz = 0;
167  if( m_high>=0 && m_low>=0 ) sz = m_high-m_low+1;
168  return sz;
169 }

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=().