CMS 3D CMS Logo

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

#include <L1RCTJetSummaryCard.h>

Public Member Functions

int crateNumber ()
 
void fillHFRegionSums (const std::vector< unsigned short > &hfRegionSums)
 
void fillIsolatedEGObjects (const std::vector< unsigned short > &isoElectrons)
 
void fillJetRegions ()
 
void fillMIPBits (const std::vector< unsigned short > &mip)
 
void fillNonIsolatedEGObjects (const std::vector< unsigned short > &nonIsoElectrons)
 
void fillOverFlowBits (const std::vector< unsigned short > &overflow)
 
void fillQuietBits ()
 
void fillRegionSums (const std::vector< unsigned short > &regSums)
 
void fillTauBits (const std::vector< unsigned short > &tau)
 
std::vector< unsigned short > getBarrelRegions ()
 
std::vector< unsigned short > getHFFineGrainBits ()
 
std::vector< unsigned short > getHFRegions ()
 
std::vector< unsigned short > getIsolatedEGObjects ()
 
std::vector< unsigned short > getJetRegions ()
 
unsigned short getMIPBits ()
 
std::vector< unsigned short > getNonisolatedEGObjects ()
 
unsigned short getOverFlowBits ()
 
unsigned short getQuietBits ()
 
unsigned short getTauBits ()
 
 L1RCTJetSummaryCard (int crtNo, const L1RCTLookupTables *rctLookupTables)
 
void print ()
 

Private Member Functions

void asicCompare (std::vector< unsigned short > &array)
 
void asicSort (std::vector< unsigned short > &electrons)
 
 L1RCTJetSummaryCard ()
 

Private Attributes

std::vector< unsigned short > barrelRegions
 
int crtNo
 
std::vector< unsigned short > hfFineGrainBits
 
std::vector< unsigned short > HFRegions
 
std::vector< unsigned short > isolatedEGObjects
 
std::vector< unsigned short > jetRegions
 
unsigned short mipBits
 
std::vector< unsigned short > nonisolatedEGObjects
 
unsigned short overFlowBits
 
unsigned short quietBits
 
unsigned quietThresholdBarrel
 
unsigned quietThresholdEndcap
 
const L1RCTLookupTablesrctLookupTables_
 
unsigned short tauBits
 

Detailed Description

Definition at line 8 of file L1RCTJetSummaryCard.h.

Constructor & Destructor Documentation

L1RCTJetSummaryCard::L1RCTJetSummaryCard ( int  crtNo,
const L1RCTLookupTables rctLookupTables 
)

Definition at line 13 of file L1RCTJetSummaryCard.cc.

13  :
14  crtNo(crtNo),
15  rctLookupTables_(rctLookupTables),
18  jetRegions(22),
19  HFRegions(8),
20  barrelRegions(14),
21  mipBits(0),
22  quietBits(0),
23  tauBits(0),
24  overFlowBits(0),
26  //quietThreshold(3)
27 {
28 }
unsigned short overFlowBits
std::vector< unsigned short > nonisolatedEGObjects
std::vector< unsigned short > isolatedEGObjects
std::vector< unsigned short > HFRegions
std::vector< unsigned short > jetRegions
std::vector< unsigned short > barrelRegions
std::vector< unsigned short > hfFineGrainBits
const L1RCTLookupTables * rctLookupTables_
L1RCTJetSummaryCard::L1RCTJetSummaryCard ( )
private

Member Function Documentation

void L1RCTJetSummaryCard::asicCompare ( std::vector< unsigned short > &  array)
private

Definition at line 260 of file L1RCTJetSummaryCard.cc.

References L1RCTLookupTables::emRank(), i, rctLookupTables_, and groupFilesInBlocks::temp.

Referenced by asicSort().

261 {
262  int i;
263  unsigned short temp;
264  for (i = 0; i < 4; i++)
265  {
266 
267  unsigned short rank1 = rctLookupTables_->emRank(array.at(2 * i)>>4);
268  unsigned short rank2 = rctLookupTables_->emRank(array.at(2 * i + 1)>>4);
269 
270  if (rank1 < rank2) // currently bottom 3 bits are rgn,crd
271  {
272  temp = array.at(2 * i);
273  array.at(2 * i) = array.at((2 * i) + 1);
274  array.at((2 * i) + 1) = temp;
275  }
276  }
277 }
int i
Definition: DBlmapReader.cc:9
unsigned int emRank(unsigned short energy) const
const L1RCTLookupTables * rctLookupTables_
void L1RCTJetSummaryCard::asicSort ( std::vector< unsigned short > &  electrons)
private

