CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::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 8 of file PhysCandPacker.cc.

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

8  {
9  std::vector<uint32_t> load[2];
10 
11  for (int i = coll.getFirstBX(); i <= coll.getLastBX(); ++i) {
12  uint16_t jetbit[4] = {0, 0, 0, 0};
13  int n = 0;
14  for (auto j = coll.begin(i); j != coll.end(i) && n < 4; ++j) {
15  if (!filter(*j))
16  continue;
17  //std::cout << j->hwPt() << " @ " << j->hwEta() << ", " << j->hwPhi() << " > " << j->hwQual() << " > " << j->hwIso() << std::endl;
18  jetbit[n++] = std::min(j->hwPt(), 0x3F) | (abs(j->hwEta()) & 0x7) << 6 | ((j->hwEta() >> 3) & 0x1) << 9 |
19  (j->hwPhi() & 0x1F) << 10;
20  }
21  uint32_t word0 = (jetbit[0] & 0xFFFF);
22  uint32_t word1 = (jetbit[1] & 0xFFFF);
23  uint32_t word2 = (jetbit[2] & 0xFFFF);
24  uint32_t word3 = (jetbit[3] & 0xFFFF);
25 
26  load[0].push_back(word0);
27  load[0].push_back(word2);
28 
29  load[1].push_back(word1);
30  load[1].push_back(word3);
31  }
32 
33  return {l1t::Block(id1, load[0]), l1t::Block(id2, load[1])};
34 }
const_iterator end(int bx) const
def load
Definition: svgfig.py:547
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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