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.
2 
4 
5 #include "CaloTokens.h"
6 
7 namespace l1t {
8  namespace stage2 {
9  class TauPacker : public Packer {
10  public:
11  virtual Blocks pack(const edm::Event&, const PackerTokens*) override;
12  };
13  }
14 }
15 
16 // Implementation
17 
18 namespace l1t {
19 namespace stage2 {
20  Blocks
22  {
24  event.getByToken(static_cast<const CaloTokens*>(toks)->getTauToken(), taus);
25 
26  std::vector<uint32_t> load;
27 
28  for (int i = taus->getFirstBX(); i <= taus->getLastBX(); ++i) {
29  int n = 0;
30  for (auto j = taus->begin(i); j != taus->end(i) && n < 8; ++j, ++n) {
31  uint32_t word = \
32  std::min(j->hwPt(), 0x1FF) |
33  (abs(j->hwEta()) & 0x7F) << 9 |
34  ((j->hwEta() < 0) & 0x1) << 16 |
35  (j->hwPhi() & 0xFF) << 17 |
36  (j->hwIso() & 0x1) << 25 |
37  (j->hwQual() & 0x7) << 26;
38  load.push_back(word);
39  }
40 
41  // pad for empty taus
42  for (; n < 8; ++n)
43  load.push_back(0);
44  }
45 
46  return {Block(7, load)};
47  }
48 }
49 }
50 
int i
Definition: DBlmapReader.cc:9
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: TauPacker.cc:21
def load
Definition: svgfig.py:546
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: Packer.h:36