Definition at line 214 of file L1RCTJetSummaryCard.cc.

References asicCompare(), and groupFilesInBlocks::temp.

Referenced by fillIsolatedEGObjects(), and fillNonIsolatedEGObjects().

215 {
216  unsigned short temp, temp2;
217 
219 
220  // Rotate items prior to next compare
221 
222  temp = electrons.at(7);
223  electrons.at(7) = electrons.at(5);
224  electrons.at(5) = electrons.at(3);
225  electrons.at(3) = electrons.at(1);
226  electrons.at(1) = temp;
227 
228  // Second compare
229 
231 
232  // Second rotate, different order this time
233 
234  temp = electrons.at(7);
235  temp2 = electrons.at(5);
236  electrons.at(7) = electrons.at(3);
237  electrons.at(5) = electrons.at(1);
238  electrons.at(3) = temp;
239  electrons.at(1) = temp2;
240 
241  // Third compare
242 
244 
245  // Third rotate, different again
246 
247  temp = electrons.at(1);
248  electrons.at(1) = electrons.at(3);
249  electrons.at(3) = electrons.at(5);
250  electrons.at(5) = electrons.at(7);
251  electrons.at(7) = temp;
252 
253  // Fourth compare
254 
256 
257 }
void asicCompare(std::vector< unsigned short > &array)
int L1RCTJetSummaryCard::crateNumber ( )
inline

Definition at line 17 of file L1RCTJetSummaryCard.h.

References crtNo.

17 {return crtNo;}
void L1RCTJetSummaryCard::fillHFRegionSums ( const std::vector< unsigned short > &  hfRegionSums)

Definition at line 30 of file L1RCTJetSummaryCard.cc.

References crtNo, hfFineGrainBits, HFRegions, i, L1RCTLookupTables::lookup(), and rctLookupTables_.

Referenced by getHFFineGrainBits(), and L1RCTCrate::input().

