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.

44 { unused, bad, warning, ok };

Constructor & Destructor Documentation

◆ CTPPSRecord() [1/2]

CTPPSRecord::CTPPSRecord ( )

Definition at line 28 of file CTPPSRecord.cc.

◆ CTPPSRecord() [2/2]

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

Definition at line 30 of file CTPPSRecord.cc.

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 }

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

◆ ~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.

58 { return romanPotNames_.at(rp); }

References romanPotNames_.

Referenced by operator<<().

◆ romanPotNames()

const RomanPotNames& CTPPSRecord::romanPotNames ( ) const
inline

Definition at line 55 of file CTPPSRecord.h.

55 { return romanPotNames_; }

References romanPotNames_.

◆ 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.

61 { return Status((status_ >> (rp * 2)) & 0x3); }

References status_.

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

◆ 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.

64 { return statusNames_.at(status(rp)); }

References status(), and statusNames_.

Referenced by operator<<().

◆ timestamp()

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

Return the time of the last change.

Definition at line 51 of file CTPPSRecord.h.

51 { return timestamp_; }

References timestamp_.

Referenced by operator<<().

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().

CTPPSRecord::RP_45_220_FR_TP
Definition: CTPPSRecord.h:29
CTPPSRecord::status
Status status(const uint8_t rp) const
Return the status of the given roman pot.
Definition: CTPPSRecord.h:61
CTPPSRecord::ok
Definition: CTPPSRecord.h:44
CTPPSRecord::RP_56_220_NR_BT
Definition: CTPPSRecord.h:39
CTPPSRecord::RP_45_210_FR_TP
Definition: CTPPSRecord.h:25
CTPPSRecord::RP_45_220_FR_BT
Definition: CTPPSRecord.h:27
CTPPSRecord::romanPotNames_
static const RomanPotNames romanPotNames_
Definition: CTPPSRecord.h:70
CTPPSRecord::RP_45_220_NR_BT
Definition: CTPPSRecord.h:30
CTPPSRecord::Last
Definition: CTPPSRecord.h:41
seconds
double seconds()
CTPPSRecord::RP_56_210_FR_HR
Definition: CTPPSRecord.h:33
CTPPSRecord::RP_45_220_FR_HR
Definition: CTPPSRecord.h:28
CTPPSRecord::Status
Status
Definition: CTPPSRecord.h:44
CTPPSRecord::RP_45_220_C1
Definition: CTPPSRecord.h:26
CTPPSRecord::unused
Definition: CTPPSRecord.h:44
CTPPSRecord::RP_56_220_C1
Definition: CTPPSRecord.h:35
online::CTPPS_v1::status
uint64_t status
Definition: OnlineMetaDataRaw.h:45
CTPPSRecord::RP_56_220_FR_TP
Definition: CTPPSRecord.h:38
CTPPSRecord::bad
Definition: CTPPSRecord.h:44
CTPPSRecord::RP_56_210_FR_BT
Definition: CTPPSRecord.h:32
edm::Timestamp::invalidTimestamp
static Timestamp invalidTimestamp()
Definition: Timestamp.h:82
CTPPSRecord::statusNames_
static const std::array< std::string, 4 > statusNames_
Definition: CTPPSRecord.h:69
CTPPSRecord::RP_56_220_NR_TP
Definition: CTPPSRecord.h:40
CTPPSRecord::RP_45_220_NR_TP
Definition: CTPPSRecord.h:31
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
CTPPSRecord::status_
uint64_t status_
Definition: CTPPSRecord.h:68
CTPPSRecord::RP_45_210_FR_BT
Definition: CTPPSRecord.h:23
CTPPSRecord::RP_56_220_FR_HR
Definition: CTPPSRecord.h:37
CTPPSRecord::warning
Definition: CTPPSRecord.h:44
online::CTPPS_v1::timestamp
uint64_t timestamp
Definition: OnlineMetaDataRaw.h:44
CTPPSRecord::RP_56_210_FR_TP
Definition: CTPPSRecord.h:34
CTPPSRecord::timestamp_
edm::Timestamp timestamp_
Definition: CTPPSRecord.h:67
CTPPSRecord::RP_56_220_FR_BT
Definition: CTPPSRecord.h:36
CTPPSRecord::RP_45_210_FR_HR
Definition: CTPPSRecord.h:24
edm::Timestamp
Definition: Timestamp.h:30