CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1RCT Class Reference

#include <L1RCT.h>

Public Member Functions

void digiInput (const EcalTrigPrimDigiCollection &ecalCollection, const HcalTrigPrimDigiCollection &hcalCollection)
 
unsigned short ecalCompressedET (int crate, int card, int tower)
 
unsigned short ecalFineGrainBit (int crate, int card, int tower)
 
void fileInput (const char *filename)
 
L1CaloEmCollection getIsolatedEGObjects (unsigned crate)
 
std::vector< unsigned short > getJetRegions (unsigned crate)
 
L1CaloEmCollection getNonisolatedEGObjects (unsigned crate)
 
std::vector< L1CaloRegiongetRegions (unsigned crate)
 
unsigned short hcalCompressedET (int crate, int card, int tower)
 
unsigned short hcalFineGrainBit (int crate, int card, int tower)
 
unsigned short hfCompressedET (int crate, int tower)
 
unsigned short hfFineGrainBit (int crate, int tower)
 
void input ()
 
void input (const std::vector< std::vector< std::vector< unsigned short >>> &barrelIn, const std::vector< std::vector< unsigned short >> &hfIn)
 
 L1RCT (const L1RCTLookupTables *rctLookupTables)
 
void print ()
 
void printCrate (int i)
 
void printEIC (int i, int j)
 
void printEICEdges (int i, int j)
 
void printJSC (int i)
 
void printJSC ()
 
void printRC (int i, int j)
 
void processEvent ()
 
void randomInput ()
 

Private Member Functions

void configureCards ()
 
 L1RCT ()
 
void makeCrates ()
 
void shareNeighbors ()
 

Private Attributes

std::vector< std::vector< std::vector< unsigned short > > > barrel
 
std::vector< L1RCTCratecrates
 
L1RCTRegion empty
 
std::vector< std::vector< unsigned short > > hf
 
L1RCTNeighborMap neighborMap
 
const L1RCTLookupTablesrctLookupTables_
 

Detailed Description

Definition at line 20 of file L1RCT.h.

Constructor & Destructor Documentation

◆ L1RCT() [1/2]

L1RCT::L1RCT ( const L1RCTLookupTables rctLookupTables)

Definition at line 55 of file L1RCT.cc.

References makeCrates().

56  : rctLookupTables_(rctLookupTables),
57  empty(),
58  neighborMap(),
59  barrel(18, std::vector<std::vector<unsigned short>>(7, std::vector<unsigned short>(64))),
60  hf(18, std::vector<unsigned short>(8)) {
61  makeCrates();
62 }
std::vector< std::vector< unsigned short > > hf
Definition: L1RCT.h:111
void makeCrates()
Definition: L1RCT.cc:48
L1RCTNeighborMap neighborMap
Definition: L1RCT.h:93
L1RCTRegion empty
Definition: L1RCT.h:86
const L1RCTLookupTables * rctLookupTables_
Definition: L1RCT.h:77
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:110

◆ L1RCT() [2/2]

L1RCT::L1RCT ( )
private

Member Function Documentation

◆ configureCards()

void L1RCT::configureCards ( )
private

◆ digiInput()

void L1RCT::digiInput ( const EcalTrigPrimDigiCollection ecalCollection,
const HcalTrigPrimDigiCollection hcalCollection 
)

Definition at line 109 of file L1RCT.cc.

References funct::abs(), barrel, L1RCTParameters::calcCard(), L1RCTParameters::calcCrate(), L1RCTParameters::calcTower(), DMR_cfg::cerr, gather_cfg::cout, FCDTask_cfi::crate, hcalRecHitTable_cff::energy, hf, mps_fire::i, hcalRecHitTable_cff::ieta, input(), hcalRecHitTable_cff::iphi, dqmiolumiharvest::j, dqmdumpme::k, rctLookupTables_, L1RCTLookupTables::rctParameters(), edm::SortedCollection< T, SORT >::size(), l1tHGCalTowerProducer_cfi::tower, and BeamSplash_cfg::version.

Referenced by L1RCTSaveInput::analyze(), and L1RCTInputProducer::produce().

