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_HR, 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_HR, 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_ = {{"unused", "bad", "warning", "ok"}}
 

Detailed Description

Class to contain CTPPS information from soft FED 1022.

Author
Remi Mommsen - Fermilab

Definition at line 20 of file CTPPSRecord.h.

Member Typedef Documentation

◆ RomanPotNames

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

Get the names of all roman pots.

Definition at line 56 of file CTPPSRecord.h.

Member Enumeration Documentation

◆ RomanPot

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_HR 
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_HR 
RP_56_220_NR_TP 
Last 

Definition at line 22 of file CTPPSRecord.h.

22  {
43  Last
44  };

◆ Status

Enumerator
unused 
bad 
warning 
ok 

Definition at line 46 of file CTPPSRecord.h.

Constructor & Destructor Documentation

◆ CTPPSRecord() [1/2]

CTPPSRecord::CTPPSRecord ( )

Definition at line 15 of file CTPPSRecord.cc.

static Timestamp invalidTimestamp()
Definition: Timestamp.h:75
uint64_t status_
Definition: CTPPSRecord.h:70
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:69

◆ CTPPSRecord() [2/2]

CTPPSRecord::CTPPSRecord ( const online::CTPPS_v1 ctpps)
explicit

Definition at line 17 of file CTPPSRecord.cc.

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

17  {
18  // DIP timestamp is in milliseconds
19  const uint64_t seconds = ctpps.timestamp / 1000;
20  const uint32_t microseconds = (ctpps.timestamp % 1000) * 1000;
21  timestamp_ = edm::Timestamp((seconds << 32) | microseconds);
22  status_ = ctpps.status;
23 }
double seconds()
unsigned long long uint64_t
Definition: Time.h:13
uint64_t status_
Definition: CTPPSRecord.h:70
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:69

◆ ~CTPPSRecord()

CTPPSRecord::~CTPPSRecord ( )
virtual

Definition at line 25 of file CTPPSRecord.cc.

25 {}

Member Function Documentation

◆ romanPotName()

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

Return the name of the roman pot.

Definition at line 60 of file CTPPSRecord.h.

References romanPotNames_.

Referenced by operator<<().

60 { return romanPotNames_.at(rp); }
static const RomanPotNames romanPotNames_
Definition: CTPPSRecord.h:72

◆ romanPotNames()

const RomanPotNames& CTPPSRecord::romanPotNames ( ) const
inline

Definition at line 57 of file CTPPSRecord.h.

References romanPotNames_.

57 { return romanPotNames_; }
static const RomanPotNames romanPotNames_
Definition: CTPPSRecord.h:72

◆ status()

Status CTPPSRecord::status ( const uint8_t  rp) const
inline

Return the status of the given roman pot.

Definition at line 63 of file CTPPSRecord.h.

References status_.

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

63 { return Status((status_ >> (rp * 2)) & 0x3); }
uint64_t status_
Definition: CTPPSRecord.h:70

◆ statusName()

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

Return the status as string.

Definition at line 66 of file CTPPSRecord.h.

References status(), and statusNames_.

Referenced by operator<<().

66 { return statusNames_.at(status(rp)); }
static const std::array< std::string, 4 > statusNames_
Definition: CTPPSRecord.h:71
Status status(const uint8_t rp) const
Return the status of the given roman pot.
Definition: CTPPSRecord.h:63

◆ timestamp()

const edm::Timestamp& CTPPSRecord::timestamp ( ) const
inline

Return the time of the last change.

Definition at line 53 of file CTPPSRecord.h.

References timestamp_.

Referenced by operator<<().

53 { return timestamp_; }
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:69

Member Data Documentation

◆ romanPotNames_

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_HR", "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_HR", "RP_56_220_NR_TP"}}

Definition at line 72 of file CTPPSRecord.h.

Referenced by romanPotName(), and romanPotNames().

◆ status_

uint64_t CTPPSRecord::status_
private

Definition at line 70 of file CTPPSRecord.h.

Referenced by CTPPSRecord(), and status().

◆ statusNames_

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

Definition at line 71 of file CTPPSRecord.h.

Referenced by statusName().

◆ timestamp_

edm::Timestamp CTPPSRecord::timestamp_
private

Definition at line 69 of file CTPPSRecord.h.

Referenced by CTPPSRecord(), and timestamp().