CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Namespaces | Functions
LegacyPhysCandUnpacker.cc File Reference
#include "FWCore/Framework/interface/MakerMacros.h"
#include "EventFilter/L1TRawToDigi/interface/Unpacker.h"
#include "CaloCollections.h"

Go to the source code of this file.

Classes

class  l1t::stage1::legacy::CentralJetUnpacker
 
class  l1t::stage1::legacy::ForwardJetUnpacker
 
class  l1t::stage1::legacy::IsoEGammaUnpacker
 
class  l1t::stage1::legacy::IsoTauUnpacker
 
class  l1t::stage1::legacy::NonIsoEGammaUnpacker
 
class  l1t::stage1::legacy::TauUnpacker
 

Namespaces

 l1t
 map containing the conditions
 
 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::IsoEGammaUnpacker
s_maker__LINE__ ("l1t::stage1::legacy::IsoEGammaUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::legacy::NonIsoEGammaUnpacker
s_maker__LINE__ ("l1t::stage1::legacy::NonIsoEGammaUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::legacy::CentralJetUnpacker
s_maker__LINE__ ("l1t::stage1::legacy::CentralJetUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::legacy::ForwardJetUnpacker
s_maker__LINE__ ("l1t::stage1::legacy::ForwardJetUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::legacy::TauUnpacker
s_maker__LINE__ ("l1t::stage1::legacy::TauUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::legacy::IsoTauUnpacker
s_maker__LINE__ ("l1t::stage1::legacy::IsoTauUnpacker")
 

Function Documentation

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

Definition at line 9 of file LegacyPhysCandUnpacker.cc.

References l1t::getBXRange(), l1t::BlockHeader::getID(), l1t::BlockHeader::getSize(), l1t::Block::header(), i, LogDebug, l1t::Block::payload(), BXVector< T >::push_back(), and BXVector< T >::setBXRange().

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.));
14  l1t::getBXRange(nBX, firstBX, lastBX);
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 
36  int candPt=candbit[icand] & 0x3F;
37  int candEta=(candbit[icand]>>6 ) & 0x7;
38  int candEtasign=(candbit[icand]>>9) & 0x1;
39  int candPhi=(candbit[icand]>>10) & 0x1F;
40 
41  T cand;
42  cand.setHwPt(candPt);
43  cand.setHwEta((candEtasign << 3) | candEta);
44  cand.setHwPhi(candPhi);
45  //int qualflag=cand.hwQual();
46  //qualflag|= (candPt == 0x3F);
47  //cand.setHwQual(qualflag);
48 
49  /* std::cout << "cand: eta " << cand.hwEta() << " phi " << cand.hwPhi() << " pT " << cand.hwPt() << " qual " << cand.hwQual() << std::endl; */
50  //std::cout << cand.hwPt() << " @ " << cand.hwEta() << ", " << cand.hwPhi() << " > " << cand.hwQual() << " > " << cand.hwIso() << std::endl;
51  coll->push_back(bx, modify(cand));
52  }
53  }
54 
55  return true;
56 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
unsigned int getID() const
Definition: Block.h:22
void getBXRange(int nbx, int &first, int &last)
Definition: Unpacker.cc:12
BlockHeader header() const
Definition: Block.h:56
std::vector< uint32_t > payload() const
Definition: Block.h:57
void setBXRange(int bxFirst, int bxLast)
unsigned int getSize() const
Definition: Block.h:23
long double T
void push_back(int bx, T object)
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::IsoEGammaUnpacker > s_maker__LINE__ ( "l1t::stage1::legacy::IsoEGammaUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::NonIsoEGammaUnpacker > s_maker__LINE__ ( "l1t::stage1::legacy::NonIsoEGammaUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::CentralJetUnpacker > s_maker__LINE__ ( "l1t::stage1::legacy::CentralJetUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::ForwardJetUnpacker > s_maker__LINE__ ( "l1t::stage1::legacy::ForwardJetUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::TauUnpacker > s_maker__LINE__ ( "l1t::stage1::legacy::TauUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::legacy::IsoTauUnpacker > s_maker__LINE__ ( "l1t::stage1::legacy::IsoTauUnpacker"  )
static