110  {
111  // fills input vectors with 0's in case ecal or hcal collection not used
112  for (int i = 0; i < 18; i++) {
113  for (int j = 0; j < 7; j++) {
114  for (int k = 0; k < 64; k++) {
115  barrel.at(i).at(j).at(k) = 0;
116  }
117  }
118  for (int j = 0; j < 8; j++) {
119  hf.at(i).at(j) = 0;
120  }
121  }
122 
123  int nEcalDigi = ecalCollection.size();
124  if (nEcalDigi > 4032) {
125  nEcalDigi = 4032;
126  }
127  for (int i = 0; i < nEcalDigi; i++) {
128  short ieta = (short)ecalCollection[i].id().ieta();
129  // Note absIeta counts from 1-28 (not 0-27)
130  unsigned short absIeta = (unsigned short)abs(ieta);
131  unsigned short cal_iphi = (unsigned short)ecalCollection[i].id().iphi();
132  unsigned short iphi = (72 + 18 - cal_iphi) % 72; // transform TOWERS (not regions) into local
133  // rct (intuitive) phi bins
134 
135  // map digis to crates, cards, and towers
136  unsigned short crate = 999, card = 999, tower = 999;
138  card = rctLookupTables_->rctParameters()->calcCard(iphi, absIeta);
140 
141  unsigned short energy = ecalCollection[i].compressedEt();
142  unsigned short fineGrain = (unsigned short)ecalCollection[i].fineGrain(); // 0 or 1
143  unsigned short ecalInput = energy * 2 + fineGrain;
144 
145  // put input into correct crate/card/tower of barrel
146  if ((crate < 18) && (card < 7) && (tower < 32)) { // changed 64 to 32 Sept. 19 J. Leonard, rm -1 7Nov07
147  barrel.at(crate).at(card).at(tower) = ecalInput; // rm -1
148  } else {
149  std::cerr << "L1RCT: ecal out of range! tower = " << tower << " iphi is " << iphi << " absieta is " << absIeta
150  << std::endl;
151  }
152  }
153 
154  // same for hcal, once we get the hcal digis, just need to add 32 to towers:
155  // just copied and pasted and changed names where necessary
156  int nHcalDigi = hcalCollection.size();
157  // if (nHcalDigi != 4176){ std::cout << "L1RCT: Warning: There are " <<
158  // nHcalDigi << "hcal digis instead of 4176!" << std::endl;}
159  // incl HF 4032 + 144 = 4176
160  for (int i = 0; i < nHcalDigi; i++) {
161  if (hcalCollection[i].id().version() != 0) {
162  continue;
163  }
164  short ieta = (short)hcalCollection[i].id().ieta();
165  unsigned short absIeta = (unsigned short)abs(ieta);
166  unsigned short cal_iphi = (unsigned short)hcalCollection[i].id().iphi();
167  // All Hcal primitives (including HF) are reported
168  // with phi bin numbering in the range 0-72.
169  unsigned short iphi = (72 + 18 - cal_iphi) % 72;
170  // transform Hcal TOWERS (1-72)into local rct (intuitive) phi bins (72 bins)
171  // 0-71 Use local iphi to work out the region and crate (for HB/HE and HF)
172  // HF regions need to have local iphi 0-17
173  if (absIeta >= 29) {
174  iphi = iphi / 4;
175  }
176 
177  // map digis to crates, cards, and towers
178  unsigned short crate = 999, card = 999, tower = 999;
180  if (absIeta < 29) {
181  card = rctLookupTables_->rctParameters()->calcCard(iphi, absIeta);
182  }
184 
185  unsigned short energy = hcalCollection[i].SOI_compressedEt(); // access only sample of interest
186  unsigned short fineGrain = (unsigned short)hcalCollection[i].SOI_fineGrain();
187  unsigned short hcalInput = energy * 2 + fineGrain;
188  if (absIeta <= 28) {
189  // put input into correct crate/card/tower of barrel
190  if ((crate < 18) && (card < 7) && (tower < 32)) { // changed 64 to 32 Sept. 19 J. Leonard, rm -1 7Nov07
191  barrel.at(crate).at(card).at(tower + 32) = hcalInput; // hcal towers are ecal + 32 see RC.cc; rm -1 7Nov07
192  } else {
193  std::cout << "L1RCT: hcal out of range! tower = " << tower << std::endl;
194  }
195  } else if ((absIeta >= 29) && (absIeta <= 32)) {
196  // put input into correct crate/region of HF
197  if ((crate < 18) && (tower < 8)) {
198  hf.at(crate).at(tower) = hcalInput;
199  } else {
200  std::cout << "L1RCT: hf out of range! region = " << tower << std::endl;
201  }
202  }
203  }
204 
205  input();
206 
207  return;
208 }
std::vector< std::vector< unsigned short > > hf
Definition: L1RCT.h:111
unsigned short calcTower(unsigned short rct_iphi, unsigned short absIeta) const
unsigned short calcCrate(unsigned short rct_iphi, short ieta) const
size_type size() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const L1RCTParameters * rctParameters() const
void input()
Definition: L1RCT.cc:64
unsigned short calcCard(unsigned short rct_iphi, unsigned short absIeta) const
const L1RCTLookupTables * rctLookupTables_
Definition: L1RCT.h:77
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:110

