CMS 3D CMS Logo

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

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

#include <DCSRecord.h>

Public Types

typedef std::array< std::string, LastParitionNames
 Get the names of all high-voltage partitions. More...
 
enum  Partition {
  EBp, EBm, EEp, EEm,
  HBHEa, HBHEb, HBHEc, HF,
  HO, RPC, DT0, DTp,
  DTm, CSCp, CSCm, CASTOR,
  ZDC, TIBTID, TOB, TECp,
  TECm, BPIX, FPIX, ESp,
  ESm, GEMp, GEMm, Last
}
 

Public Member Functions

 DCSRecord ()
 
 DCSRecord (const online::DCS_v1 &)
 
 DCSRecord (const online::DCS_v2 &)
 
bool highVoltageReady (const uint8_t partitionNumber) const
 Return true if the high voltage of the given parition is ready. More...
 
bool highVoltageValid (const uint8_t partitionNumber) const
 Return true if the high voltage bit of the given partition is valid. More...
 
float magnetCurrent () const
 Return the current of the CMS magnet in A. More...
 
float magneticField () const
 
const ParitionNamesparitionNames () const
 
const std::string & partitionName (const uint8_t partitionNumber) const
 Return the name of the high voltage of the given parition. More...
 
const edm::Timestamptimestamp () const
 Return the time of the last change. More...
 
virtual ~DCSRecord ()
 

Private Attributes

std::bitset< Partition::Last > highVoltageReady_
 
std::bitset< Partition::Last > highVoltageValid_
 
float magnetCurrent_
 
edm::Timestamp timestamp_
 

Static Private Attributes

static const ParitionNames partitionNames_
 

Detailed Description

Class to contain DCS information from soft FED 1022.

Author
Remi Mommsen - Fermilab

Definition at line 20 of file DCSRecord.h.

Member Typedef Documentation

◆ ParitionNames

typedef std::array<std::string, Last> DCSRecord::ParitionNames

Get the names of all high-voltage partitions.

Definition at line 64 of file DCSRecord.h.

Member Enumeration Documentation

◆ Partition

Enumerator
EBp 
EBm 
EEp 
EEm 
HBHEa 
HBHEb 
HBHEc 
HF 
HO 
RPC 
DT0 
DTp 
DTm 
CSCp 
CSCm 
CASTOR 
ZDC 
TIBTID 
TOB 
TECp 
TECm 
BPIX 
FPIX 
ESp 
ESm 
GEMp 
GEMm 
Last 

Definition at line 24 of file DCSRecord.h.

Constructor & Destructor Documentation

◆ DCSRecord() [1/3]

DCSRecord::DCSRecord ( )

Definition at line 11 of file DCSRecord.cc.

static Timestamp invalidTimestamp()
Definition: Timestamp.h:75
float magnetCurrent_
Definition: DCSRecord.h:87
edm::Timestamp timestamp_
Definition: DCSRecord.h:84

◆ DCSRecord() [2/3]

DCSRecord::DCSRecord ( const online::DCS_v1 dcs)
explicit

Definition at line 13 of file DCSRecord.cc.

References online::DCS_v1::highVoltageReady, highVoltageReady_, highVoltageValid_, online::DCS_v1::magnetCurrent, magnetCurrent_, seconds(), online::DCS_v1::timestamp, and timestamp_.

13  {
14  // DIP timestamp is in milliseconds
15  const uint64_t seconds = dcs.timestamp / 1000;
16  const uint32_t microseconds = (dcs.timestamp % 1000) * 1000;
17  timestamp_ = edm::Timestamp((seconds << 32) | microseconds);
19  //bit always valid for V1
20  highVoltageValid_ = 0xffffffff;
22 }
const uint32_t highVoltageReady
std::bitset< Partition::Last > highVoltageReady_
Definition: DCSRecord.h:85
double seconds()
float magnetCurrent_
Definition: DCSRecord.h:87
unsigned long long uint64_t
Definition: Time.h:13
const uint64_t timestamp
const float magnetCurrent
edm::Timestamp timestamp_
Definition: DCSRecord.h:84
std::bitset< Partition::Last > highVoltageValid_
Definition: DCSRecord.h:86

◆ DCSRecord() [3/3]

DCSRecord::DCSRecord ( const online::DCS_v2 dcs)
explicit

Definition at line 24 of file DCSRecord.cc.

References online::DCS_v2::highVoltageReady, highVoltageReady_, online::DCS_v2::highVoltageValid, highVoltageValid_, online::DCS_v2::magnetCurrent, magnetCurrent_, seconds(), online::DCS_v2::timestamp, and timestamp_.

