CMS 3D CMS Logo

Namespaces | Functions
PhysCandUnpacker.cc File Reference
#include "FWCore/Framework/interface/MakerMacros.h"
#include "EventFilter/L1TRawToDigi/plugins/UnpackerFactory.h"
#include "CaloCollections.h"
#include "PhysCandUnpacker.h"

Go to the source code of this file.

Namespaces

 l1t
 delete x;
 
 l1t::stage1
 

Functions

template<typename T , typename F >
bool process (const l1t::Block &block, BXVector< T > *coll, F modify, bool isleft, bool isfirst, bool istau)
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoEGammaUnpackerLefts_maker__LINE__ ("l1t::stage1::IsoEGammaUnpackerLeft")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::NonIsoEGammaUnpackerLefts_maker__LINE__ ("l1t::stage1::NonIsoEGammaUnpackerLeft")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::CentralJetUnpackerLefts_maker__LINE__ ("l1t::stage1::CentralJetUnpackerLeft")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::ForwardJetUnpackerLefts_maker__LINE__ ("l1t::stage1::ForwardJetUnpackerLeft")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::TauUnpackerLefts_maker__LINE__ ("l1t::stage1::TauUnpackerLeft")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoTauUnpackerLefts_maker__LINE__ ("l1t::stage1::IsoTauUnpackerLeft")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoEGammaUnpackerRights_maker__LINE__ ("l1t::stage1::IsoEGammaUnpackerRight")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::NonIsoEGammaUnpackerRights_maker__LINE__ ("l1t::stage1::NonIsoEGammaUnpackerRight")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::CentralJetUnpackerRights_maker__LINE__ ("l1t::stage1::CentralJetUnpackerRight")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::ForwardJetUnpackerRights_maker__LINE__ ("l1t::stage1::ForwardJetUnpackerRight")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::TauUnpackerRights_maker__LINE__ ("l1t::stage1::TauUnpackerRight")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoTauUnpackerRights_maker__LINE__ ("l1t::stage1::IsoTauUnpackerRight")
 

Function Documentation

◆ process()

template<typename T , typename F >
bool process ( const l1t::Block block,
BXVector< T > *  coll,
F  modify,
bool  isleft,
bool  isfirst,
bool  istau 
)

Definition at line 8 of file PhysCandUnpacker.cc.

