CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TauPacker.cc
Go to the documentation of this file.
3 
4 #include "CaloTokens.h"
5 
7 #include "TauPacker.h"
8 
9 namespace l1t {
10 namespace stage2 {
11  Blocks
13  {
15  event.getByToken(static_cast<const CommonTokens*>(toks)->getTauToken(), taus);
16 
17  std::vector<uint32_t> load1, load2;
18 
19  int nBx=0;
20  for (int i = taus->getFirstBX(); i <= taus->getLastBX(); ++i) {
21 
22  for (auto j = taus->begin(i); j != taus->end(i); ++j) {
23 
24  uint32_t packed_eta = abs(j->hwEta()) & 0x7F;
25  if (j->hwEta() < 0){
26  packed_eta = (128 - packed_eta) | 1<<7;
27  }
28 
29  uint32_t word = \
30  std::min(j->hwPt(), 0x1FF) |
31  packed_eta << 9 |
32  (j->hwPhi() & 0xFF) << 17 |
33  (j->hwIso() & 0x3) << 25 |//two bits for tau isolation
34  (j->hwQual() & 0x7) << 27;
35 
36  // Depending on the number, push onto appropriate link
37  if (load1.size() - nBx*l1t::stage2::layer2::demux::nTauPerLink < l1t::stage2::layer2::demux::nTauPerLink) load1.push_back(word);
38  else load2.push_back(word);
39 
40  }
41 
42  // push zeroes if not enough taus must do this for each BX and each link
45 
46  nBx++;
47  }
48 
49 
50 
51  return {Block(b1_, load1), Block(b2_, load2)};
52 
53  }
54 }
55 }
56 
int i
Definition: DBlmapReader.cc:9
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: TauPacker.cc:12
std::vector< Block > Blocks
Definition: Block.h:68
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
T min(T a, T b)
Definition: MathUtil.h:58
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:22