CMS 3D CMS Logo

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++)
18  m_location[i] = m_null;
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;
24  m_DEpair[1] = def;
25  return m_null;
26 }
27 
29 
30 L1DataEmulDigi::L1DataEmulDigi(int sid, int cid, double x1, double x2, double x3, int n) {
31  reset();
32  m_sid = sid;
33  m_cid = cid;
34  m_location[0] = x1;
35  m_location[1] = x2;
36  m_location[2] = x3;
37  m_type = n;
38 }
39 
41  int cid,
42  double x1,
43  double x2,
44  double x3,
45  int n,
46  unsigned int dw,
47  unsigned int ew,
48  float dr,
49  float er,
50  const L1MonitorDigi& dm,
51  const L1MonitorDigi& em) {
52  reset();
53  m_sid = sid;
54  m_cid = cid;
55  m_location[0] = x1;
56  m_location[1] = x2;
57  m_location[2] = x3;
58  m_type = n;
59  m_data[0] = dw;
60  m_data[1] = ew;
61  m_rank[0] = dr;
62  m_rank[1] = er;
63  m_DEpair[0] = dm;
64  m_DEpair[1] = em;
65 }
66 
68 
69 std::ostream& operator<<(std::ostream& s, const L1DataEmulDigi& de) {
70  unsigned word[2];
71  float rankarr[2];
72  de.data(word);
73  de.rank(rankarr);
74  s << "DEdigi"
75  << " subsystem: " << std::setw(2) << de.sid() << " (cid." << std::setw(2) << de.cid() << ")"
76  << " location: "
77  << "(" << std::setw(5) << std::setprecision(2) << de.x1() << "," << std::setw(5) << std::setprecision(2) << de.x2()
78  << "," << std::setw(5) << std::setprecision(2) << de.x3() << ")"
79  << " type: " << de.type() << std::hex << std::setfill('0') << " dword:0x" << std::setw(8) << word[0] << " eword:0x"
80  << std::setw(8) << word[1] << std::dec << std::setfill(' ') << " rank:"
81  << "(" << std::setw(5) << std::setprecision(2) << rankarr[0] << "," << std::setw(5) << std::setprecision(2)
82  << rankarr[1] << ")";
83  return s;
84 }
85 
87 
89  const int w64 = 64;
90  for (int j = 0; j < 2; j++) {
91  globalDBit[j] = false;
92  gltDecBits[j].reserve(w64 * 2);
93  gltTchBits[j].reserve(w64);
94  for (int i = 0; i < w64; i++) {
95  gltDecBits[j][i] = false;
96  gltDecBits[j][i + w64] = false;
97  gltTchBits[j][i] = false;
98  }
99  }
100 }
101 
102 GltDEDigi::GltDEDigi(bool glbit[], GltBits dbits[], GltBits tbits[]) { this->set(glbit, dbits, tbits); }
103 
104 void GltDEDigi::set(bool glbit[], GltBits dbits[], GltBits tbits[]) {
105  for (int i = 0; i < 2; i++) {
106  globalDBit[i] = glbit[i];
107  gltDecBits[i] = dbits[i];
108  gltTchBits[i] = tbits[i];
109  }
110 }
111 
112 std::ostream& operator<<(std::ostream& s, const GltDEDigi& glt) {
113  GltDEDigi::GltBits dbits[2], tbits[2];
114  bool glbit[2];
115  for (int i = 0; i < 2; i++) {
116  glbit[i] = glt.globalDBit[i];
117  dbits[i] = glt.gltDecBits[i];
118  tbits[i] = glt.gltTchBits[i];
119  }
120  s << "GT DEdigi"
121  << " decision: " << glbit[0];
122  if (glbit[0] != glbit[1])
123  s << "(data), " << glbit[1] << "(emul)";
124  s << "\n data dec-word: ";
125  for (GltDEDigi::GltBits::const_iterator i = dbits[0].begin(); i != dbits[0].end(); i++)
126  s << *i;
127  s << "\n emul dec-word: ";
128  for (GltDEDigi::GltBits::const_iterator i = dbits[1].begin(); i != dbits[1].end(); i++)
129  s << *i;
130  s << "\n data techical: ";
131  for (GltDEDigi::GltBits::const_iterator i = tbits[0].begin(); i != tbits[0].end(); i++)
132  s << *i;
133  s << "\n emul technical: ";
134  for (GltDEDigi::GltBits::const_iterator i = tbits[1].begin(); i != tbits[1].end(); i++)
135  s << *i;
136  return s;
137 }
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
L1DataEmulDigi::m_rank
float m_rank[2]
Definition: L1DataEmulDigi.h:82
L1DataEmulDigi::m_null
int m_null
Definition: L1DataEmulDigi.h:83
GltDEDigi::reset
void reset()
Definition: L1DataEmulDigi.cc:88
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
L1DataEmulDigi::type
int type() const
Definition: L1DataEmulDigi.h:61
L1DataEmulDigi::sid
int sid() const
Definition: L1DataEmulDigi.h:56
L1DataEmulDigi::x2
double x2() const
Definition: L1DataEmulDigi.h:59
L1DataEmulDigi::x1
double x1() const
Definition: L1DataEmulDigi.h:58
L1DataEmulDigi::empty
bool empty() const
Definition: L1DataEmulDigi.cc:4
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1DataEmulDigi
Definition: L1DataEmulDigi.h:17
operator<<
std::ostream & operator<<(std::ostream &s, const L1DataEmulDigi &de)
Definition: L1DataEmulDigi.cc:69
GltDEDigi::gltDecBits
GltBits gltDecBits[2]
Definition: L1DataEmulDigi.h:96
L1DataEmulDigi::rank
void rank(float *r) const
Definition: L1DataEmulDigi.h:66
L1DataEmulDigi::m_data
unsigned int m_data[2]
Definition: L1DataEmulDigi.h:81
GltDEDigi::globalDBit
bool globalDBit[2]
Definition: L1DataEmulDigi.h:95
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
L1DataEmulDigi::cid
int cid() const
Definition: L1DataEmulDigi.h:57
GltDEDigi::GltBits
std::vector< bool > GltBits
Definition: L1DataEmulDigi.h:90
glt
double glt
Definition: hdecay.h:102
GltDEDigi::set
void set(bool glbit[], GltBits dbits[], GltBits tbits[])
Definition: L1DataEmulDigi.cc:104
symbols.dm
dm
Definition: symbols.py:75
L1DataEmulDigi::reset
int reset()
Definition: L1DataEmulDigi.cc:13
L1DataEmulDigi::m_type
int m_type
Definition: L1DataEmulDigi.h:80
L1DataEmulDigi::L1DataEmulDigi
L1DataEmulDigi()
Definition: L1DataEmulDigi.cc:28
GltDEDigi
Definition: L1DataEmulDigi.h:89
GltDEDigi::gltTchBits
GltBits gltTchBits[2]
Definition: L1DataEmulDigi.h:96
L1MonitorDigi
Definition: L1MonitorDigi.h:14
heppy_batch.val
val
Definition: heppy_batch.py:351
L1DataEmulDigi::m_sid
int m_sid
Definition: L1DataEmulDigi.h:77
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
L1DataEmulDigi::m_cid
int m_cid
Definition: L1DataEmulDigi.h:78
L1DataEmulDigi::m_DEpair
L1MonitorDigi m_DEpair[2]
Definition: L1DataEmulDigi.h:84
L1DataEmulDigi::~L1DataEmulDigi
~L1DataEmulDigi()
Definition: L1DataEmulDigi.cc:67
spu::def
int def(FILE *, FILE *, int)
Definition: SherpackUtilities.cc:14
L1DataEmulDigi::x3
double x3() const
Definition: L1DataEmulDigi.h:60
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
L1DataEmulDigi::data
void data(unsigned int *d) const
Definition: L1DataEmulDigi.h:62
L1DataEmulDigi.h
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
L1DataEmulDigi::m_location
double m_location[3]
Definition: L1DataEmulDigi.h:79
GltDEDigi::GltDEDigi
GltDEDigi()
Definition: L1DataEmulDigi.cc:86