30  {
31  //std::cout << "JSC.fillHFRegionSums() entered" << std::endl;
32  for(int i=0;i<8;i++){
33  //std::cout << "filling hf region at " << i << std::endl;
34  HFRegions.at(i) = rctLookupTables_->lookup( (hfRegionSums.at(i)/2), crtNo, 999, i);
35  //std::cout << "hf region " << i << " et filled" << std::endl;
36  hfFineGrainBits.at(i) = (hfRegionSums.at(i)&1);
37  //std::cout << "hf region " << i << " fine grain bit filled" << std::endl;
38  }
39 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned short > HFRegions
std::vector< unsigned short > hfFineGrainBits
const L1RCTLookupTables * rctLookupTables_
unsigned int lookup(unsigned short ecalInput, unsigned short hcalInput, unsigned short fgbit, unsigned short crtNo, unsigned short crdNo, unsigned short twrNo) const
void L1RCTJetSummaryCard::fillIsolatedEGObjects ( const std::vector< unsigned short > &  isoElectrons)

Definition at line 86 of file L1RCTJetSummaryCard.cc.

References asicSort(), i, and isolatedEGObjects.

Referenced by L1RCTCrate::fillJetSummaryCard(), and fillRegionSums().

86  {
87  //sort(isoElectrons.begin(),isoElectrons.end());
88  //reverse(isoElectrons.begin(),isoElectrons.end());
89 
90  std::vector<unsigned short> isoCards03(8);
91  std::vector<unsigned short> isoCards46(8);
92  std::vector<unsigned short> sortIso(8);
93 
94  for (int i = 0; i < 8; i++){
95  isoCards03.at(i) = isoElectrons.at(i);
96  }
97  for (int i = 0; i < 6; i++){
98  isoCards46.at(i) = isoElectrons.at(i+8);
99  }
100  isoCards46.at(6) = 0;
101  isoCards46.at(7) = 0;
102 
103  asicSort(isoCards03);
104  asicSort(isoCards46);
105 
106  sortIso.at(0) = isoCards03.at(0);
107  sortIso.at(2) = isoCards03.at(2);
108  sortIso.at(4) = isoCards03.at(4);
109  sortIso.at(6) = isoCards03.at(6);
110  sortIso.at(1) = isoCards46.at(0);
111  sortIso.at(3) = isoCards46.at(2);
112  sortIso.at(5) = isoCards46.at(4);
113  sortIso.at(7) = isoCards46.at(6);
114 
115  asicSort(sortIso);
116 
117  //for(int i = 0; i<4; i++){
118  //isolatedEGObjects.at(i) = isoElectrons.at(i);
119  //isolatedEGObjects.at(i) = sortIso.at(2*i);
120  //}
121  isolatedEGObjects.at(0) = sortIso.at(4);
122  isolatedEGObjects.at(1) = sortIso.at(6);
123  isolatedEGObjects.at(2) = sortIso.at(0);
124  isolatedEGObjects.at(3) = sortIso.at(2);
125 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned short > isolatedEGObjects
void asicSort(std::vector< unsigned short > &electrons)
void L1RCTJetSummaryCard::fillJetRegions ( )

Definition at line 41 of file L1RCTJetSummaryCard.cc.

References barrelRegions, crtNo, HFRegions, i, and jetRegions.

Referenced by fillRegionSums(), and L1RCTCrate::processJetSummaryCard().

41  {
42  if(crtNo<9){
43  for(int i = 0; i<4;i++){
44  jetRegions.at(i) = HFRegions.at(i);
45  jetRegions.at(i+11) = HFRegions.at(i+4);
46  }
47  jetRegions.at(4) = barrelRegions.at(12);
48  jetRegions.at(5) = barrelRegions.at(9);
49  jetRegions.at(6) = barrelRegions.at(8);
50  jetRegions.at(7) = barrelRegions.at(5);
51  jetRegions.at(8) = barrelRegions.at(4);
52  jetRegions.at(9) = barrelRegions.at(1);
53  jetRegions.at(10) = barrelRegions.at(0);
54 
55  jetRegions.at(15) = barrelRegions.at(13);
56  jetRegions.at(16) = barrelRegions.at(11);
57  jetRegions.at(17) = barrelRegions.at(10);
58  jetRegions.at(18) = barrelRegions.at(7);
59  jetRegions.at(19) = barrelRegions.at(6);
60  jetRegions.at(20) = barrelRegions.at(3);
61  jetRegions.at(21) = barrelRegions.at(2);
62  }
63  if(crtNo>=9){
64  jetRegions.at(0) = barrelRegions.at(0);
65  jetRegions.at(1) = barrelRegions.at(1);
66  jetRegions.at(2) = barrelRegions.at(4);
67  jetRegions.at(3) = barrelRegions.at(5);
68  jetRegions.at(4) = barrelRegions.at(8);
69  jetRegions.at(5) = barrelRegions.at(9);
70  jetRegions.at(6) = barrelRegions.at(12);
71 
72  jetRegions.at(11) = barrelRegions.at(2);
73  jetRegions.at(12) = barrelRegions.at(3);
74  jetRegions.at(13) = barrelRegions.at(6);
75  jetRegions.at(14) = barrelRegions.at(7);
76  jetRegions.at(15) = barrelRegions.at(10);
77  jetRegions.at(16) = barrelRegions.at(11);
78  jetRegions.at(17) = barrelRegions.at(13);
79  for(int i = 0; i<4;i++){
80  jetRegions.at(i+7) = HFRegions.at(i);
81  jetRegions.at(i+18) = HFRegions.at(i+4);
82  }
83  }
84 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned short > HFRegions
std::vector< unsigned short > jetRegions
std::vector< unsigned short > barrelRegions
void L1RCTJetSummaryCard::fillMIPBits ( const std::vector< unsigned short > &  mip)

Definition at line 168 of file L1RCTJetSummaryCard.cc.

References i, and mipBits.

Referenced by L1RCTCrate::fillJetSummaryCard(), and fillRegionSums().

168  {
169  bitset<14> mips;
170  for(int i = 0; i<14; i++)
171  mips[i] = mip.at(i);
172  mipBits = mips.to_ulong();
173 }
int i
Definition: DBlmapReader.cc:9
void L1RCTJetSummaryCard::fillNonIsolatedEGObjects ( const std::vector< unsigned short > &  nonIsoElectrons)

Definition at line 127 of file L1RCTJetSummaryCard.cc.

References asicSort(), i, and nonisolatedEGObjects.

Referenced by L1RCTCrate::fillJetSummaryCard(), and fillRegionSums().

127  {
128  //sort(nonIsoElectrons.begin(),nonIsoElectrons.end());
129  //reverse(nonIsoElectrons.begin(),nonIsoElectrons.end());
130 
131  std::vector<unsigned short> nonIsoCards03(8);
132  std::vector<unsigned short> nonIsoCards46(8);
133  std::vector<unsigned short> sortNonIso(8);
134 
135  for (int i = 0; i < 8; i++){
136  nonIsoCards03.at(i) = nonIsoElectrons.at(i);
137  }
138  for (int i = 0; i < 6; i++){
139  nonIsoCards46.at(i) = nonIsoElectrons.at(i+8);
140  }
141  nonIsoCards46.at(6) = 0;
142  nonIsoCards46.at(7) = 0;
143 
144  asicSort(nonIsoCards03);
145  asicSort(nonIsoCards46);
146 
147  sortNonIso.at(0) = nonIsoCards03.at(0);
148  sortNonIso.at(2) = nonIsoCards03.at(2);
149  sortNonIso.at(4) = nonIsoCards03.at(4);
150  sortNonIso.at(6) = nonIsoCards03.at(6);
151  sortNonIso.at(1) = nonIsoCards46.at(0);
152  sortNonIso.at(3) = nonIsoCards46.at(2);
153  sortNonIso.at(5) = nonIsoCards46.at(4);
154  sortNonIso.at(7) = nonIsoCards46.at(6);
155 
156  asicSort(sortNonIso);
157 
158  //for(int i = 0; i<4; i++){
159  //nonisolatedEGObjects.at(i) = nonIsoElectrons.at(i);
160  //nonisolatedEGObjects.at(i) = sortNonIso.at(2*i);
161  //}
162  nonisolatedEGObjects.at(0) = sortNonIso.at(4);
163  nonisolatedEGObjects.at(1) = sortNonIso.at(6);
164  nonisolatedEGObjects.at(2) = sortNonIso.at(0);
165  nonisolatedEGObjects.at(3) = sortNonIso.at(2);
166 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned short > nonisolatedEGObjects
void asicSort(std::vector< unsigned short > &electrons)
void L1RCTJetSummaryCard::fillOverFlowBits ( const std::vector< unsigned short > &  overflow)

Definition at line 182 of file L1RCTJetSummaryCard.cc.

References i, and overFlowBits.

Referenced by L1RCTCrate::fillJetSummaryCard(), and fillRegionSums().

182  {
183  bitset<14> overflows;
184  for(int i = 0; i<14; i++)
185  overflows[i] = overflow.at(i);
186  overFlowBits = overflows.to_ulong();
187 }
unsigned short overFlowBits
int i
Definition: DBlmapReader.cc:9
void L1RCTJetSummaryCard::fillQuietBits ( )

Definition at line 189 of file L1RCTJetSummaryCard.cc.

References barrelRegions, i, L1RCTParameters::jscQuietThresholdBarrel(), L1RCTParameters::jscQuietThresholdEndcap(), quietBits, quietThresholdBarrel, quietThresholdEndcap, rctLookupTables_, and L1RCTLookupTables::rctParameters().

Referenced by fillRegionSums(), and L1RCTCrate::processJetSummaryCard().

189  {
190  bitset<14> quiet;
191 
194 
195  // use one threshold for barrel regions (first 8 in list, cards 0-3)
196  for(int i = 0; i<8; i++){
198  quiet[i] = 0; //switched 0 and 1
199  else
200  quiet[i] = 1;
201  }
202  // use second for endcap regions (last 6 in list, cards 4-6)
203  for(int i = 8; i<14; i++){
205  quiet[i] = 0; //switched 0 and 1
206  else
207  quiet[i] = 1;
208  }
209 
210  quietBits = quiet.to_ulong();
211 }
int i
Definition: DBlmapReader.cc:9
unsigned jscQuietThresholdEndcap() const
std::vector< unsigned short > barrelRegions
const L1RCTParameters * rctParameters() const
const L1RCTLookupTables * rctLookupTables_
unsigned jscQuietThresholdBarrel() const
void L1RCTJetSummaryCard::fillRegionSums ( const std::vector< unsigned short > &  regSums)
inline
void L1RCTJetSummaryCard::fillTauBits ( const std::vector< unsigned short > &  tau)

Definition at line 175 of file L1RCTJetSummaryCard.cc.

References i, tauBits, and jetCleaner_cfi::taus.

Referenced by L1RCTCrate::fillJetSummaryCard(), and fillRegionSums().

175  {
176  bitset<14> taus;
177  for(int i = 0; i<14; i++)
178  taus[i] = tau.at(i);
179  tauBits = taus.to_ulong();
180 }
int i
Definition: DBlmapReader.cc:9
std::vector<unsigned short> L1RCTJetSummaryCard::getBarrelRegions ( )
inline

Definition at line 54 of file L1RCTJetSummaryCard.h.

References barrelRegions.

Referenced by L1RCTCrate::getBarrelRegions().

54 {return barrelRegions;}
std::vector< unsigned short > barrelRegions
std::vector<unsigned short> L1RCTJetSummaryCard::getHFFineGrainBits ( )
inline

Definition at line 72 of file L1RCTJetSummaryCard.h.

References fillHFRegionSums(), and hfFineGrainBits.

Referenced by L1RCTCrate::getHFFineGrainBits().

72 {return hfFineGrainBits;}
std::vector< unsigned short > hfFineGrainBits
std::vector<unsigned short> L1RCTJetSummaryCard::getHFRegions ( )
inline

Definition at line 55 of file L1RCTJetSummaryCard.h.

References HFRegions.

Referenced by L1RCTCrate::getHFRegions().

55 {return HFRegions;}
std::vector< unsigned short > HFRegions
std::vector<unsigned short> L1RCTJetSummaryCard::getIsolatedEGObjects ( )
inline

Definition at line 27 of file L1RCTJetSummaryCard.h.

References isolatedEGObjects.

Referenced by L1RCTCrate::getIsolatedEGObjects().

27 {return isolatedEGObjects;}
std::vector< unsigned short > isolatedEGObjects
std::vector<unsigned short> L1RCTJetSummaryCard::getJetRegions ( )
inline

Definition at line 53 of file L1RCTJetSummaryCard.h.

References jetRegions.

Referenced by L1RCTCrate::getJetRegions().

53 {return jetRegions;}
std::vector< unsigned short > jetRegions
unsigned short L1RCTJetSummaryCard::getMIPBits ( )
inline

Definition at line 66 of file L1RCTJetSummaryCard.h.

References mipBits.

Referenced by L1RCTCrate::getMIPBits().

66 {return mipBits;}
std::vector<unsigned short> L1RCTJetSummaryCard::getNonisolatedEGObjects ( )
inline

Definition at line 28 of file L1RCTJetSummaryCard.h.

References nonisolatedEGObjects.

Referenced by L1RCTCrate::getNonisolatedEGObjects().

28 {return nonisolatedEGObjects;}
std::vector< unsigned short > nonisolatedEGObjects
unsigned short L1RCTJetSummaryCard::getOverFlowBits ( )
inline

Definition at line 70 of file L1RCTJetSummaryCard.h.

References overFlowBits.

Referenced by L1RCTCrate::getOverFlowBits().

70 {return overFlowBits;}
unsigned short overFlowBits
unsigned short L1RCTJetSummaryCard::getQuietBits ( )
inline

Definition at line 67 of file L1RCTJetSummaryCard.h.

References quietBits.

Referenced by L1RCTCrate::getQuietBits().

67 {return quietBits;}
unsigned short L1RCTJetSummaryCard::getTauBits ( )
inline

Definition at line 69 of file L1RCTJetSummaryCard.h.

References tauBits.

Referenced by L1RCTCrate::getTauBits().

69 {return tauBits;}
void L1RCTJetSummaryCard::print ( void  )

Definition at line 280 of file L1RCTJetSummaryCard.cc.

References gather_cfg::cout, i, isolatedEGObjects, jetRegions, mipBits, nonisolatedEGObjects, quietBits, and tauBits.

Referenced by fillRegionSums(), L1RCTCrate::print(), and L1RCTCrate::printJSC().

280  {
281  std::cout << "tauBits " << tauBits << std::endl;
282  std::cout << "MIPBits " << mipBits << std::endl;
283  std::cout << "QuietBits " << quietBits << std::endl;
284  for(int i=0; i<4;i++) {
285  std::cout << "isoElectron " << i << " " << isolatedEGObjects.at(i) << std::endl;;
286  std::cout << "nonIsoElectron " << i <<" "<< nonisolatedEGObjects.at(i) << std::endl;
287  }
288  std::cout << "Jets ";
289  for(int i=0; i<22;i++)
290  std::cout << jetRegions.at(i) << " ";
291  std::cout << std::endl;
292 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned short > nonisolatedEGObjects
std::vector< unsigned short > isolatedEGObjects
std::vector< unsigned short > jetRegions

Member Data Documentation

std::vector<unsigned short> L1RCTJetSummaryCard::barrelRegions
private
int L1RCTJetSummaryCard::crtNo
private

Definition at line 91 of file L1RCTJetSummaryCard.h.

Referenced by crateNumber(), fillHFRegionSums(), and fillJetRegions().

std::vector<unsigned short> L1RCTJetSummaryCard::hfFineGrainBits
private

Definition at line 107 of file L1RCTJetSummaryCard.h.

Referenced by fillHFRegionSums(), and getHFFineGrainBits().

std::vector<unsigned short> L1RCTJetSummaryCard::HFRegions
private

Definition at line 99 of file L1RCTJetSummaryCard.h.

Referenced by fillHFRegionSums(), fillJetRegions(), and getHFRegions().

std::vector<unsigned short> L1RCTJetSummaryCard::isolatedEGObjects
private

Definition at line 95 of file L1RCTJetSummaryCard.h.

Referenced by fillIsolatedEGObjects(), getIsolatedEGObjects(), and print().

std::vector<unsigned short> L1RCTJetSummaryCard::jetRegions
private

Definition at line 97 of file L1RCTJetSummaryCard.h.

Referenced by fillJetRegions(), getJetRegions(), and print().

unsigned short L1RCTJetSummaryCard::mipBits
private

Definition at line 102 of file L1RCTJetSummaryCard.h.

Referenced by fillMIPBits(), getMIPBits(), and print().

std::vector<unsigned short> L1RCTJetSummaryCard::nonisolatedEGObjects
private

Definition at line 96 of file L1RCTJetSummaryCard.h.

Referenced by fillNonIsolatedEGObjects(), getNonisolatedEGObjects(), and print().

unsigned short L1RCTJetSummaryCard::overFlowBits
private

Definition at line 105 of file L1RCTJetSummaryCard.h.

Referenced by fillOverFlowBits(), and getOverFlowBits().

unsigned short L1RCTJetSummaryCard::quietBits
private

Definition at line 103 of file L1RCTJetSummaryCard.h.

Referenced by fillQuietBits(), getQuietBits(), and print().

unsigned L1RCTJetSummaryCard::quietThresholdBarrel
private

Definition at line 110 of file L1RCTJetSummaryCard.h.

Referenced by fillQuietBits().

unsigned L1RCTJetSummaryCard::quietThresholdEndcap
private

Definition at line 111 of file L1RCTJetSummaryCard.h.

Referenced by fillQuietBits().

const L1RCTLookupTables* L1RCTJetSummaryCard::rctLookupTables_
private

Definition at line 93 of file L1RCTJetSummaryCard.h.

Referenced by asicCompare(), fillHFRegionSums(), and fillQuietBits().

unsigned short L1RCTJetSummaryCard::tauBits
private

Definition at line 104 of file L1RCTJetSummaryCard.h.

Referenced by fillTauBits(), getTauBits(), and print().