◆ ecalCompressedET()

unsigned short L1RCT::ecalCompressedET ( int  crate,
int  card,
int  tower 
)
inline

Definition at line 63 of file L1RCT.h.

References barrel, FCDTask_cfi::crate, and l1tHGCalTowerProducer_cfi::tower.

Referenced by L1RCTSaveInput::analyze(), and L1RCTInputProducer::produce().

63 { return barrel.at(crate).at(card).at(tower) / 2; }
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:110

◆ ecalFineGrainBit()

unsigned short L1RCT::ecalFineGrainBit ( int  crate,
int  card,
int  tower 
)
inline

Definition at line 64 of file L1RCT.h.

References barrel, FCDTask_cfi::crate, and l1tHGCalTowerProducer_cfi::tower.

Referenced by L1RCTSaveInput::analyze(), and L1RCTInputProducer::produce().

64 { return barrel.at(crate).at(card).at(tower) & 1; }
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:110

◆ fileInput()

void L1RCT::fileInput ( const char *  filename)

Definition at line 81 of file L1RCT.cc.

References barrel, triggerObjects_cff::bit, hcalRecHitTable_cff::energy, corrVsCorr::filename, hf, mps_fire::i, input(), dqmiolumiharvest::j, dqmdumpme::k, and x.

81  { // added "const" also in .h
82  unsigned short x;
83  std::ifstream instream(filename);
84  if (instream) {
85  for (int i = 0; i < 18; i++) {
86  for (int j = 0; j < 7; j++) {
87  for (int k = 0; k < 64; k++) {
88  if (instream >> x) {
89  unsigned short bit = x / 256; // added J.Leonard Aug. 16 06
90  unsigned short energy = x & 255; //
91  unsigned short input = energy * 2 + bit; //
92  barrel.at(i).at(j).at(k) = input;
93  } else
94  break;
95  }
96  }
97  for (int j = 0; j < 8; j++) {
98  if (instream >> x) {
99  hf.at(i).at(j) = x;
100  } else
101  break;
102  }
103  }
104  }
105  input();
106 }
std::vector< std::vector< unsigned short > > hf
Definition: L1RCT.h:111
void input()
Definition: L1RCT.cc:64
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:110

◆ getIsolatedEGObjects()

L1CaloEmCollection L1RCT::getIsolatedEGObjects ( unsigned  crate)

Definition at line 327 of file L1RCT.cc.

References FCDTask_cfi::crate, crates, L1RCTLookupTables::emRank(), hcalRecHitTable_cff::energy, mps_fire::i, and rctLookupTables_.

