CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes | Static Private Attributes
CTPPSRecord Class Reference

Class to contain CTPPS information from soft FED 1022. More...

#include <CTPPSRecord.h>

Public Types

enum  RomanPot {
  RP_45_210_FR_BT, RP_45_210_FR_HR, RP_45_210_FR_TP, RP_45_220_C1,
  RP_45_220_FR_BT, RP_45_220_FR_HR, RP_45_220_FR_TP, RP_45_220_NR_BT,
  RP_45_220_NR_TP, RP_56_210_FR_BT, RP_56_210_FR_HR, RP_56_210_FR_TP,
  RP_56_220_C1, RP_56_220_FR_BT, RP_56_220_FR_HR, RP_56_220_FR_TP,
  RP_56_220_NR_BT, RP_56_220_NR_TP, Last
}
 
typedef std::array< std::string, LastRomanPotNames
 Get the names of all roman pots. More...
 
enum  Status { unused, bad, warning, ok }
 

Public Member Functions

 CTPPSRecord ()
 
 CTPPSRecord (const online::CTPPS_v1 &)
 
const std::string & romanPotName (const uint8_t rp) const
 Return the name of the roman pot. More...
 
const RomanPotNamesromanPotNames () const
 
Status status (const uint8_t rp) const
 Return the status of the given roman pot. More...
 
const std::string & statusName (const uint8_t rp) const
 Return the status as string. More...
 
const edm::Timestamptimestamp () const
 Return the time of the last change. More...
 
virtual ~CTPPSRecord ()
 

Private Attributes

uint64_t status_
 
edm::Timestamp timestamp_
 

Static Private Attributes

static const RomanPotNames romanPotNames_
 
static const std::array< std::string, 4 > statusNames_
 

Detailed Description

Class to contain CTPPS information from soft FED 1022.

Author
Remi Mommsen - Fermilab

Definition at line 22 of file CTPPSRecord.h.

Member Typedef Documentation

typedef std::array<std::string,Last> CTPPSRecord::RomanPotNames

Get the names of all roman pots.

Definition at line 63 of file CTPPSRecord.h.

Member Enumeration Documentation

Enumerator
RP_45_210_FR_BT 
RP_45_210_FR_HR 
RP_45_210_FR_TP 
RP_45_220_C1 
RP_45_220_FR_BT 
RP_45_220_FR_HR 
RP_45_220_FR_TP 
RP_45_220_NR_BT 
RP_45_220_NR_TP 
RP_56_210_FR_BT 
RP_56_210_FR_HR 
RP_56_210_FR_TP 
RP_56_220_C1 
RP_56_220_FR_BT 
RP_56_220_FR_HR 
RP_56_220_FR_TP 
RP_56_220_NR_BT 
RP_56_220_NR_TP 
Last 

Definition at line 26 of file CTPPSRecord.h.

Enumerator
unused 
bad 
warning 
ok 

Definition at line 48 of file CTPPSRecord.h.

Constructor & Destructor Documentation

CTPPSRecord::CTPPSRecord ( )

Definition at line 34 of file CTPPSRecord.cc.

34  :
36  status_(0)
37 {}
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
uint64_t status_
Definition: CTPPSRecord.h:79
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:78
CTPPSRecord::CTPPSRecord ( const online::CTPPS_v1 ctpps)
explicit

Definition at line 40 of file CTPPSRecord.cc.

References seconds(), online::CTPPS_v1::status, status_, online::CTPPS_v1::timestamp, and timestamp_.

41 {
42  // DIP timestamp is in milliseconds
43  const uint64_t seconds = ctpps.timestamp / 1000;
44  const uint32_t microseconds = (ctpps.timestamp % 1000) * 1000;
45  timestamp_ = edm::Timestamp((seconds<<32) | microseconds );
46  status_ = ctpps.status;
47 }
double seconds()
unsigned long long uint64_t
Definition: Time.h:15
uint64_t status_
Definition: CTPPSRecord.h:79
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:78
CTPPSRecord::~CTPPSRecord ( )
virtual

Definition at line 50 of file CTPPSRecord.cc.

50 {}

Member Function Documentation

const std::string& CTPPSRecord::romanPotName ( const uint8_t  rp) const
inline

Return the name of the roman pot.

Definition at line 67 of file CTPPSRecord.h.

References romanPotNames_.

Referenced by operator<<().

67 { return romanPotNames_.at(rp); }
static const RomanPotNames romanPotNames_
Definition: CTPPSRecord.h:81
const RomanPotNames& CTPPSRecord::romanPotNames ( ) const
inline

Definition at line 64 of file CTPPSRecord.h.

References romanPotNames_.

64 { return romanPotNames_; }
static const RomanPotNames romanPotNames_
Definition: CTPPSRecord.h:81
Status CTPPSRecord::status ( const uint8_t  rp) const
inline

Return the status of the given roman pot.

Definition at line 70 of file CTPPSRecord.h.

References status_.

Referenced by CTPPSCommonDQMSource::analyzeCTPPSRecord(), and statusName().

70 { return Status((status_ >> (rp*2)) & 0x3); }
uint64_t status_
Definition: CTPPSRecord.h:79
const std::string& CTPPSRecord::statusName ( const uint8_t  rp) const
inline

Return the status as string.

Definition at line 73 of file CTPPSRecord.h.

References status(), and statusNames_.

Referenced by operator<<().

73 { return statusNames_.at( status(rp) ); }
Status status(const uint8_t rp) const
Return the status of the given roman pot.
Definition: CTPPSRecord.h:70
static const std::array< std::string, 4 > statusNames_
Definition: CTPPSRecord.h:80
const edm::Timestamp& CTPPSRecord::timestamp ( ) const
inline

Return the time of the last change.

Definition at line 60 of file CTPPSRecord.h.

References timestamp_.

Referenced by operator<<().

60 { return timestamp_; }
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:78

Member Data Documentation

const CTPPSRecord::RomanPotNames CTPPSRecord::romanPotNames_
staticprivate
Initial value:
=
{{
"RP_45_210_FR_BT",
"RP_45_210_FR_HR",
"RP_45_210_FR_TP",
"RP_45_220_C1",
"RP_45_220_FR_BT",
"RP_45_220_FR_HR",
"RP_45_220_FR_TP",
"RP_45_220_NR_BT",
"RP_45_220_NR_TP",
"RP_56_210_FR_BT",
"RP_56_210_FR_HR",
"RP_56_210_FR_TP",
"RP_56_220_C1",
"RP_56_220_FR_BT",
"RP_56_220_FR_HR",
"RP_56_220_FR_TP",
"RP_56_220_NR_BT",
"RP_56_220_NR_TP"
}}

Definition at line 81 of file CTPPSRecord.h.

Referenced by romanPotName(), and romanPotNames().

uint64_t CTPPSRecord::status_
private

Definition at line 79 of file CTPPSRecord.h.

Referenced by CTPPSRecord(), and status().

const std::array< std::string, 4 > CTPPSRecord::statusNames_
staticprivate
Initial value:
=
{{"unused","bad","warning","ok"}}

Definition at line 80 of file CTPPSRecord.h.

Referenced by statusName().

edm::Timestamp CTPPSRecord::timestamp_
private

Definition at line 78 of file CTPPSRecord.h.

Referenced by CTPPSRecord(), and timestamp().