CMS 3D CMS Logo

L1GctInternJetData.cc
Go to the documentation of this file.
2 
4  capBlock_(0),
5  capIndex_(0),
6  bx_(0),
7  type_(null),
8  data_(0)
9 {
10 
11 }
12 
15  uint16_t capBlock,
16  uint16_t capIndex,
17  int16_t bx,
18  uint8_t sgnEta,
19  uint8_t oflow,
20  uint16_t et,
21  uint8_t eta,
22  uint8_t phi,
23  uint8_t tauVeto,
24  uint8_t rank) :
25  regionId_(rgn),
26  capBlock_(capBlock),
27  capIndex_(capIndex),
28  bx_(bx),
29  type_(null),
30  data_(0)
31 {
32  setData(sgnEta, oflow, et, eta, phi, tauVeto, rank);
33 }
34 
35 // 'named' constructors to avoid confusion
36 
37 // emulator calibrated jet ctor
39  int16_t bx,
40  uint16_t et,
41  bool oflow,
42  bool tauVeto,
43  uint8_t eta,
44  uint8_t phi,
45  uint16_t rank) {
47 
48  d.setType(emulator);
49  d.setRegionId(rgn);
50  d.setData(0, (oflow ? 1 : 0), et, eta, phi, (tauVeto ? 1 : 0), rank);
51  d.setBx(bx);
52 
53  return d;
54 }
55 
58  uint16_t capBlock,
59  uint16_t capIndex,
60  int16_t bx,
61  uint32_t data) {
63 
64  d.setRegionId(rgn);
65  d.setCapBlock(capBlock);
66  d.setCapIndex(capIndex);
67  d.setBx(bx);
69  d.setRawData(data&0x1fffffff);
70 
71  return d;
72 }
73 
76  uint16_t capBlock,
77  uint16_t capIndex,
78  int16_t bx,
79  uint32_t data) {
81 
82  d.setRegionId(rgn);
83  d.setCapBlock(capBlock);
84  d.setCapIndex(capIndex);
85  d.setBx(bx);
87  d.setData( 0, (data>>10)&0x1, data&0x3ff, (data>>12)&0xf, 0, (data>>11)&0x1, 0 );
88 
89  return d;
90 }
91 
94  uint16_t capBlock,
95  uint16_t capIndex,
96  int16_t bx,
97  uint32_t data) {
99 
100  d.setRegionId(rgn);
101  d.setCapBlock(capBlock);
102  d.setCapIndex(capIndex);
103  d.setBx(bx);
105  d.setData( 0, (data>>10)&0x1, 0, (data>>6)&0xf, (data>>12)&0x1, (data>>11)&0x1, data&0x3f );
106 
107  return d;
108 }
109 
112  uint16_t capBlock,
113  uint16_t capIndex,
114  int16_t bx,
115  uint32_t data) {
117 
118  d.setRegionId(rgn);
119  d.setCapBlock(capBlock);
120  d.setCapIndex(capIndex);
121  d.setBx(bx);
123  d.setData( (data>>10)&0x1, 0, 0, (data>>6)&0xf, (data>>11)&0x1f, 0, data&0x3f );
124 
125  return d;
126 }
127 
130 
131 }
132 
133 
136  uint8_t oflow,
137  uint16_t et,
138  uint8_t eta,
139  uint8_t phi,
140  uint8_t tauVeto,
141  uint8_t rank) {
142  data_ = 0;
143  data_ = rank & 0x3f;
144  data_ |= (tauVeto & 0x1) << 6;
145  data_ |= (phi & 0x1f) << 7;
146  data_ |= (eta & 0xf) << 12;
147  data_ |= (et & 0xfff) << 16;
148  data_ |= (oflow & 0x1) << 28;
149  data_ |= (sgnEta & 0x1) << 29;
150 }
151 
152 
154 
157  return (type_ == c.type() && data_ == c.raw() && regionId_ == c.regionId() && bx_ == c.bx());
158 }
159 
161 std::ostream& operator<<(std::ostream& s, const L1GctInternJetData& c) {
162  s << "L1GctInternJetData :";
163  if (c.empty()) {
164  s << " empty!";
165  }
167  s << " type=jet_cluster";
168  s << " oflow=" << c.oflow();
169  s << " et=" << c.et();
170  s << " eta=" << c.eta();
171  s << " phi=" << c.phi();
172  s << " tauVeto=" << c.tauVeto();
173  s << " rank=" << c.rank();
174  } else if (c.type()==L1GctInternJetData::jet_precluster){
175  s << " type=jet_precluster";
176  s << " oflow=" << c.oflow();
177  s << " et=" << c.et();
178  s << " eta=" << c.eta();
179  s << " tauVeto=" << c.tauVeto();
181  s << " type=jet_cluster_minimal";
182  s << " oflow=" << c.oflow();
183  s << " eta=" << c.eta();
184  s << " phi=" << c.phi();
185  s << " tauVeto=" << c.tauVeto();
186  s << " rank=" << c.rank();
187  } else if (c.type()==L1GctInternJetData::gct_trig_object){
188  s << " type=gct_trig_object";
189  s << " eta=" << c.eta();
190  s << " phi=" << c.phi();
191  s << " rank=" << c.rank();
192  }
193  s << " cap block=" << std::hex << c.capBlock();
194  s << " index=" << std::dec << c.capIndex();
195  s << " BX=" << c.bx();
196 
197  return s;
198 }
static L1GctInternJetData fromJetPreCluster(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "jet_precluster"
L1GctInternJetData()
default constructor (for vector initialisation etc.)
void setCapBlock(uint16_t capBlock)
set cap block
uint16_t rank() const
get rank bits
bool operator==(const L1GctInternJetData &c) const
equality operator
void setType(L1GctInternJetType type)
set type
uint16_t tauVeto() const
get tau veto
L1 GCT internal jet candidate.
void setRawData(uint32_t data)
set data
static L1GctInternJetData fromJetClusterMinimal(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "jet_cluster_minimal"
uint16_t capIndex() const
get index within capture block
void setCapIndex(uint16_t capIndex)
set cap index
uint16_t eta() const
get eta
uint16_t oflow() const
get oflow
L1CaloRegionDetId regionId_
bool empty() const
was an object really found?
void setRegionId(L1CaloRegionDetId rgn)
set region
L1GctInternJetType type_
static L1GctInternJetData fromEmulator(L1CaloRegionDetId rgn, int16_t bx, uint16_t et, bool overFlow, bool tauVeto, uint8_t eta, uint8_t phi, uint16_t rank)
virtual ~L1GctInternJetData()
destructor (virtual to prevent compiler warnings)
int16_t bx() const
get BX number
void setBx(uint16_t bx)
set bx
static L1GctInternJetData fromJetCluster(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "jet_cluster"
uint32_t raw() const
get the raw data
uint16_t et() const
get et
static L1GctInternJetData fromGctTrigObject(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "gct_trig_object"
std::ostream & operator<<(std::ostream &s, const L1GctInternJetData &c)
pretty print
uint16_t phi() const
get phi
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
L1CaloRegionDetId regionId() const
region associated with the candidate
uint16_t sgnEta() const
get sign of eta
L1GctInternJetData::L1GctInternJetType type() const
&#39;type&#39; of object
uint16_t capBlock() const
get capture block
void setData(uint8_t sgnEta, uint8_t oflow, uint16_t et, uint8_t eta, uint8_t phi, uint8_t tauVeto, uint8_t rank)
construct data word from components