327  {
328  std::vector<unsigned short> isoEmObjects = crates.at(crate).getIsolatedEGObjects();
329  L1CaloEmCollection isoEmCands;
330  for (uint16_t i = 0; i < 4; i++) {
331  unsigned rgn = ((isoEmObjects.at(i)) & 1);
332  unsigned crd = (((isoEmObjects.at(i)) / 2) & 7);
333  unsigned energy = ((isoEmObjects.at(i)) / 16);
334  unsigned rank = rctLookupTables_->emRank(energy);
335  L1CaloEmCand isoCand(rank, rgn, crd, crate, true, i,
336  0); // includes emcand index
337  isoEmCands.push_back(isoCand);
338  }
339  return isoEmCands;
340 }
std::vector< L1CaloEmCand > L1CaloEmCollection
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:17
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101
unsigned int emRank(unsigned short energy) const
const L1RCTLookupTables * rctLookupTables_
Definition: L1RCT.h:77

◆ getJetRegions()

std::vector<unsigned short> L1RCT::getJetRegions ( unsigned  crate)
inline

Definition at line 59 of file L1RCT.h.

References FCDTask_cfi::crate, and crates.

59 { return crates.at(crate).getJetRegions(); }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101

◆ getNonisolatedEGObjects()

L1CaloEmCollection L1RCT::getNonisolatedEGObjects ( unsigned  crate)

Definition at line 344 of file L1RCT.cc.

References FCDTask_cfi::crate, crates, L1RCTLookupTables::emRank(), hcalRecHitTable_cff::energy, mps_fire::i, and rctLookupTables_.

344  {
345  std::vector<unsigned short> nonIsoEmObjects = crates.at(crate).getNonisolatedEGObjects();
346  L1CaloEmCollection nonIsoEmCands;
347  for (uint16_t i = 0; i < 4; i++) {
348  unsigned rgn = ((nonIsoEmObjects.at(i)) & 1);
349  unsigned crd = (((nonIsoEmObjects.at(i)) / 2) & 7);
350  unsigned energy = ((nonIsoEmObjects.at(i)) / 16);
351  unsigned rank = rctLookupTables_->emRank(energy);
352  L1CaloEmCand nonIsoCand(rank, rgn, crd, crate, false, i,
353  0); // includes emcand index
354  nonIsoEmCands.push_back(nonIsoCand);
355  }
356  return nonIsoEmCands;
357 }
std::vector< L1CaloEmCand > L1CaloEmCollection
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:17
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101
unsigned int emRank(unsigned short energy) const
const L1RCTLookupTables * rctLookupTables_
Definition: L1RCT.h:77

◆ getRegions()

vector< L1CaloRegion > L1RCT::getRegions ( unsigned  crate)

Definition at line 359 of file L1RCT.cc.

References FCDTask_cfi::crate, crates, hcalRecHitTable_cff::energy, nano_mu_digi_cff::region, and Tau3MuMonitor_cff::taus.

359  {
360  // barrel regions
361  std::bitset<14> taus((long)crates.at(crate).getTauBits());
362  std::bitset<14> mips((long)crates.at(crate).getMIPBits());
363  std::bitset<14> quiets((long)crates.at(crate).getQuietBits());
364  std::bitset<14> overflows((long)crates.at(crate).getOverFlowBits());
365  std::vector<unsigned short> barrelEnergies = crates.at(crate).getBarrelRegions();
366  std::vector<L1CaloRegion> regionCollection;
367  for (unsigned card = 0; card < 7; card++) {
368  for (unsigned rgn = 0; rgn < 2; rgn++) {
369  bool tau = taus[card * 2 + rgn];
370  bool mip = mips[card * 2 + rgn];
371  bool quiet = quiets[card * 2 + rgn];
372  bool overflow = overflows[card * 2 + rgn];
373  unsigned barrelEnergy = barrelEnergies.at(card * 2 + rgn);
374  L1CaloRegion region(barrelEnergy, overflow, tau, mip, quiet, crate, card, rgn);
375  regionCollection.push_back(region);
376  }
377  }
378 
379  // hf regions
380  std::vector<unsigned short> hfEnergies = crates.at(crate).getHFRegions();
381  // fine grain bits -- still have to work out digi input
382  std::vector<unsigned short> hfFineGrainBits = crates.at(crate).getHFFineGrainBits();
383  for (unsigned hfRgn = 0; hfRgn < 8; hfRgn++) { // region number, see diagram on paper. make sure know how hf
384  // regions come in.
385  unsigned energy = hfEnergies.at(hfRgn);
386  bool fineGrain = hfFineGrainBits.at(hfRgn);
387  L1CaloRegion hfRegion(energy, fineGrain, crate, hfRgn);
388  regionCollection.push_back(hfRegion);
389  }
390  return regionCollection;
391 }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:21

