CMS 3D CMS Logo

RCTEmRegionPacker.cc
Go to the documentation of this file.
3 
5 
12 
13 #include "PhysicsToBitConverter.h"
14 #include "rctDataBase.h"
15 
16 #include "CaloTokens.h"
17 #include "RCTEmRegionPacker.h"
18 
19 namespace l1t {
20  namespace stage1 {
23  event.getByToken(static_cast<const CaloTokens*>(toks)->getCaloRegionToken(), caloregion);
24 
26  event.getByToken(static_cast<const CaloTokens*>(toks)->getCaloEmCandToken(), caloemcand);
27 
28  std::vector<uint32_t> load[36];
29 
30  for (int i = 0; i <= 0; ++i) {
31  int n = 0;
33  for (auto j = caloregion->begin(); j != caloregion->end(); ++j, ++n) {
34  int et = (int)j->et();
35  int overFlow = (int)j->overFlow();
36  int fineGrain = (int)j->fineGrain();
37  int mip = (int)j->mip();
38  bool tauveto = j->tauVeto();
39  //int quiet=(int)j->quiet();
40 
41  int rctCrate = (int)j->rctCrate();
42  int rctCard = (int)j->rctCard();
43  int rctRegion = (int)j->rctRegionIndex();
44  bool isHf = (bool)j->isHf();
45 
46  if (!isHf) {
47  converter[rctCrate].SetRCEt(et, rctCard, rctRegion);
48  converter[rctCrate].SetRCOf(overFlow, rctCard, rctRegion);
49  converter[rctCrate].SetRCTau(tauveto, rctCard, rctRegion);
50  converter[rctCrate].SetRCHad(mip, rctCard, rctRegion);
51  LogDebug("L1T") << "CRATE" << rctCrate << "region=" << rctRegion << ", card=" << rctCard << ", rgnEt=" << et
52  << ", overflow=" << overFlow << ", tauveto=" << tauveto << ", hadveto=" << mip << std::endl;
53 
54  } else {
55  converter[rctCrate].SetHFEt(et, rctRegion);
56  converter[rctCrate].SetHFFg(fineGrain, rctRegion);
57  LogDebug("L1T") << "CRATE" << rctCrate << "region=" << rctRegion << ", rgnEt=" << et << std::endl;
58  }
59  } //end calo region
60 
61  int m = 0;
62  for (auto j = caloemcand->begin(); j != caloemcand->end(); ++j, ++m) {
63  int rank = (int)j->rank();
64  int index = (int)j->index();
65  int rctCrate = (int)j->rctCrate();
66  bool isolated = (bool)j->isolated();
67  int rctCard = (int)j->rctCard();
68  int rctRegion = (int)j->rctRegion();
69 
70  if (isolated) {
71  converter[rctCrate].SetIEEt(rank, index);
72  converter[rctCrate].SetIEReg(rctRegion, index);
73  converter[rctCrate].SetIECard(rctCard, index);
74  LogDebug("L1T") << "CRATE" << rctCrate << "ISO em rank=" << rank << ", region=" << rctRegion
75  << ", card=" << rctCard << std::endl;
76  } else {
77  converter[rctCrate].SetNEEt(rank, index);
78  converter[rctCrate].SetNEReg(rctRegion, index);
79  converter[rctCrate].SetNECard(rctCard, index);
80  LogDebug("L1T") << "CRATE" << rctCrate << "NON ISO em rank=" << rank << ", region=" << rctRegion
81  << ", card=" << rctCard << std::endl;
82  }
83  } //end of em cand
84 
85  for (int in = 0; in < 18; in++) {
86  converter[in].Extract32bitwords();
87  for (int d = 0; d < 6; d++) {
88  load[2 * in].push_back((uint32_t)converter[in].Get32bitWordLinkEven(d));
89  load[2 * in + 1].push_back((uint32_t)converter[in].Get32bitWordLinkOdd(d));
90  }
91  }
92  } // end of BX
93 
94  rctDataBase database;
95 
96  Blocks res = {};
97 
98  for (int i = 0; i < 36; ++i) {
99  unsigned int mycrateRCT = (int)(i / 2);
100  bool myRCTeven;
101  if (i % 2 == 0)
102  myRCTeven = true;
103  else
104  myRCTeven = false;
105  int linkMP7 = -1;
106  database.GetLinkMP7(mycrateRCT, myRCTeven, linkMP7);
107  res.push_back(Block(2 * linkMP7, load[i], 0));
108  res.push_back(Block(2 * linkMP7, load[i], 1));
109  }
110  return res;
111  }
112  } // namespace stage1
113 } // namespace l1t
l1t::Blocks
std::vector< Block > Blocks
Definition: Block.h:99
CaloTokens.h
L1CaloEmCand.h
electrons_cff.bool
bool
Definition: electrons_cff.py:366
mps_fire.i
i
Definition: mps_fire.py:428
PackerFactory.h
GlobalTrackerMuonAlignment_cfi.isolated
isolated
Definition: GlobalTrackerMuonAlignment_cfi.py:4
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
converter
Definition: CandidateProducer.h:25
rctDataBase.h
edm::Handle
Definition: AssociativeIterator.h:50
l1t::PhysicsToBitConverter
Definition: PhysicsToBitConverter.h:21
CaloRegion.h
PhysicsToBitConverter.h
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
l1t::stage1::RCTEmRegionPacker::pack
Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: RCTEmRegionPacker.cc:21
svgfig.load
def load(fileName)
Definition: svgfig.py:547
L1CaloRegionDetId.h
DEFINE_L1T_PACKER
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:23
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
Event.h
l1t
delete x;
Definition: CaloConfig.h:22
RCTEmRegionPacker.h
recoMuon::in
Definition: RecoMuonEnumerators.h:6
l1t::rctDataBase
Definition: rctDataBase.h:10
createfilelist.int
int
Definition: createfilelist.py:10
L1CaloCollections.h
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
l1t::PackerTokens
Definition: PackerTokens.h:10
res
Definition: Electron.h:6
CaloEmCand.h
l1t::stage1::RCTEmRegionPacker
Definition: RCTEmRegionPacker.h:8
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
ztail.d
d
Definition: ztail.py:151
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
l1t::Block
Definition: Block.h:70
l1t::rctDataBase::GetLinkMP7
void GetLinkMP7(unsigned int RCTcrate, bool RCTeven, int &linkMP7)
Definition: rctDataBase.h:50
L1CaloRegion.h