ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
VP1EvtsOnServerInfo Class Reference

#include <VP1EvtsOnServerInfo.h>

Collaboration diagram for VP1EvtsOnServerInfo:

Classes

class  Imp
 

Public Member Functions

 VP1EvtsOnServerInfo (const QString &infofile)
 
 ~VP1EvtsOnServerInfo ()
 
bool isValid () const
 
const QString & error () const
 
QStringList print () const
 
unsigned long long numberOfEvents () const
 
VP1EventFile newestEvent () const
 
QList< VP1EventFileevents (int timecut=-1, bool requireNewestRunNumber=false) const
 

Private Member Functions

 VP1EvtsOnServerInfo (const VP1EvtsOnServerInfo &)
 
VP1EvtsOnServerInfooperator= (const VP1EvtsOnServerInfo &)
 

Private Attributes

Impm_d
 

Detailed Description

Definition at line 26 of file VP1EvtsOnServerInfo.h.

Constructor & Destructor Documentation

◆ VP1EvtsOnServerInfo() [1/2]

VP1EvtsOnServerInfo::VP1EvtsOnServerInfo ( const QString &  infofile)

Definition at line 41 of file VP1EvtsOnServerInfo.cxx.

42  : m_d(new Imp(infofile))
43 {
44 }

◆ ~VP1EvtsOnServerInfo()

VP1EvtsOnServerInfo::~VP1EvtsOnServerInfo ( )

Definition at line 47 of file VP1EvtsOnServerInfo.cxx.

48 {
49  delete m_d;
50 }

◆ VP1EvtsOnServerInfo() [2/2]

VP1EvtsOnServerInfo::VP1EvtsOnServerInfo ( const VP1EvtsOnServerInfo )
private

Member Function Documentation

◆ error()

const QString & VP1EvtsOnServerInfo::error ( ) const

Definition at line 59 of file VP1EvtsOnServerInfo.cxx.

60 {
61  return m_d->error;
62 }

◆ events()

QList< VP1EventFile > VP1EvtsOnServerInfo::events ( int  timecut = -1,
bool  requireNewestRunNumber = false 
) const

Definition at line 241 of file VP1EvtsOnServerInfo.cxx.

242 {
243  //Notice: Logic here must be similar to logic in VP1AvailEvents::isConsideredFresh
244 
245  if ( m_d->events.isEmpty() )
246  return m_d->events;
247 
248  if (timecut==0) {
249  QList<VP1EventFile> l;
250  l << m_d->events.at(0);
251  return l;
252  }
253  const unsigned newestRawTime = m_d->events.at(0).rawTime();
254  const int newestRunNumber = m_d->events.at(0).runNumber();
255 
256  const unsigned minTime = (timecut<0&&unsigned(timecut)>newestRawTime) ? 0 : newestRawTime-timecut;
257 
258  QList<VP1EventFile> out;
259  for (VP1EventFile evt : m_d->events) {
260  if (minTime>0&&evt.rawTime()<minTime)
261  continue;
262  if (requireNewestRunNumber&&evt.runNumber()!=newestRunNumber)
263  continue;
264  out << evt;
265  }
266  return out;
267 }

◆ isValid()

bool VP1EvtsOnServerInfo::isValid ( ) const

Definition at line 53 of file VP1EvtsOnServerInfo.cxx.

54 {
55  return m_d->error.isEmpty();
56 }

◆ newestEvent()

VP1EventFile VP1EvtsOnServerInfo::newestEvent ( ) const

Definition at line 235 of file VP1EvtsOnServerInfo.cxx.

236 {
237  return m_d->events.isEmpty() ? VP1EventFile() : m_d->events.at(0);
238 }

◆ numberOfEvents()

unsigned long long VP1EvtsOnServerInfo::numberOfEvents ( ) const

Definition at line 229 of file VP1EvtsOnServerInfo.cxx.

230 {
231  return m_d->events.count();
232 }

◆ operator=()

VP1EvtsOnServerInfo& VP1EvtsOnServerInfo::operator= ( const VP1EvtsOnServerInfo )
private

◆ print()

QStringList VP1EvtsOnServerInfo::print ( ) const

Definition at line 65 of file VP1EvtsOnServerInfo.cxx.

66 {
67  QStringList l;
68  if (!isValid()) {
69  l << "Invalid. Reason: " + error();
70  return l;
71  }
72  l << "Valid with "+QString::number(numberOfEvents())+" files:";
73  for(VP1EventFile evt : events())
74  l << " "+evt.print();
75  l << "Events within 10 minutes of latest:";
76  for(VP1EventFile evt : events(10*60))
77  l << " "+evt.print();
78  l << "Events with same run number as latest:";
79  for(VP1EventFile evt : events(-1,true))
80  l << " "+evt.print();
81  l << "Events with same run number as latest and within 1 minute:";
82  for(VP1EventFile evt : events(1*60,true))
83  l << " "+evt.print();
84 
85  return l;
86 }

Member Data Documentation

◆ m_d

Imp* VP1EvtsOnServerInfo::m_d
private

Definition at line 54 of file VP1EvtsOnServerInfo.h.


The documentation for this class was generated from the following files:
VP1EvtsOnServerInfo::Imp::error
QString error
Definition: VP1EvtsOnServerInfo.cxx:31
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
VP1EvtsOnServerInfo::error
const QString & error() const
Definition: VP1EvtsOnServerInfo.cxx:59
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
VP1EvtsOnServerInfo::Imp::events
QList< VP1EventFile > events
Definition: VP1EvtsOnServerInfo.cxx:34
VP1EvtsOnServerInfo::m_d
Imp * m_d
Definition: VP1EvtsOnServerInfo.h:53
python.selection.number
number
Definition: selection.py:20
VP1EvtsOnServerInfo::isValid
bool isValid() const
Definition: VP1EvtsOnServerInfo.cxx:53
VP1EventFile
Definition: VP1EventFile.h:23
VP1EvtsOnServerInfo::numberOfEvents
unsigned long long numberOfEvents() const
Definition: VP1EvtsOnServerInfo.cxx:229
VP1EvtsOnServerInfo::events
QList< VP1EventFile > events(int timecut=-1, bool requireNewestRunNumber=false) const
Definition: VP1EvtsOnServerInfo.cxx:241