◆ hcalCompressedET()

unsigned short L1RCT::hcalCompressedET ( int  crate,
int  card,
int  tower 
)
inline

Definition at line 65 of file L1RCT.h.

References barrel, FCDTask_cfi::crate, and l1tHGCalTowerProducer_cfi::tower.

Referenced by L1RCTSaveInput::analyze(), and L1RCTInputProducer::produce().

65  {
66  return barrel.at(crate).at(card).at(tower + 32) / 2;
67  }
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:110

◆ hcalFineGrainBit()

unsigned short L1RCT::hcalFineGrainBit ( int  crate,
int  card,
int  tower 
)
inline

Definition at line 68 of file L1RCT.h.

References barrel, FCDTask_cfi::crate, and l1tHGCalTowerProducer_cfi::tower.

Referenced by L1RCTSaveInput::analyze().

68  {
69  return barrel.at(crate).at(card).at(tower + 32) & 1;
70  }
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:110

◆ hfCompressedET()

unsigned short L1RCT::hfCompressedET ( int  crate,
int  tower 
)
inline

Definition at line 71 of file L1RCT.h.

References FCDTask_cfi::crate, hf, and l1tHGCalTowerProducer_cfi::tower.

Referenced by L1RCTInputProducer::produce().

71 { return hf.at(crate).at(tower) / 2; }
std::vector< std::vector< unsigned short > > hf
Definition: L1RCT.h:111

◆ hfFineGrainBit()

unsigned short L1RCT::hfFineGrainBit ( int  crate,
int  tower 
)
inline

Definition at line 72 of file L1RCT.h.

References FCDTask_cfi::crate, hf, and l1tHGCalTowerProducer_cfi::tower.

72 { return hf.at(crate).at(tower) & 1; }
std::vector< std::vector< unsigned short > > hf
Definition: L1RCT.h:111

◆ input() [1/2]

void L1RCT::input ( )

Definition at line 64 of file L1RCT.cc.

References barrel, crates, hf, and mps_fire::i.

Referenced by digiInput(), fileInput(), and randomInput().

64  {
65  for (int i = 0; i < 18; i++) {
66  crates.at(i).input(barrel.at(i), hf.at(i));
67  }
68 }
std::vector< std::vector< unsigned short > > hf
Definition: L1RCT.h:111
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:110

◆ input() [2/2]

void L1RCT::input ( const std::vector< std::vector< std::vector< unsigned short >>> &  barrelIn,
const std::vector< std::vector< unsigned short >> &  hfIn 
)

Definition at line 70 of file L1RCT.cc.

References crates, and mps_fire::i.

71  {
72  for (int i = 0; i < 18; i++) {
73  crates.at(i).input(barrelIn.at(i), hfIn.at(i));
74  }
75 }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101

◆ makeCrates()

void L1RCT::makeCrates ( )
private

Definition at line 48 of file L1RCT.cc.

References DummyCfis::c, crates, mps_fire::i, and rctLookupTables_.

Referenced by L1RCT().

48  {
49  for (int i = 0; i < 18; i++) {
51  crates.push_back(c);
52  }
53 }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101
const L1RCTLookupTables * rctLookupTables_
Definition: L1RCT.h:77

◆ print()

void L1RCT::print ( void  )

Definition at line 318 of file L1RCT.cc.

References gather_cfg::cout, crates, and mps_fire::i.

318  {
319  for (int i = 0; i < 18; i++) {
320  std::cout << "Crate " << i << std::endl;
321  crates.at(i).print();
322  }
323 }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101

