39 keyName_(iConfig.getParameter<
std::
string>(
"key")),
40 useDebugTpgScales_(iConfig.getParameter<
bool>(
"useDebugTpgScales")) {
70 for (
int i = 0;
i < 18;
i++) {
71 for (
int j = 0;
j < 2;
j++) {
72 for (
int k = 0;
k < 28;
k++) {
73 m->ecalMask[
i][
j][
k] =
false;
74 m->hcalMask[
i][
j][
k] =
false;
76 for (
int k = 0;
k < 4;
k++) {
77 m->hfMask[
i][
j][
k] =
false;
86 for (
int i = 0;
i < 18;
i++) {
87 for (
int j = 0;
j < 2;
j++) {
88 for (
int k = 0;
k < 28;
k++) {
92 for (
int k = 0;
k < 4;
k++) {
108 std::cout <<
"Using old-style TPG scales!" << std::endl;
192 for (
unsigned short nCard = 0; nCard <= 6; nCard = nCard + 2) {
203 if (dummyE !=
nullptr)
205 if (dummyH !=
nullptr)
219 int card2 = card + 1;
228 lutFile_ <<
"Emulator-parameter generated lut file, card " << card <<
" key " <<
keyName_ <<
" ";
238 unsigned long data = 0;
244 for (
unsigned short nLUT = 0; nLUT < 8; nLUT++) {
246 unsigned short iAbsEta = 0;
248 iAbsEta = (card / 2) * 8 + nLUT + 1;
251 iAbsEta = (card / 2) * 8 + nLUT + 1;
253 iAbsEta = (card / 2) * 8 + (3 - (nLUT % 4)) + 1;
267 for (
unsigned int hcalEt = 0; hcalEt < 256; hcalEt++) {
269 for (
unsigned short ecalfg = 0; ecalfg < 2; ecalfg++) {
271 for (
unsigned int ecalEt = 0; ecalEt < 256; ecalEt++) {
274 unsigned short etIn9Bits = (
output >> 8) & 511;
275 unsigned short tauActivityBit = (
output >> 17) & 1;
276 data = (tauActivityBit << 9) + etIn9Bits;
283 for (
unsigned int hcalEt = 0; hcalEt < 256; hcalEt++) {
285 for (
unsigned short ecalfg = 0; ecalfg < 2; ecalfg++) {
287 for (
unsigned int ecalEt = 0; ecalEt < 256; ecalEt++) {
290 unsigned short etIn7Bits =
output & 127;
291 unsigned short heFgVetoBit = (
output >> 7) & 1;
292 data = (heFgVetoBit << 7) + etIn7Bits;
309 int card2 = card + 1;
316 lutFile_ <<
"Emulator-parameter generated EIC lut file, card " << card <<
" key " <<
keyName_ <<
" ";
325 unsigned long data = 0;
331 for (
int etIn7Bits = 0; etIn7Bits < 128; etIn7Bits++) {
350 lutFile_ <<
"Emulator parameter-generated lut file, key " <<
keyName_ <<
" ";
358 unsigned long data = 0;
359 unsigned long data0 = 0;
360 unsigned long data1 = 0;
366 for (
int lutbits = 0; lutbits < 4; lutbits++) {
368 for (
unsigned int phi1et = 0; phi1et < 256; phi1et++) {
370 for (
unsigned int phi0et = 0; phi0et < 256; phi0et++) {
384 data = (data1 << 8) + (data0);
405 unsigned int jscThresholdBarrel,
406 unsigned int jscThresholdEndcap) {
408 std::ofstream thresholdsFile;
413 thresholdsFile <<
"key is " <<
keyName_ << std::endl << std::endl;
414 thresholdsFile <<
"eicIsolationThreshold " << eicThreshold << std::endl;
415 thresholdsFile <<
"jscQuietThresholdBarrel " << jscThresholdBarrel << std::endl;
416 thresholdsFile <<
"jscQuietThresholdEndcap " << jscThresholdEndcap << std::endl;
418 thresholdsFile.close();