CMS 3D CMS Logo

TotemT2FramePosition.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of the TOTEM offline software.
4 * Authors:
5 * Jan Kašpar (jan.kaspar@gmail.com)
6 *
7 ****************************************************************************/
8 
10 
11 #include <iomanip>
12 #include <cstdlib>
13 
14 using namespace std;
15 
16 //----------------------------------------------------------------------------------------------------
17 
18 std::ostream &operator<<(std::ostream &s, const TotemT2FramePosition &fp) {
19  return s << fp.getFEDId() << ":" << fp.getGOHId() << ":" << fp.getIdxInFiber() << ":" << fp.getPayload();
20 }
21 
22 //----------------------------------------------------------------------------------------------------
23 
25  cout << "\" FEDId=\"" << getFEDId() << "\" GOHId=\"" << getGOHId() << "\" IdxInFiber=\"" << getIdxInFiber()
26  << "\" pay=\"" << getPayload() << "\"";
27 }
28 
29 //----------------------------------------------------------------------------------------------------
30 
31 unsigned char TotemT2FramePosition::setXMLAttribute(const std::string &attribute,
32  const std::string &value,
33  unsigned char &flag) {
34  unsigned int v = atoi(value.c_str());
35 
36  if (attribute == "FEDId") {
37  setFEDId(v);
38  flag |= 0x1C; // SubSystem + TOTFED + OptoRx
39  return 0;
40  }
41 
42  if (attribute == "pay") {
43  setPayload(v);
44  flag |= 0x20; //T2 payload
45  return 0;
46  }
47 
48  if (attribute == "GOHId") {
49  setGOHId(v);
50  flag |= 0x2;
51  return 0;
52  }
53 
54  if (attribute == "IdxInFiber") {
55  setIdxInFiber(v);
56  flag |= 0x1;
57  return 0;
58  }
59 
60  return 1;
61 }
void printXML()
prints XML formatted DAQ channel to stdout
def getPayload(session, hash)
Definition: conddblib.py:672
Definition: value.py:1
std::ostream & operator<<(std::ostream &out, const std::tuple< Types... > &value)
Definition: Utilities.h:32
unsigned char setXMLAttribute(const std::string &attribute, const std::string &value, unsigned char &flag)