CMS 3D CMS Logo

Namespaces | Functions
PhysCandPacker.cc File Reference
#include "FWCore/Framework/interface/Event.h"
#include "EventFilter/L1TRawToDigi/plugins/PackerFactory.h"
#include "CaloTokens.h"
#include "PhysCandPacker.h"

Go to the source code of this file.

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::IsoEGammaPackers_maker__LINE__ ("l1t::stage1::IsoEGammaPacker")
 
static const l1t::PackerFactoryT::PMaker< l1t::stage1::NonIsoEGammaPackers_maker__LINE__ ("l1t::stage1::NonIsoEGammaPacker")
 
static const l1t::PackerFactoryT::PMaker< l1t::stage1::CentralJetPackers_maker__LINE__ ("l1t::stage1::CentralJetPacker")
 
static const l1t::PackerFactoryT::PMaker< l1t::stage1::ForwardJetPackers_maker__LINE__ ("l1t::stage1::ForwardJetPacker")
 
static const l1t::PackerFactoryT::PMaker< l1t::stage1::TauPackers_maker__LINE__ ("l1t::stage1::TauPacker")
 
static const l1t::PackerFactoryT::PMaker< l1t::stage1::IsoTauPackers_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(), ALCARECOTkAlBeamHalo_cff::filter, BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), mps_fire::i, svgfig::load(), min(), and gen::n.

Referenced by l1t::stage1::IsoEGammaPacker::pack(), l1t::stage1::NonIsoEGammaPacker::pack(), l1t::stage1::CentralJetPacker::pack(), l1t::stage1::ForwardJetPacker::pack(), l1t::stage1::TauPacker::pack(), and l1t::stage1::IsoTauPacker::pack().

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
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
int getFirstBX() const
def load(fileName)
Definition: svgfig.py:546
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