CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1DataEmulDigi.cc
Go to the documentation of this file.
2 #include <iomanip>
3 
4 bool L1DataEmulDigi::empty() const {
5  if(m_sid == m_null || m_cid == m_null )
6  return true;
7  bool val = true;
8  for(int i=0; i<2; i++)
9  val &= ( m_location[i]==m_null );
10  return val;
11 }
12 
14  m_null = -99;
15  m_sid = m_null;
16  m_cid = m_null;
17  for(int i=0; i<3; i++)
19  m_type = m_null;
20  std::fill(m_data,m_data+sizeof(m_data)/sizeof(m_data[0]),0);
21  std::fill(m_rank,m_rank+sizeof(m_rank)/sizeof(m_rank[0]),m_null);
23  m_DEpair[0]=def; m_DEpair[1]=def;
24  return m_null;
25 }
26 
28  reset();
29 }
30 
31 L1DataEmulDigi::L1DataEmulDigi( int sid, int cid, double x1, double x2, double x3, int n) {
32  reset();
33  m_sid = sid; m_cid = cid;
35  m_type = n;
36 }
37 
38 L1DataEmulDigi::L1DataEmulDigi( int sid, int cid, double x1, double x2, double x3, int n,
39  unsigned int dw, unsigned int ew, float dr, float er,
40  const L1MonitorDigi& dm, const L1MonitorDigi& em) {
41  reset();
42  m_sid = sid; m_cid = cid;
44  m_type = n;
45  m_data [0]=dw; m_data [1]=ew;
46  m_rank [0]=dr; m_rank [1]=er;
47  m_DEpair[0]=dm; m_DEpair[1]=em;
48 }
49 
51 
52 std::ostream& operator<<(std::ostream& s, const L1DataEmulDigi& de) {
53  unsigned word[2];
54  float rankarr[2];
55  de.data(word);
56  de.rank(rankarr);
57  s << "DEdigi"
58  << " subsystem: " << std::setw(2) << de.sid()
59  << " (cid." << std::setw(2) << de.cid() << ")"
60  << " location: "
61  << "(" << std::setw(5) << std::setprecision(2) << de.x1()
62  << "," << std::setw(5) << std::setprecision(2) << de.x2()
63  << "," << std::setw(5) << std::setprecision(2) << de.x3() << ")"
64  << " type: " << de.type()
65  << std::hex << std::setfill('0')
66  << " dword:0x" << std::setw(8)<< word[0]
67  << " eword:0x" << std::setw(8)<< word[1]
68  << std::dec << std::setfill(' ')
69  << " rank:"
70  << "(" << std::setw(5) << std::setprecision(2) << rankarr[0]
71  << "," << std::setw(5) << std::setprecision(2) << rankarr[1] << ")";
72  return s;
73 }
74 
76  this->reset();
77 }
78 
80  const int w64 = 64;
81  for(int j=0; j<2; j++) {
82  globalDBit[j]=false;
83  gltDecBits[j].reserve(w64*2);
84  gltTchBits[j].reserve(w64 );
85  for(int i=0; i<w64; i++) {
86  gltDecBits[j][i] =false;
87  gltDecBits[j][i+w64]=false;
88  gltTchBits[j][i] =false;
89  }
90  }
91 }
92 
93 GltDEDigi::GltDEDigi(bool glbit[], GltBits dbits[], GltBits tbits[]) {
94  this->set(glbit, dbits, tbits);
95 }
96 
97 void GltDEDigi::set(bool glbit[], GltBits dbits[], GltBits tbits[]) {
98  for(int i=0; i<2; i++) {
99  globalDBit[i]=glbit[i];
100  gltDecBits[i]=dbits[i];
101  gltTchBits[i]=tbits[i];
102  }
103 }
104 
105 std::ostream& operator<<(std::ostream& s, const GltDEDigi& glt) {
106  GltDEDigi::GltBits dbits[2], tbits[2];
107  bool glbit[2];
108  for(int i=0; i<2; i++) {
109  glbit[i]=glt.globalDBit[i];
110  dbits[i]=glt.gltDecBits[i];
111  tbits[i]=glt.gltTchBits[i];
112  }
113  s << "GT DEdigi"
114  << " decision: "
115  << glbit[0];
116  if(glbit[0]!=glbit[1])
117  s << "(data), " << glbit[1] << "(emul)";
118  s << "\n data dec-word: ";
119  for(GltDEDigi::GltBits::const_iterator i=dbits[0].begin();
120  i!=dbits[0].end(); i++) s<<*i;
121  s << "\n emul dec-word: ";
122  for(GltDEDigi::GltBits::const_iterator i=dbits[1].begin();
123  i!=dbits[1].end(); i++) s<<*i;
124  s << "\n data techical: ";
125  for(GltDEDigi::GltBits::const_iterator i=tbits[0].begin();
126  i!=tbits[0].end(); i++) s<<*i;
127  s << "\n emul technical: ";
128  for(GltDEDigi::GltBits::const_iterator i=tbits[1].begin();
129  i!=tbits[1].end(); i++) s<<*i;
130  return s;
131 }
void rank(float *r) const
int i
Definition: DBlmapReader.cc:9
int sid() const
int type() const
string fill
Definition: lumiContext.py:319
std::vector< bool > GltBits
void set(bool glbit[], GltBits dbits[], GltBits tbits[])
GltBits gltTchBits[2]
void data(unsigned int *d) const
unsigned int m_data[2]
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
int cid() const
double x2() const
double x1() const
int j
Definition: DBlmapReader.cc:9
L1MonitorDigi m_DEpair[2]
void reset()
bool empty() const
double glt
Definition: hdecay.h:104
#define begin
Definition: vmac.h:30
double x3() const
double m_location[3]
JetCorrectorParameters::Definitions def
Definition: classes.h:6
bool globalDBit[2]
GltBits gltDecBits[2]