ATLAS Offline Software
CoWRecord.h
Go to the documentation of this file.
1 // --*- c++ -*--
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef COWTOOLS_RECORD
8 #define COWTOOLS_RECORD
10 
11 namespace CoWTools{
12  class CoWRecord{
13  public:
14  CoWRecord(bool summary=true):
15  addrStart(0),
16  addrEnd(0),
17  perms(0),
18  offset(0),
19  inode(0),
20  m_ms(summary),
21  dmin(0),
22  dmaj(0)
23  {}
24  unsigned long addrStart,addrEnd;
25  short perms;
26  unsigned long long offset;
27  unsigned long inode;
29  unsigned int dmin,dmaj;
30  void parseRecord(std::istream& in);
31  public:
32  friend CoWRecord operator-(CoWRecord lhs, const CoWRecord& rhs){
33  return lhs-=rhs;
34  }
36  CoWRecord m(*this);
37  m.m_ms=-m_ms;
38  return m;
39  }
40  explicit operator bool() const {
41  auto vals=m_ms.getValueArray();
42  for(int i=0;i<11;i++){
43  if(vals[i])return true;
44  }
45  return false;
46  }
47 
48  friend CoWRecord operator+(CoWRecord lhs, const CoWRecord& rhs){
49  return lhs+=rhs;
50  }
51 
52  inline CoWRecord& operator+=(const CoWRecord& rhs){
53  perms|=rhs.perms;
54  m_ms+=rhs.m_ms;
55  return *this;
56  }
57 
58  inline CoWRecord& operator-=(const CoWRecord& rhs){
59  perms^=rhs.perms;
60  m_ms-=rhs.m_ms;
61  return *this;
62  }
63  };
64 
65 }//end namespace
66 
67 #endif
CoWTools::CoWRecord::operator-
CoWRecord operator-() const
Definition: CoWRecord.h:35
CoWTools::CoWRecordStats::getValueArray
long long * getValueArray()
Definition: CoWRecordStats.h:94
CoWTools::CoWRecord
Definition: CoWRecord.h:12
CoWTools::CoWRecord::operator+=
CoWRecord & operator+=(const CoWRecord &rhs)
Definition: CoWRecord.h:52
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
CoWTools::CoWRecord::offset
unsigned long long offset
Definition: CoWRecord.h:26
CoWTools::CoWRecord::parseRecord
void parseRecord(std::istream &in)
Definition: CoWRecord.cxx:8
CoWTools::CoWRecord::addrEnd
unsigned long addrEnd
Definition: CoWRecord.h:24
CoWTools::CoWRecord::addrStart
unsigned long addrStart
Definition: CoWRecord.h:24
lumiFormat.i
int i
Definition: lumiFormat.py:85
CoWTools::CoWRecord::operator-=
CoWRecord & operator-=(const CoWRecord &rhs)
Definition: CoWRecord.h:58
CoWTools::CoWRecord::CoWRecord
CoWRecord(bool summary=true)
Definition: CoWRecord.h:14
CoWTools::CoWRecord::perms
short perms
Definition: CoWRecord.h:25
CoWTools::CoWRecord::dmaj
unsigned int dmaj
Definition: CoWRecord.h:29
CoWTools::CoWRecordStats
Definition: CoWRecordStats.h:13
CoWTools
Definition: CoWLibrary.h:15
CoWTools::CoWRecord::dmin
unsigned int dmin
Definition: CoWRecord.h:29
CoWTools::CoWRecord::operator-
friend CoWRecord operator-(CoWRecord lhs, const CoWRecord &rhs)
Definition: CoWRecord.h:32
CoWTools::CoWRecord::operator+
friend CoWRecord operator+(CoWRecord lhs, const CoWRecord &rhs)
Definition: CoWRecord.h:48
CoWRecordStats.h
CoWTools::CoWRecord::m_ms
CoWRecordStats m_ms
Definition: CoWRecord.h:28
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
CoWTools::CoWRecord::inode
unsigned long inode
Definition: CoWRecord.h:27
inode
Definition: listroot.cxx:155
PlotCalibFromCool.vals
vals
Definition: PlotCalibFromCool.py:474
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65