CMS 3D CMS Logo

CTPPSPixelFramePosition.cc
Go to the documentation of this file.
1  /****************************************************************************
2  *
3  *
4  * Authors:
5  * F.Ferro ferro@ge.infn.it
6  *
7  ****************************************************************************/
8 
11 #include <iomanip>
12 
13 using namespace std;
14 
15 //----------------------------------------------------------------------------------------------------
16 
17 std::ostream& operator << (std::ostream& s, const CTPPSPixelFramePosition &fp)
18 {
19  return s
20  << fp.getFEDId() << ":"
21  << fp.getFMCId() << ":"
22  << fp.getChannelIdx() << ":"
23  << fp.getROC();
24 }
25 
26 //----------------------------------------------------------------------------------------------------
27 
29 {
30  edm::LogInfo("printXML") << "\" FEDId=\"" << getFEDId()
31  << "\" FMCId=\"" << getFMCId()
32  << "\" ChannelIdx=\"" << getChannelIdx()
33  << "\" ROC=\"" << getROC()
34  << "\"";
35 }
36 
37 //----------------------------------------------------------------------------------------------------
38 
40  unsigned char &flag)
41 {
42  unsigned int v = atoi(value.c_str());
43 
44  if (attribute == "FEDId")
45  {
46  setFEDId(v);
47  flag |= 0x8;
48  return 0;
49  }
50 
51  if (attribute == "FMC")
52  {
53  setFMCId(v);
54  flag |= 0x4;
55  return 0;
56  }
57 
58  if (attribute == "FEDChannel")
59  {
60  setChannelIdx(v);
61  flag |= 0x2;
62  return 0;
63  }
64 
65  if (attribute == "ROCinChannel")
66  {
67  setROC(v);
68  flag |= 0x1;
69  return 0;
70  }
71 
72  return 1;
73 }
void printXML()
prints XML formatted DAQ channel to stdout
unsigned char setXMLAttribute(const std::string &attribute, const std::string &value, unsigned char &flag)
unsigned short getFMCId() const
Definition: value.py:1
std::ostream & operator<<(std::ostream &out, const std::tuple< Types... > &value)
Definition: Utilities.h:38
unsigned short getChannelIdx() const
unsigned short getROC() const
unsigned short getFEDId() const
recomended getters and setters