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_ = {{"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 54 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_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 22 of file CTPPSRecord.h.

◆ Status

Enumerator
unused 
bad 
warning 
ok 

Definition at line 44 of file CTPPSRecord.h.

Constructor & Destructor Documentation

◆ CTPPSRecord() [1/2]

CTPPSRecord::CTPPSRecord ( )

Definition at line 28 of file CTPPSRecord.cc.

static Timestamp invalidTimestamp()
Definition: Timestamp.h:82
uint64_t status_
Definition: CTPPSRecord.h:68
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:67

◆ CTPPSRecord() [2/2]

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

Definition at line 30 of file CTPPSRecord.cc.

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

30  {
31  // DIP timestamp is in milliseconds
32  const uint64_t seconds = ctpps.timestamp / 1000;
33  const uint32_t microseconds = (ctpps.timestamp % 1000) * 1000;
34  timestamp_ = edm::Timestamp((seconds << 32) | microseconds);
35  status_ = ctpps.status;
36 }
double seconds()
unsigned long long uint64_t
Definition: Time.h:13
uint64_t status_
Definition: CTPPSRecord.h:68
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:67

◆ ~CTPPSRecord()

CTPPSRecord::~CTPPSRecord ( )
virtual

Definition at line 38 of file CTPPSRecord.cc.

38 {}

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 58 of file CTPPSRecord.h.

References romanPotNames_.

Referenced by operator<<().

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

◆ romanPotNames()

const RomanPotNames& CTPPSRecord::romanPotNames ( ) const
inline

Definition at line 55 of file CTPPSRecord.h.

References romanPotNames_.

55 { return romanPotNames_; }
static const RomanPotNames romanPotNames_
Definition: CTPPSRecord.h:70

◆ status()

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

Return the status of the given roman pot.

Definition at line 61 of file CTPPSRecord.h.

References status_.

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

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

◆ statusName()

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

Return the status as string.

Definition at line 64 of file CTPPSRecord.h.

References status(), and statusNames_.

Referenced by operator<<().

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

◆ timestamp()

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

Return the time of the last change.

Definition at line 51 of file CTPPSRecord.h.

References timestamp_.

Referenced by operator<<().

51 { return timestamp_; }
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:67

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_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 70 of file CTPPSRecord.h.

Referenced by romanPotName(), and romanPotNames().

◆ status_

uint64_t CTPPSRecord::status_
private

Definition at line 68 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 69 of file CTPPSRecord.h.

Referenced by statusName().

◆ timestamp_

edm::Timestamp CTPPSRecord::timestamp_
private

Definition at line 67 of file CTPPSRecord.h.

Referenced by CTPPSRecord(), and timestamp().