CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Namespaces | Functions
PhysCandUnpacker.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::CentralJetUnpacker
 
class  l1t::stage1::ForwardJetUnpacker
 
class  l1t::stage1::IsoEGammaUnpacker
 
class  l1t::stage1::IsoTauUnpacker
 
class  l1t::stage1::NonIsoEGammaUnpacker
 
class  l1t::stage1::TauUnpacker
 

Namespaces

 l1t
 map containing the conditions
 
 l1t::stage1
 

Functions

template<typename T , typename F >
bool process (const l1t::Block &block, BXVector< T > *coll, F modify)
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::IsoEGammaUnpacker
s_maker__LINE__ ("l1t::stage1::IsoEGammaUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::NonIsoEGammaUnpacker
s_maker__LINE__ ("l1t::stage1::NonIsoEGammaUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::CentralJetUnpacker
s_maker__LINE__ ("l1t::stage1::CentralJetUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::ForwardJetUnpacker
s_maker__LINE__ ("l1t::stage1::ForwardJetUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::TauUnpacker
s_maker__LINE__ ("l1t::stage1::TauUnpacker")
 
static const
l1t::UnpackerFactoryT::PMaker
< l1t::stage1::IsoTauUnpacker
s_maker__LINE__ ("l1t::stage1::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 PhysCandUnpacker.cc.

References 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 = int(ceil(block.header().getSize() / 2.));
13 
14  // Find the first and last BXs
15  int firstBX = -(ceil((double)nBX/2.)-1);
16  int lastBX;
17  if (nBX % 2 == 0) {
18  lastBX = ceil((double)nBX/2.)+1;
19  } else {
20  lastBX = ceil((double)nBX/2.);
21  }
22 
23  coll->setBXRange(firstBX, lastBX);
24 
25  LogDebug("L1T") << "nBX = " << nBX << " first BX = " << firstBX << " lastBX = " << lastBX;
26 
27  // Initialise index
28  int unsigned i = 0;
29 
30  // Loop over multiple BX and then number of jets filling jet collection
31  for (int bx=firstBX; bx<lastBX; bx++){
32  uint32_t raw_data0 = block.payload()[i++];
33  uint32_t raw_data1 = block.payload()[i++];
34 
35  uint16_t candbit[4];
36  candbit[0] = raw_data0 & 0xFFFF;
37  candbit[1] = (raw_data0 >> 16) & 0xFFFF;
38  candbit[2] = raw_data1 & 0xFFFF;
39  candbit[3] = (raw_data1 >> 16) & 0xFFFF;
40 
41  for (int icand=0;icand<4;icand++){
42 
43  int candPt=candbit[icand] & 0x3F;
44  int candEta=(candbit[icand]>>6 ) & 0x7;
45  int candEtasign=(candbit[icand]>>9) & 0x1;
46  int candPhi=(candbit[icand]>>10) & 0x1F;
47 
48  T cand;
49  cand.setHwPt(candPt);
50  cand.setHwEta((candEtasign << 3) | candEta);
51  cand.setHwPhi(candPhi);
52  //int qualflag=cand.hwQual();
53  //qualflag|= (candPt == 0x3F);
54  //cand.setHwQual(qualflag);
55 
56  /* std::cout << "cand: eta " << cand.hwEta() << " phi " << cand.hwPhi() << " pT " << cand.hwPt() << " qual " << cand.hwQual() << std::endl; */
57  //std::cout << cand.hwPt() << " @ " << cand.hwEta() << ", " << cand.hwPhi() << " > " << cand.hwQual() << " > " << cand.hwIso() << std::endl;
58  coll->push_back(bx, modify(cand));
59  }
60  }
61 
62  return true;
63 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
unsigned int getID() const
Definition: Block.h:14
BlockHeader header() const
Definition: Block.h:37
std::vector< uint32_t > payload() const
Definition: Block.h:38
void setBXRange(int bxFirst, int bxLast)
unsigned int getSize() const
Definition: Block.h:15
long double T
void push_back(int bx, T object)
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoEGammaUnpacker > s_maker__LINE__ ( "l1t::stage1::IsoEGammaUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::NonIsoEGammaUnpacker > s_maker__LINE__ ( "l1t::stage1::NonIsoEGammaUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::CentralJetUnpacker > s_maker__LINE__ ( "l1t::stage1::CentralJetUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::ForwardJetUnpacker > s_maker__LINE__ ( "l1t::stage1::ForwardJetUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::TauUnpacker > s_maker__LINE__ ( "l1t::stage1::TauUnpacker"  )
static
static const l1t::UnpackerFactoryT ::PMaker< l1t::stage1::IsoTauUnpacker > s_maker__LINE__ ( "l1t::stage1::IsoTauUnpacker"  )
static