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
 delete x;
 
 l1t::stage1
 

Functions

template<typename T , typename F >
l1t::Blocks process (unsigned int id1, unsigned int id2, 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  id1,
unsigned int  id2,
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[2];
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);
26  uint32_t word1=(jetbit[1] & 0xFFFF);
27  uint32_t word2=(jetbit[2] & 0xFFFF);
28  uint32_t word3=(jetbit[3] & 0xFFFF);
29 
30  load[0].push_back(word0);
31  load[0].push_back(word2);
32 
33  load[1].push_back(word1);
34  load[1].push_back(word3);
35 
36  }
37 
38  return {l1t::Block(id1, load[0]),l1t::Block(id2, load[1])};
39 }
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