File indexing completed on 2024-04-06 12:02:29
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "CondFormats/PPSObjects/interface/TotemT2FramePosition.h"
0010
0011 #include <iomanip>
0012 #include <cstdlib>
0013
0014 using namespace std;
0015
0016
0017
0018 std::ostream &operator<<(std::ostream &s, const TotemT2FramePosition &fp) {
0019 return s << fp.getFEDId() << ":" << fp.getGOHId() << ":" << fp.getIdxInFiber() << ":" << fp.getPayload();
0020 }
0021
0022
0023
0024 void TotemT2FramePosition::printXML() {
0025 cout << "\" FEDId=\"" << getFEDId() << "\" GOHId=\"" << getGOHId() << "\" IdxInFiber=\"" << getIdxInFiber()
0026 << "\" pay=\"" << getPayload() << "\"";
0027 }
0028
0029
0030
0031 unsigned char TotemT2FramePosition::setXMLAttribute(const std::string &attribute,
0032 const std::string &value,
0033 unsigned char &flag) {
0034 unsigned int v = atoi(value.c_str());
0035
0036 if (attribute == "FEDId") {
0037 setFEDId(v);
0038 flag |= 0x1C;
0039 return 0;
0040 }
0041
0042 if (attribute == "pay") {
0043 setPayload(v);
0044 flag |= 0x20;
0045 return 0;
0046 }
0047
0048 if (attribute == "GOHId") {
0049 setGOHId(v);
0050 flag |= 0x2;
0051 return 0;
0052 }
0053
0054 if (attribute == "IdxInFiber") {
0055 setIdxInFiber(v);
0056 flag |= 0x1;
0057 return 0;
0058 }
0059
0060 return 1;
0061 }