CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Namespaces | Functions
PhysCandPacker.cc File Reference
#include "FWCore/Framework/interface/Event.h"
#include "EventFilter/L1TRawToDigi/interface/Packer.h"
#include "CaloTokens.h"

Go to the source code of this file.

Classes

class  l1t::stage1::CentralJetPacker
 
class  l1t::stage1::ForwardJetPacker
 
class  l1t::stage1::IsoEGammaPacker
 
class  l1t::stage1::IsoTauPacker
 
class  l1t::stage1::NonIsoEGammaPacker
 
class  l1t::stage1::TauPacker
 

Namespaces

 l1t
 map containing the conditions
 
 l1t::stage1
 

Functions

template<typename T , typename F >
l1t::Blocks process (unsigned int id, const BXVector< T > &coll, F filter)
 
static const
l1t::PackerFactoryT::PMaker
< l1t::stage1::IsoEGammaPacker
s_maker__LINE__ ("l1t::stage1::IsoEGammaPacker")
 
static const
l1t::PackerFactoryT::PMaker
< l1t::stage1::NonIsoEGammaPacker
s_maker__LINE__ ("l1t::stage1::NonIsoEGammaPacker")
 
static const
l1t::PackerFactoryT::PMaker
< l1t::stage1::CentralJetPacker
s_maker__LINE__ ("l1t::stage1::CentralJetPacker")
 
static const
l1t::PackerFactoryT::PMaker
< l1t::stage1::ForwardJetPacker
s_maker__LINE__ ("l1t::stage1::ForwardJetPacker")
 
static const
l1t::PackerFactoryT::PMaker
< l1t::stage1::TauPacker
s_maker__LINE__ ("l1t::stage1::TauPacker")
 
static const
l1t::PackerFactoryT::PMaker
< l1t::stage1::IsoTauPacker
s_maker__LINE__ ("l1t::stage1::IsoTauPacker")
 

Function Documentation

template<typename T , typename F >
l1t::Blocks process ( unsigned int  id,
const BXVector< T > &  coll,
F  filter 
)

Definition at line 9 of file PhysCandPacker.cc.

References funct::abs(), BXVector< T >::begin(), BXVector< T >::end(), alcazmumu_cfi::filter, BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), i, j, svgfig::load(), min(), and gen::n.

10 {
11  std::vector<uint32_t> load;
12 
13  for (int i = coll.getFirstBX(); i <= coll.getLastBX(); ++i) {
14  uint16_t jetbit[4] = {0, 0, 0, 0};
15  int n = 0;
16  for (auto j = coll.begin(i); j != coll.end(i) && n < 4; ++j) {
17  if (!filter(*j))
18  continue;
19  //std::cout << j->hwPt() << " @ " << j->hwEta() << ", " << j->hwPhi() << " > " << j->hwQual() << " > " << j->hwIso() << std::endl;
20  jetbit[n++] = std::min(j->hwPt(), 0x3F) |
21  (abs(j->hwEta()) & 0x7) << 6 |
22  ((j->hwEta() >> 3) & 0x1) << 9 |
23  (j->hwPhi() & 0x1F) << 10;
24  }
25  uint32_t word0=(jetbit[0] & 0xFFFF) | ((jetbit[1] & 0xFFFF) << 16);
26  uint32_t word1=(jetbit[2] & 0xFFFF) | ((jetbit[3] & 0xFFFF) << 16);
27 
28  word0 |= (1 << 31) | (1 << 15);
29  word1 |= ((i == 0) << 31) | ((i == 0) << 15);
30 
31  load.push_back(word0);
32  load.push_back(word1);
33  }
34 
35  return {l1t::Block(id, load)};
36 }
const_iterator end(int bx) const
int i
Definition: DBlmapReader.cc:9
def load
Definition: svgfig.py:546
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
int getFirstBX() const
int getLastBX() const
const_iterator begin(int bx) const
static const l1t::PackerFactoryT ::PMaker< l1t::stage1::IsoEGammaPacker > s_maker__LINE__ ( "l1t::stage1::IsoEGammaPacker"  )
static
static const l1t::PackerFactoryT ::PMaker< l1t::stage1::NonIsoEGammaPacker > s_maker__LINE__ ( "l1t::stage1::NonIsoEGammaPacker"  )
static
static const l1t::PackerFactoryT ::PMaker< l1t::stage1::CentralJetPacker > s_maker__LINE__ ( "l1t::stage1::CentralJetPacker"  )
static
static const l1t::PackerFactoryT ::PMaker< l1t::stage1::ForwardJetPacker > s_maker__LINE__ ( "l1t::stage1::ForwardJetPacker"  )
static
static const l1t::PackerFactoryT ::PMaker< l1t::stage1::TauPacker > s_maker__LINE__ ( "l1t::stage1::TauPacker"  )
static
static const l1t::PackerFactoryT ::PMaker< l1t::stage1::IsoTauPacker > s_maker__LINE__ ( "l1t::stage1::IsoTauPacker"  )
static