References groupFilesInBlocks::block, simKBmtfDigis_cfi::bx, reco::ceil(), RPCBxOrConfig_cff::firstBX, l1t::getBXRange(), mps_fire::i, createfilelist::int, RPCBxOrConfig_cff::lastBX, LogDebug, BXVector< T >::resize(), BXVector< T >::set(), BXVector< T >::setBXRange(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by l1t::stage1::IsoEGammaUnpackerLeft::unpack(), l1t::stage1::NonIsoEGammaUnpackerLeft::unpack(), l1t::stage1::CentralJetUnpackerLeft::unpack(), l1t::stage1::ForwardJetUnpackerLeft::unpack(), l1t::stage1::TauUnpackerLeft::unpack(), l1t::stage1::IsoTauUnpackerLeft::unpack(), l1t::stage1::IsoEGammaUnpackerRight::unpack(), l1t::stage1::NonIsoEGammaUnpackerRight::unpack(), l1t::stage1::CentralJetUnpackerRight::unpack(), l1t::stage1::ForwardJetUnpackerRight::unpack(), l1t::stage1::TauUnpackerRight::unpack(), and l1t::stage1::IsoTauUnpackerRight::unpack().

8  {
9  LogDebug("L1T") << "Block ID = " << block.header().getID() << " size = " << block.header().getSize();
10 
11  int nBX, firstBX, lastBX;
12  nBX = int(ceil(block.header().getSize() / 2.));
14 
15  coll->setBXRange(firstBX, lastBX);
16 
17  LogDebug("L1T") << "nBX = " << nBX << " first BX = " << firstBX << " lastBX = " << lastBX;
18 
19  // Initialise index
20  int unsigned i = 0;
21 
22  // Loop over multiple BX and then number of jets filling jet collection
23  for (int bx = firstBX; bx <= lastBX; bx++) {
24  if (!istau)
25  coll->resize(bx, 8);
26  else
27  coll->resize(bx, 4);
28 
29  uint32_t raw_data0 = block.payload()[i++];
30  uint32_t raw_data1 = block.payload()[i++];
31 
32  uint16_t candbit[2];
33  candbit[0] = raw_data0 & 0xFFFF;
34  candbit[1] = raw_data1 & 0xFFFF;
35 
36  for (int icand = 0; icand < 2; icand++) {
37  int candPt = candbit[icand] & 0x3F;
38  int candEta = (candbit[icand] >> 6) & 0x7;
39  int candEtasign = (candbit[icand] >> 9) & 0x1;
40  int candPhi = (candbit[icand] >> 10) & 0x1F;
41 
42  T cand;
43  cand.setHwPt(candPt);
44  cand.setHwEta((candEtasign << 3) | candEta);
45  cand.setHwPhi(candPhi);
46  //int qualflag=cand.hwQual();
47  //qualflag|= (candPt == 0x3F);
48  //cand.setHwQual(qualflag);
49 
50  /* std::cout << "cand: eta " << cand.hwEta() << " phi " << cand.hwPhi() << " pT " << cand.hwPt() << " qual " << cand.hwQual() << std::endl; */
51  //std::cout << cand.hwPt() << " @ " << cand.hwEta() << ", " << cand.hwPhi() << " > " << cand.hwQual() << " > " << cand.hwIso() << std::endl;
52 
53  if (isfirst) {
54  if (isleft) {
55  coll->set(bx, 2 * icand, modify(cand));
56  } else if (!isleft) {
57  coll->set(bx, 2 * icand + 1, modify(cand));
58  }
59  } else if (!isfirst) {
60  if (isleft) {
61  coll->set(bx, 2 * icand + 4, modify(cand));
62  } else if (!isleft) {
63  coll->set(bx, 2 * icand + 5, modify(cand));
64  }
65  }
66  }
67  }
68 
69  return true;
70 }
constexpr int32_t ceil(float num)
void getBXRange(int nbx, int &first, int &last)
void set(int bx, unsigned i, const T &object)
void resize(int bx, unsigned size)
void setBXRange(int bxFirst, int bxLast)
long double T
#define LogDebug(id)

◆ s_maker__LINE__() [1/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoEGammaUnpackerLeft > s_maker__LINE__ ( "l1t::stage1::IsoEGammaUnpackerLeft"  )
static

◆ s_maker__LINE__() [2/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::NonIsoEGammaUnpackerLeft > s_maker__LINE__ ( "l1t::stage1::NonIsoEGammaUnpackerLeft"  )
static

◆ s_maker__LINE__() [3/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::CentralJetUnpackerLeft > s_maker__LINE__ ( "l1t::stage1::CentralJetUnpackerLeft"  )
static

◆ s_maker__LINE__() [4/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::ForwardJetUnpackerLeft > s_maker__LINE__ ( "l1t::stage1::ForwardJetUnpackerLeft"  )
static

◆ s_maker__LINE__() [5/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::TauUnpackerLeft > s_maker__LINE__ ( "l1t::stage1::TauUnpackerLeft"  )
static

◆ s_maker__LINE__() [6/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoTauUnpackerLeft > s_maker__LINE__ ( "l1t::stage1::IsoTauUnpackerLeft"  )
static

◆ s_maker__LINE__() [7/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoEGammaUnpackerRight > s_maker__LINE__ ( "l1t::stage1::IsoEGammaUnpackerRight"  )
static

◆ s_maker__LINE__() [8/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::NonIsoEGammaUnpackerRight > s_maker__LINE__ ( "l1t::stage1::NonIsoEGammaUnpackerRight"  )
static

◆ s_maker__LINE__() [9/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::CentralJetUnpackerRight > s_maker__LINE__ ( "l1t::stage1::CentralJetUnpackerRight"  )
static

◆ s_maker__LINE__() [10/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::ForwardJetUnpackerRight > s_maker__LINE__ ( "l1t::stage1::ForwardJetUnpackerRight"  )
static

◆ s_maker__LINE__() [11/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::TauUnpackerRight > s_maker__LINE__ ( "l1t::stage1::TauUnpackerRight"  )
static

◆ s_maker__LINE__() [12/12]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoTauUnpackerRight > s_maker__LINE__ ( "l1t::stage1::IsoTauUnpackerRight"  )
static