CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MissEtPacker.cc
Go to the documentation of this file.
2 
4 
5 #include "CaloTokens.h"
6 
7 namespace l1t {
8  namespace stage1 {
9  class MissEtPacker : 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 objectMissingEt=0;
32  uint16_t objectMissingEtPhi=0;
33 
34  int flagMissingEt=0;
35 
36  for (auto j = etSums->begin(i); j != etSums->end(i) && n < 4; ++j, ++n) {
37  if (j->getType()==l1t::EtSum::kMissingEt){
38  flagMissingEt=j->hwQual() & 0x1;
39  objectMissingEt=std::min(j->hwPt(), 0xFFF)|(flagMissingEt<<12);
40  objectMissingEtPhi=std::min(j->hwPhi(), 0x7F);
41  }
42  }
43 
44  uint32_t word0= (objectMissingEt & 0xFFFF);
45  uint32_t word1= (objectMissingEtPhi & 0xFFFF);
46 
47  word0 |= (1 << 15);
48  word1 |= ((i == 0) << 15);
49 
50 
51  load.push_back(word0);
52  load.push_back(word1);
53  }
54 
55  return {Block(95, load)};
56  }
57 }
58 }
59 
int i
Definition: DBlmapReader.cc:9
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: MissEtPacker.cc:21
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
void load(int perCUT=90)
Definition: getMaxPt.h:59
#define DEFINE_L1T_PACKER(type)
Definition: Packer.h:36