24  {
25  // DIP timestamp is in milliseconds
26  const uint64_t seconds = dcs.timestamp / 1000;
27  const uint32_t microseconds = (dcs.timestamp % 1000) * 1000;
28  timestamp_ = edm::Timestamp((seconds << 32) | microseconds);
32 }
std::bitset< Partition::Last > highVoltageReady_
Definition: DCSRecord.h:85
double seconds()
const uint32_t highVoltageValid
float magnetCurrent_
Definition: DCSRecord.h:87
unsigned long long uint64_t
Definition: Time.h:13
const float magnetCurrent
const uint32_t highVoltageReady
const uint64_t timestamp
edm::Timestamp timestamp_
Definition: DCSRecord.h:84
std::bitset< Partition::Last > highVoltageValid_
Definition: DCSRecord.h:86

◆ ~DCSRecord()

DCSRecord::~DCSRecord ( )
virtual

Definition at line 34 of file DCSRecord.cc.

34 {}

Member Function Documentation

◆ highVoltageReady()

bool DCSRecord::highVoltageReady ( const uint8_t  partitionNumber) const
inline

Return true if the high voltage of the given parition is ready.

Definition at line 71 of file DCSRecord.h.

References highVoltageReady_.

Referenced by operator<<().

71 { return highVoltageReady_.test(partitionNumber); }
std::bitset< Partition::Last > highVoltageReady_
Definition: DCSRecord.h:85

◆ highVoltageValid()

bool DCSRecord::highVoltageValid ( const uint8_t  partitionNumber) const
inline

Return true if the high voltage bit of the given partition is valid.

Definition at line 74 of file DCSRecord.h.

References highVoltageValid_.

Referenced by operator<<().

74 { return highVoltageValid_.test(partitionNumber); }
std::bitset< Partition::Last > highVoltageValid_
Definition: DCSRecord.h:86

◆ magnetCurrent()

float DCSRecord::magnetCurrent ( ) const
inline

Return the current of the CMS magnet in A.

Definition at line 77 of file DCSRecord.h.

References magnetCurrent_.

Referenced by operator<<().

77 { return magnetCurrent_; }
float magnetCurrent_
Definition: DCSRecord.h:87

◆ magneticField()

float DCSRecord::magneticField ( ) const
inline

Return the magnetic field of the CMS magnet in T The precision is 0.6 to 1.8 mT in the range of a current from 9500 to 18164 A (from Vyach.nosp@m.esla.nosp@m.v.Kly.nosp@m.ukhi.nosp@m.n@cer.nosp@m.n.ch)

Definition at line 81 of file DCSRecord.h.

References magnetCurrent_.

81 { return (0.0002067 * magnetCurrent_ + 0.0557973); }
float magnetCurrent_
Definition: DCSRecord.h:87

◆ paritionNames()

const ParitionNames& DCSRecord::paritionNames ( ) const
inline

Definition at line 65 of file DCSRecord.h.

References partitionNames_.

65 { return partitionNames_; }
static const ParitionNames partitionNames_
Definition: DCSRecord.h:88

◆ partitionName()

const std::string& DCSRecord::partitionName ( const uint8_t  partitionNumber) const
inline

Return the name of the high voltage of the given parition.

Definition at line 68 of file DCSRecord.h.

References partitionNames_.

Referenced by operator<<().

68 { return partitionNames_.at(partitionNumber); }
static const ParitionNames partitionNames_
Definition: DCSRecord.h:88

◆ timestamp()

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

Return the time of the last change.

Definition at line 61 of file DCSRecord.h.

References timestamp_.

Referenced by operator<<().

61 { return timestamp_; }
edm::Timestamp timestamp_
Definition: DCSRecord.h:84

Member Data Documentation

◆ highVoltageReady_

std::bitset<Partition::Last> DCSRecord::highVoltageReady_
private

Definition at line 85 of file DCSRecord.h.

Referenced by DCSRecord(), and highVoltageReady().

◆ highVoltageValid_

std::bitset<Partition::Last> DCSRecord::highVoltageValid_
private

Definition at line 86 of file DCSRecord.h.

Referenced by DCSRecord(), and highVoltageValid().

◆ magnetCurrent_

float DCSRecord::magnetCurrent_
private

Definition at line 87 of file DCSRecord.h.

Referenced by DCSRecord(), magnetCurrent(), and magneticField().

◆ partitionNames_

const DCSRecord::ParitionNames DCSRecord::partitionNames_
staticprivate
Initial value:
= {
{"EBp", "EBm", "EEp", "EEm", "HBHEa", "HBHEb", "HBHEc", "HF", "HO", "RPC", "DT0", "DTp", "DTm", "CSCp",
"CSCm", "CASTOR", "ZDC", "TIBTID", "TOB", "TECp", "TECm", "BPIX", "FPIX", "ESp", "ESm", "GEMp", "GEMm"}}

Definition at line 88 of file DCSRecord.h.

Referenced by paritionNames(), and partitionName().

◆ timestamp_

edm::Timestamp DCSRecord::timestamp_
private

Definition at line 84 of file DCSRecord.h.

Referenced by DCSRecord(), and timestamp().