◆ printCrate()

void L1RCT::printCrate ( int  i)
inline

Definition at line 43 of file L1RCT.h.

References crates, and mps_fire::i.

43 { crates.at(i).print(); }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101

◆ printEIC()

void L1RCT::printEIC ( int  i,
int  j 
)
inline

Definition at line 52 of file L1RCT.h.

References crates, mps_fire::i, and dqmiolumiharvest::j.

52 { crates.at(i).printEIC(j); }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101

◆ printEICEdges()

void L1RCT::printEICEdges ( int  i,
int  j 
)
inline

Definition at line 53 of file L1RCT.h.

References crates, mps_fire::i, and dqmiolumiharvest::j.

53 { crates.at(i).printEICEdges(j); }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101

◆ printJSC() [1/2]

void L1RCT::printJSC ( int  i)
inline

Definition at line 44 of file L1RCT.h.

References crates, and mps_fire::i.

44 { crates.at(i).printJSC(); }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101

◆ printJSC() [2/2]

void L1RCT::printJSC ( )
inline

Definition at line 45 of file L1RCT.h.

References gather_cfg::cout, crates, and mps_fire::i.

45  {
46  for (int i = 0; i < 18; i++) {
47  std::cout << "JSC for Crate " << i << std::endl;
48  crates.at(i).printJSC();
49  }
50  }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101

◆ printRC()

void L1RCT::printRC ( int  i,
int  j 
)
inline

Definition at line 51 of file L1RCT.h.

References crates, mps_fire::i, and dqmiolumiharvest::j.

51 { crates.at(i).printRC(j); }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101

◆ processEvent()

void L1RCT::processEvent ( )

Definition at line 36 of file L1RCT.cc.

References crates, mps_fire::i, and shareNeighbors().

36  {
37  for (int i = 0; i < 18; i++)
38  crates.at(i).processReceiverCards();
40  for (int i = 0; i < 18; i++) {
41  crates.at(i).fillElectronIsolationCards();
42  crates.at(i).processElectronIsolationCards();
43  crates.at(i).fillJetSummaryCard();
44  crates.at(i).processJetSummaryCard();
45  }
46 }
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101
void shareNeighbors()
Definition: L1RCT.cc:233

◆ randomInput()

void L1RCT::randomInput ( )

Definition at line 212 of file L1RCT.cc.

References barrel, hf, mps_fire::i, input(), dqmiolumiharvest::j, and dqmdumpme::k.

212  {
213  for (int i = 0; i < 18; i++) {
214  for (int j = 0; j < 7; j++) {
215  for (int k = 0; k < 64; k++) {
216  barrel.at(i).at(j).at(k) = rand() % 511;
217  }
218  }
219  for (int j = 0; j < 8; j++) {
220  hf.at(i).at(j) = rand() % 255; // changed from 1023 (10 bits)
221  }
222  }
223  input();
224  return;
225 }
std::vector< std::vector< unsigned short > > hf
Definition: L1RCT.h:111
void input()
Definition: L1RCT.cc:64
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:110

◆ shareNeighbors()

void L1RCT::shareNeighbors ( )
private

Definition at line 233 of file L1RCT.cc.

References crates, L1RCTNeighborMap::east(), east, empty, gctobj::getRegion(), L1RCTRegion::giveNWEt(), L1RCTRegion::giveNWHE_FG(), L1RCTRegion::giveSEEt(), L1RCTRegion::giveSEHE_FG(), L1RCTRegion::giveSWEt(), L1RCTRegion::giveSWHE_FG(), mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, L1RCTNeighborMap::ne(), compareTotals::ne, neighborMap, L1RCTNeighborMap::north(), north, L1RCTNeighborMap::nw(), L1RCTNeighborMap::se(), L1RCTRegion::setEastEt(), L1RCTRegion::setEastHE_FG(), L1RCTRegion::setNEEt(), L1RCTRegion::setNEHE_FG(), L1RCTRegion::setNorthEt(), L1RCTRegion::setNorthHE_FG(), L1RCTRegion::setNWEt(), L1RCTRegion::setNWHE_FG(), L1RCTRegion::setSEEt(), L1RCTRegion::setSEHE_FG(), L1RCTRegion::setSouthEt(), L1RCTRegion::setSouthHE_FG(), L1RCTRegion::setSWEt(), L1RCTRegion::setSWHE_FG(), L1RCTRegion::setWestEt(), L1RCTRegion::setWestHE_FG(), L1RCTNeighborMap::south(), south, L1RCTNeighborMap::sw(), L1RCTNeighborMap::west(), and west.

