CMS 3D CMS Logo

Namespaces | Functions
LegacyPhysCandUnpacker.cc File Reference
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "EventFilter/L1TRawToDigi/plugins/UnpackerFactory.h"
#include "CaloCollections.h"
#include "LegacyPhysCandUnpacker.h"

Go to the source code of this file.

Namespaces

 l1t
 delete x;
 
 l1t::stage1
 
 l1t::stage1::legacy
 

Functions

template<typename T , typename F >
bool process (const l1t::Block &block, BXVector< T > *coll, F modify)
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::CentralJetUnpackers_maker__LINE__ ("l1t::stage1::legacy::CentralJetUnpacker")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::ForwardJetUnpackers_maker__LINE__ ("l1t::stage1::legacy::ForwardJetUnpacker")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::IsoEGammaUnpackers_maker__LINE__ ("l1t::stage1::legacy::IsoEGammaUnpacker")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::IsoTauUnpackers_maker__LINE__ ("l1t::stage1::legacy::IsoTauUnpacker")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::NonIsoEGammaUnpackers_maker__LINE__ ("l1t::stage1::legacy::NonIsoEGammaUnpacker")
 
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::TauUnpackers_maker__LINE__ ("l1t::stage1::legacy::TauUnpacker")
 

Function Documentation

◆ process()

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

Definition at line 9 of file LegacyPhysCandUnpacker.cc.

9  {
10  LogDebug("L1T") << "Block ID = " << block.header().getID() << " size = " << block.header().getSize();
11 
12  int nBX, firstBX, lastBX;
13  nBX = int(ceil(block.header().getSize() / 2.));
15 
16  coll->setBXRange(firstBX, lastBX);
17 
18  LogDebug("L1T") << "nBX = " << nBX << " first BX = " << firstBX << " lastBX = " << lastBX;
19 
20  // Initialise index
21  int unsigned i = 0;
22 
23  // Loop over multiple BX and then number of jets filling jet collection
24  for (int bx = firstBX; bx <= lastBX; bx++) {
25  uint32_t raw_data0 = block.payload()[i++];
26  uint32_t raw_data1 = block.payload()[i++];
27 
28  uint16_t candbit[4];
29  candbit[0] = raw_data0 & 0xFFFF;
30  candbit[1] = (raw_data0 >> 16) & 0xFFFF;
31  candbit[2] = raw_data1 & 0xFFFF;
32  candbit[3] = (raw_data1 >> 16) & 0xFFFF;
33 
34  for (int icand = 0; icand < 4; icand++) {
35  int candPt = candbit[icand] & 0x3F;
36  int candEta = (candbit[icand] >> 6) & 0x7;
37  int candEtasign = (candbit[icand] >> 9) & 0x1;
38  int candPhi = (candbit[icand] >> 10) & 0x1F;
39 
40  T cand;
41  cand.setHwPt(candPt);
42  cand.setHwEta((candEtasign << 3) | candEta);
43  cand.setHwPhi(candPhi);
44  //int qualflag=cand.hwQual();
45  //qualflag|= (candPt == 0x3F);
46  //cand.setHwQual(qualflag);
47 
48  /* std::cout << "cand: eta " << cand.hwEta() << " phi " << cand.hwPhi() << " pT " << cand.hwPt() << " qual " << cand.hwQual() << std::endl; */
49  //std::cout << cand.hwPt() << " @ " << cand.hwEta() << ", " << cand.hwPhi() << " > " << cand.hwQual() << " > " << cand.hwIso() << std::endl;
50  coll->push_back(bx, modify(cand));
51  }
52  }
53 
54  return true;
55 }

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

Referenced by l1t::stage1::legacy::IsoEGammaUnpacker::unpack(), l1t::stage1::legacy::NonIsoEGammaUnpacker::unpack(), l1t::stage1::legacy::CentralJetUnpacker::unpack(), l1t::stage1::legacy::ForwardJetUnpacker::unpack(), l1t::stage1::legacy::TauUnpacker::unpack(), and l1t::stage1::legacy::IsoTauUnpacker::unpack().

◆ s_maker__LINE__() [1/6]

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

◆ s_maker__LINE__() [2/6]

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

◆ s_maker__LINE__() [3/6]

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

◆ s_maker__LINE__() [4/6]

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

◆ s_maker__LINE__() [5/6]

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

◆ s_maker__LINE__() [6/6]

static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::TauUnpacker > s_maker__LINE__ ( "l1t::stage1::legacy::TauUnpacker"  )
static
mps_fire.i
i
Definition: mps_fire.py:428
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
RPCBxOrConfig_cff.firstBX
firstBX
Definition: RPCBxOrConfig_cff.py:5
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
reco::ceil
constexpr int32_t ceil(float num)
Definition: constexpr_cmath.h:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
cand
Definition: decayParser.h:32
createfilelist.int
int
Definition: createfilelist.py:10
groupFilesInBlocks.block
block
Definition: groupFilesInBlocks.py:150
T
long double T
Definition: Basic3DVectorLD.h:48
RPCBxOrConfig_cff.lastBX
lastBX
Definition: RPCBxOrConfig_cff.py:4
l1t::getBXRange
void getBXRange(int nbx, int &first, int &last)
Definition: UnpackerFactory.cc:12
BXVector::setBXRange
void setBXRange(int bxFirst, int bxLast)
BXVector::push_back
void push_back(int bx, T object)