|
|
Go to the documentation of this file.
39 keyName_(iConfig.getParameter<
std::
string>(
"key")),
45 useDebugTpgScales_(iConfig.getParameter<
bool>(
"useDebugTpgScales")),
74 for (
int i = 0;
i < 18;
i++) {
75 for (
int j = 0;
j < 2;
j++) {
76 for (
int k = 0;
k < 28;
k++) {
77 m->ecalMask[
i][
j][
k] =
false;
78 m->hcalMask[
i][
j][
k] =
false;
80 for (
int k = 0;
k < 4;
k++) {
81 m->hfMask[
i][
j][
k] =
false;
90 for (
int i = 0;
i < 18;
i++) {
91 for (
int j = 0;
j < 2;
j++) {
92 for (
int k = 0;
k < 28;
k++) {
93 m2->ecalMask[
i][
j][
k] =
false;
94 m2->hcalMask[
i][
j][
k] =
false;
96 for (
int k = 0;
k < 4;
k++) {
97 m2->hfMask[
i][
j][
k] =
false;
101 m2->ecalThreshold = 0.0;
102 m2->hcalThreshold = 0.0;
103 m2->hfThreshold = 0.0;
112 std::cout <<
"Using old-style TPG scales!" << std::endl;
190 for (
unsigned short nCard = 0; nCard <= 6; nCard = nCard + 2) {
201 if (dummyE !=
nullptr)
203 if (dummyH !=
nullptr)
217 int card2 = card + 1;
226 lutFile_ <<
"Emulator-parameter generated lut file, card " << card <<
" key " <<
keyName_ <<
" ";
236 unsigned long data = 0;
242 for (
unsigned short nLUT = 0; nLUT < 8; nLUT++) {
244 unsigned short iAbsEta = 0;
246 iAbsEta = (card / 2) * 8 + nLUT + 1;
249 iAbsEta = (card / 2) * 8 + nLUT + 1;
251 iAbsEta = (card / 2) * 8 + (3 - (nLUT % 4)) + 1;
265 for (
unsigned int hcalEt = 0; hcalEt < 256; hcalEt++) {
267 for (
unsigned short ecalfg = 0; ecalfg < 2; ecalfg++) {
269 for (
unsigned int ecalEt = 0; ecalEt < 256; ecalEt++) {
272 unsigned short etIn9Bits = (
output >> 8) & 511;
273 unsigned short tauActivityBit = (
output >> 17) & 1;
274 data = (tauActivityBit << 9) + etIn9Bits;
281 for (
unsigned int hcalEt = 0; hcalEt < 256; hcalEt++) {
283 for (
unsigned short ecalfg = 0; ecalfg < 2; ecalfg++) {
285 for (
unsigned int ecalEt = 0; ecalEt < 256; ecalEt++) {
288 unsigned short etIn7Bits =
output & 127;
289 unsigned short heFgVetoBit = (
output >> 7) & 1;
290 data = (heFgVetoBit << 7) + etIn7Bits;
307 int card2 = card + 1;
314 lutFile_ <<
"Emulator-parameter generated EIC lut file, card " << card <<
" key " <<
keyName_ <<
" ";
323 unsigned long data = 0;
329 for (
int etIn7Bits = 0; etIn7Bits < 128; etIn7Bits++) {
348 lutFile_ <<
"Emulator parameter-generated lut file, key " <<
keyName_ <<
" ";
356 unsigned long data = 0;
357 unsigned long data0 = 0;
358 unsigned long data1 = 0;
364 for (
int lutbits = 0; lutbits < 4; lutbits++) {
366 for (
unsigned int phi1et = 0; phi1et < 256; phi1et++) {
368 for (
unsigned int phi0et = 0; phi0et < 256; phi0et++) {
382 data = (data1 << 8) + (data0);
403 unsigned int jscThresholdBarrel,
404 unsigned int jscThresholdEndcap) {
406 std::ofstream thresholdsFile;
411 thresholdsFile <<
"key is " <<
keyName_ << std::endl << std::endl;
412 thresholdsFile <<
"eicIsolationThreshold " << eicThreshold << std::endl;
413 thresholdsFile <<
"jscQuietThresholdBarrel " << jscThresholdBarrel << std::endl;
414 thresholdsFile <<
"jscQuietThresholdEndcap " << jscThresholdEndcap << std::endl;
416 thresholdsFile.close();
T const * product() const
unsigned eicIsolationThreshold() const
L1RCTLutWriter(const edm::ParameterSet &)
unsigned int lookup(unsigned short ecalInput, unsigned short hcalInput, unsigned short fgbit, unsigned short crtNo, unsigned short crdNo, unsigned short twrNo) const
void writeRcLutFile(unsigned short card)
L1RCTLookupTables * lookupTable_
static const unsigned short nBinRank
void analyze(const edm::Event &, const edm::EventSetup &) override
unsigned jscQuietThresholdEndcap() const
static const unsigned short nBinRank
void setHcalScale(const L1CaloHcalScale *hcalScale)
EcalTPGScale::Tokens tokens_
edm::ESGetToken< L1CaloHcalScale, L1CaloHcalScaleRcd > hcalScaleToken_
std::vector< edm::EDGetTokenT< int > > tokens_
unsigned short calcCrate(unsigned short rct_iphi, short ieta) const
unsigned jscQuietThresholdBarrel() const
edm::ESGetToken< CaloTPGTranscoder, CaloTPGRecord > transcoderToken_
static const unsigned short nBinEta
void writeThresholdsFile(unsigned int eicThreshold, unsigned int jscThresholdBarrel, unsigned int jscThresholdEndcap)
edm::ESGetToken< L1CaloEtScale, L1EmEtScaleRcd > emScaleToken_
double getTPGInGeV(const EcalTriggerPrimitiveDigi &tpDigi) const
void setL1CaloEtScale(const L1CaloEtScale *etScale)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void setBin(unsigned short rank, unsigned short eta, short etaSign, double et)
set scale element; use this to create non-linear scales
unsigned short calcTower(unsigned short rct_iphi, unsigned short absIeta) const
void setBin(unsigned short rank, unsigned short eta, short etaSign, double et)
set scale element; use this to create non-linear scales
void setNoisyChannelMask(const L1RCTNoisyChannelMask *channelMask)
void setEcalScale(const L1CaloEcalScale *ecalScale)
void writeEicLutFile(unsigned short card)
void setRCTParameters(const L1RCTParameters *rctParameters)
char data[epos_bytes_allocation]
virtual double hcaletValue(const int &ieta, const int &iphi, const int &version, const int &compressedValue) const =0
~L1RCTLutWriter() override
const L1RCTParameters * rctParameters_
void setChannelMask(const L1RCTChannelMask *channelMask)
static const unsigned short nBinEta
edm::ESGetToken< L1CaloEcalScale, L1CaloEcalScaleRcd > ecalScaleToken_
unsigned int emRank(unsigned short energy) const
edm::ESGetToken< L1RCTParameters, L1RCTParametersRcd > rctParametersToken_