CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EtSumPacker.cc
Go to the documentation of this file.
2 
4 
5 #include "CaloTokens.h"
6 
7 namespace l1t {
8  namespace stage1 {
9  class EtSumPacker : 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 stage1 {
20  Blocks
22  {
24  event.getByToken(static_cast<const CaloTokens*>(toks)->getEtSumToken(), etSums);
25 
26  std::vector<uint32_t> load;
27 
28  for (int i = etSums->getFirstBX(); i <= etSums->getLastBX(); ++i) {
29  int n = 0;
30 
31  uint16_t objectTotalEt=0;
32  uint16_t objectTotalHt=0;
33  int flagTotalEt=0;
34  int flagTotalHt=0;
35 
36  for (auto j = etSums->begin(i); j != etSums->end(i) && n < 4; ++j, ++n) {
37 
38  if (j->getType()==l1t::EtSum::kTotalEt){
39  flagTotalEt=j->hwQual() & 0x1;
40  objectTotalEt=std::min(j->hwPt(), 0xFFF)|(flagTotalEt<<12);
41  }
42 
43  else if (j->getType()==l1t::EtSum::kTotalHt){
44  flagTotalHt=j->hwQual() & 0x1;
45  objectTotalHt=std::min(j->hwPt(), 0xFFF)|(flagTotalHt<<12);
46  }
47  }
48 
49  uint32_t word0=(objectTotalEt & 0xFFFF);
50  uint32_t word1=(objectTotalHt & 0xFFFF);
51 
52  word0 |= (1 << 15);
53  word1 |= ((i == 0) << 15);
54 
55 
56  load.push_back(word0);
57  load.push_back(word1);
58  }
59 
60 
61 
62  return {Block(93, load)};
63  }
64 }
65 }
66 
int i
Definition: DBlmapReader.cc:9
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: EtSumPacker.cc:21
def load
Definition: svgfig.py:546
std::vector< Block > Blocks
Definition: Block.h:68
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