Referenced by processEvent().

233  {
236  L1RCTRegion *west;
237  L1RCTRegion *east;
238  L1RCTRegion *se;
239  L1RCTRegion *sw;
240  L1RCTRegion *nw;
241  L1RCTRegion *ne;
242  L1RCTRegion *primary;
243 
244  for (int i = 0; i < 18; i++) {
245  for (int j = 0; j < 7; j++) {
246  for (int k = 0; k < 2; k++) {
247  primary = crates.at(i).getReceiverCard(j)->getRegion(k);
248 
249  vector<int> northIndices = neighborMap.north(i, j, k);
250  if (northIndices.at(0) != -1)
251  north = crates.at(northIndices.at(0)).getReceiverCard(northIndices.at(1))->getRegion(northIndices.at(2));
252  else
253  north = &empty;
254 
255  vector<int> southIndices = neighborMap.south(i, j, k);
256  if (southIndices.at(0) != -1)
257  south = crates.at(southIndices.at(0)).getReceiverCard(southIndices.at(1))->getRegion(southIndices.at(2));
258  else
259  south = &empty;
260 
261  vector<int> westIndices = neighborMap.west(i, j, k);
262  if (westIndices.at(0) != -1)
263  west = crates.at(westIndices.at(0)).getReceiverCard(westIndices.at(1))->getRegion(westIndices.at(2));
264  else
265  west = &empty;
266 
267  vector<int> eastIndices = neighborMap.east(i, j, k);
268  if (eastIndices.at(0) != -1)
269  east = crates.at(eastIndices.at(0)).getReceiverCard(eastIndices.at(1))->getRegion(eastIndices.at(2));
270  else
271  east = &empty;
272 
273  vector<int> seIndices = neighborMap.se(i, j, k);
274  if (seIndices.at(0) != -1)
275  se = crates.at(seIndices.at(0)).getReceiverCard(seIndices.at(1))->getRegion(seIndices.at(2));
276  else
277  se = &empty;
278 
279  vector<int> swIndices = neighborMap.sw(i, j, k);
280  if (swIndices.at(0) != -1)
281  sw = crates.at(swIndices.at(0)).getReceiverCard(swIndices.at(1))->getRegion(swIndices.at(2));
282  else
283  sw = &empty;
284 
285  vector<int> neIndices = neighborMap.ne(i, j, k);
286  if (neIndices.at(0) != -1)
287  ne = crates.at(neIndices.at(0)).getReceiverCard(neIndices.at(1))->getRegion(neIndices.at(2));
288  else
289  ne = &empty;
290 
291  vector<int> nwIndices = neighborMap.nw(i, j, k);
292  if (nwIndices.at(0) != -1)
293  nw = crates.at(nwIndices.at(0)).getReceiverCard(nwIndices.at(1))->getRegion(nwIndices.at(2));
294  else
295  nw = &empty;
296 
297  primary->setNorthEt(north->giveNorthEt());
298  primary->setNorthHE_FG(north->giveNorthHE_FG());
299  primary->setSouthEt(south->giveSouthEt());
300  primary->setSouthHE_FG(south->giveSouthHE_FG());
301  primary->setEastEt(east->giveEastEt());
302  primary->setEastHE_FG(east->giveEastHE_FG());
303  primary->setWestEt(west->giveWestEt());
304  primary->setWestHE_FG(west->giveWestHE_FG());
305  primary->setSEEt(se->giveSEEt());
306  primary->setSEHE_FG(se->giveSEHE_FG());
307  primary->setSWEt(sw->giveSWEt());
308  primary->setSWHE_FG(sw->giveSWHE_FG());
309  primary->setNWEt(nw->giveNWEt());
310  primary->setNWHE_FG(nw->giveNWHE_FG());
311  primary->setNEEt(ne->giveNEEt());
312  primary->setNEHE_FG(ne->giveNEHE_FG());
313  }
314  }
315  }
316 }
void setNEEt(unsigned short ne)
Definition: L1RCTRegion.cc:168
void setSWHE_FG(unsigned short sw)
Definition: L1RCTRegion.cc:191
std::vector< int > west(int crate, int card, int region)
void setNEHE_FG(unsigned short ne)
Definition: L1RCTRegion.cc:169
std::vector< int > north(int crate, int card, int region)
void setNorthHE_FG(const std::vector< unsigned short > &north)
Definition: L1RCTRegion.cc:89
std::vector< int > sw(int crate, int card, int region)
unsigned short giveSEHE_FG() const
Definition: L1RCTRegion.cc:200
std::vector< int > south(int crate, int card, int region)
void setNWHE_FG(unsigned short nw)
Definition: L1RCTRegion.cc:180
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:101
unsigned short giveSWEt() const
Definition: L1RCTRegion.cc:182
void setWestHE_FG(const std::vector< unsigned short > &west)
Definition: L1RCTRegion.cc:133
void setSEEt(unsigned short se)
Definition: L1RCTRegion.cc:201
unsigned short giveNWHE_FG() const
Definition: L1RCTRegion.cc:178
unsigned short giveSWHE_FG() const
Definition: L1RCTRegion.cc:189
void setSWEt(unsigned short sw)
Definition: L1RCTRegion.cc:190
std::vector< int > nw(int crate, int card, int region)
void setSouthHE_FG(const std::vector< unsigned short > &south)
Definition: L1RCTRegion.cc:111
void setNorthEt(const std::vector< unsigned short > &north)
Definition: L1RCTRegion.cc:79
std::vector< int > ne(int crate, int card, int region)
void setSEHE_FG(unsigned short se)
Definition: L1RCTRegion.cc:202
L1RCTNeighborMap neighborMap
Definition: L1RCT.h:93
void setWestEt(const std::vector< unsigned short > &west)
Definition: L1RCTRegion.cc:122
void setEastHE_FG(const std::vector< unsigned short > &east)
Definition: L1RCTRegion.cc:155
void setEastEt(const std::vector< unsigned short > &east)
Definition: L1RCTRegion.cc:144
void setNWEt(unsigned short nw)
Definition: L1RCTRegion.cc:179
std::vector< int > east(int crate, int card, int region)
L1RCTRegion empty
Definition: L1RCT.h:86
unsigned short giveNWEt() const
Definition: L1RCTRegion.cc:171
unsigned short giveSEEt() const
Definition: L1RCTRegion.cc:193
void setSouthEt(const std::vector< unsigned short > &south)
Definition: L1RCTRegion.cc:100
std::vector< int > se(int crate, int card, int region)
jetInfo getRegion(GCTsupertower_t temp[nSTEta][nSTPhi], float TTseedThreshold)

Member Data Documentation

◆ barrel

std::vector<std::vector<std::vector<unsigned short> > > L1RCT::barrel
private

◆ crates

std::vector<L1RCTCrate> L1RCT::crates
private

◆ empty

L1RCTRegion L1RCT::empty
private

◆ hf

std::vector<std::vector<unsigned short> > L1RCT::hf
private

Definition at line 111 of file L1RCT.h.

Referenced by digiInput(), fileInput(), hfCompressedET(), hfFineGrainBit(), input(), and randomInput().

◆ neighborMap

L1RCTNeighborMap L1RCT::neighborMap
private

Definition at line 93 of file L1RCT.h.

Referenced by shareNeighbors().

◆ rctLookupTables_

const L1RCTLookupTables* L1RCT::rctLookupTables_
private

Definition at line 77 of file L1RCT.h.

Referenced by digiInput(), getIsolatedEGObjects(), getNonisolatedEGObjects(), and makeCrates().