CMS 3D CMS Logo

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

#include <L1RCTLutWriter.h>

Inheritance diagram for L1RCTLutWriter:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1RCTLutWriter (const edm::ParameterSet &)
 
 ~L1RCTLutWriter () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void endJob () override
 
void writeEicLutFile (unsigned short card)
 
void writeJscLutFile ()
 
void writeRcLutFile (unsigned short card)
 
void writeThresholdsFile (unsigned int eicThreshold, unsigned int jscThresholdBarrel, unsigned int jscThresholdEndcap)
 

Private Attributes

std::string keyName_
 
L1RCTLookupTableslookupTable_
 
std::ofstream lutFile_
 
const L1RCTParametersrctParameters_
 
bool useDebugTpgScales_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

L1Trigger/L1RCTLutWriter/src/L1RCTLutWriter.cc

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 48 of file L1RCTLutWriter.h.

Constructor & Destructor Documentation

L1RCTLutWriter::L1RCTLutWriter ( const edm::ParameterSet iConfig)
explicit

Definition at line 37 of file L1RCTLutWriter.cc.

39  keyName_(iConfig.getParameter<std::string>("key")),
40  useDebugTpgScales_(iConfig.getParameter<bool>("useDebugTpgScales")) {
41  // now do what ever initialization is needed
42 }
T getParameter(std::string const &) const
L1RCTLookupTables * lookupTable_
std::string keyName_
L1RCTLutWriter::~L1RCTLutWriter ( )
override

Definition at line 44 of file L1RCTLutWriter.cc.

References lookupTable_.

44  {
45 
46  // do anything here that needs to be done at destruction time
47  // (e.g. close files, deallocate resources etc.)
48 
49  if (lookupTable_ != nullptr)
50  delete lookupTable_;
51 }
L1RCTLookupTables * lookupTable_

Member Function Documentation

void L1RCTLutWriter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 58 of file L1RCTLutWriter.cc.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, EcalBarrel, EcalEndcap, L1RCTNoisyChannelMask::ecalMask, L1RCTChannelMask::ecalMask, L1RCTNoisyChannelMask::ecalThreshold, L1RCTParameters::eicIsolationThreshold(), edm::EventSetup::get(), EcalTPGScale::getTPGInGeV(), h, CaloTPGTranscoder::hcaletValue(), L1RCTChannelMask::hcalMask, L1RCTNoisyChannelMask::hcalMask, L1RCTNoisyChannelMask::hcalThreshold, L1RCTChannelMask::hfMask, L1RCTNoisyChannelMask::hfMask, L1RCTNoisyChannelMask::hfThreshold, mps_fire::i, L1RCTParameters::jscQuietThresholdBarrel(), L1RCTParameters::jscQuietThresholdEndcap(), gen::k, lookupTable_, funct::m, L1CaloEcalScale::nBinEta, L1CaloHcalScale::nBinEta, L1CaloEcalScale::nBinRank, L1CaloHcalScale::nBinRank, edm::ESHandle< T >::product(), rctParameters_, alignCSCRings::s, L1CaloEcalScale::setBin(), L1CaloHcalScale::setBin(), L1RCTLookupTables::setChannelMask(), L1RCTLookupTables::setEcalScale(), EcalTPGScale::setEventSetup(), L1RCTLookupTables::setHcalScale(), L1RCTLookupTables::setL1CaloEtScale(), L1RCTLookupTables::setNoisyChannelMask(), L1RCTLookupTables::setRCTParameters(), useDebugTpgScales_, writeEicLutFile(), writeJscLutFile(), writeRcLutFile(), and writeThresholdsFile().

59  {
60 
61  // get all the configuration information from the event, set it
62  // in the lookuptable
63  edm::ESHandle<L1RCTParameters> rctParameters;
64  iSetup.get<L1RCTParametersRcd>().get(rctParameters);
65  rctParameters_ = rctParameters.product();
67  iSetup.get<L1EmEtScaleRcd>().get(emScale);
68  const L1CaloEtScale *s = emScale.product();
69 
70  // make dummy channel mask -- we don't want to mask
71  // any channels when writing LUTs, that comes afterwards
73  for (int i = 0; i < 18; i++) {
74  for (int j = 0; j < 2; j++) {
75  for (int k = 0; k < 28; k++) {
76  m->ecalMask[i][j][k] = false;
77  m->hcalMask[i][j][k] = false;
78  }
79  for (int k = 0; k < 4; k++) {
80  m->hfMask[i][j][k] = false;
81  }
82  }
83  }
84 
85  // Same for Noisy mask
86  // make dummy channel mask -- we don't want to mask
87  // any channels when writing LUTs, that comes afterwards
89  for (int i = 0; i < 18; i++) {
90  for (int j = 0; j < 2; j++) {
91  for (int k = 0; k < 28; k++) {
92  m2->ecalMask[i][j][k] = false;
93  m2->hcalMask[i][j][k] = false;
94  }
95  for (int k = 0; k < 4; k++) {
96  m2->hfMask[i][j][k] = false;
97  }
98  }
99  }
100  m2->ecalThreshold = 0.0;
101  m2->hcalThreshold = 0.0;
102  m2->hfThreshold = 0.0;
103 
104  // use these dummies to get the delete right when using old-style
105  // scales to create set of L1CaloXcalScales
106  L1CaloEcalScale *dummyE(nullptr);
107  L1CaloHcalScale *dummyH(nullptr);
108 
109  if (useDebugTpgScales_) // generate new-style scales from tpg scales
110  {
111 
112  std::cout << "Using old-style TPG scales!" << std::endl;
113 
114  // old version of hcal energy scale to convert input
116  iSetup.get<CaloTPGRecord>().get(transcoder);
117  const CaloTPGTranscoder *h_tpg = transcoder.product();
118 
119  // old version of ecal energy scale to convert input
120  EcalTPGScale *e_tpg = new EcalTPGScale();
121  e_tpg->setEventSetup(iSetup);
122 
123  L1CaloEcalScale *ecalScale = new L1CaloEcalScale();
124  L1CaloHcalScale *hcalScale = new L1CaloHcalScale();
125 
126  // generate L1CaloXcalScales from old-style scales (thanks, werner!)
127 
128  // ECAL
129  for (unsigned short ieta = 1; ieta <= L1CaloEcalScale::nBinEta; ++ieta) {
130  for (unsigned short irank = 0; irank < L1CaloEcalScale::nBinRank;
131  ++irank) {
132  EcalSubdetector subdet = (ieta <= 17) ? EcalBarrel : EcalEndcap;
133  double etGeVPos =
134  e_tpg->getTPGInGeV(irank, EcalTrigTowerDetId(1, // +ve eta
135  subdet, ieta,
136  1)); // dummy phi value
137  ecalScale->setBin(irank, ieta, 1, etGeVPos);
138  }
139  }
140 
141  for (unsigned short ieta = 1; ieta <= L1CaloEcalScale::nBinEta; ++ieta) {
142  for (unsigned short irank = 0; irank < L1CaloEcalScale::nBinRank;
143  ++irank) {
144  EcalSubdetector subdet = (ieta <= 17) ? EcalBarrel : EcalEndcap;
145 
146  double etGeVNeg =
147  e_tpg->getTPGInGeV(irank,
148  EcalTrigTowerDetId(-1, // -ve eta
149  subdet, ieta,
150  2)); // dummy phi value
151  ecalScale->setBin(irank, ieta, -1, etGeVNeg);
152  }
153  }
154 
155  // HCAL
156  for (unsigned short ieta = 1; ieta <= L1CaloHcalScale::nBinEta; ++ieta) {
157  for (unsigned short irank = 0; irank < L1CaloHcalScale::nBinRank;
158  ++irank) {
159  double etGeV = h_tpg->hcaletValue(ieta, irank);
160 
161  hcalScale->setBin(irank, ieta, 1, etGeV);
162  hcalScale->setBin(irank, ieta, -1, etGeV);
163  }
164  }
165 
166  // set the input scales
167  lookupTable_->setEcalScale(ecalScale);
168  lookupTable_->setHcalScale(hcalScale);
169 
170  dummyE = ecalScale;
171  dummyH = hcalScale;
172 
173  delete e_tpg;
174 
175  } else {
176 
177  // get energy scale to convert input from ECAL
179  iSetup.get<L1CaloEcalScaleRcd>().get(ecalScale);
180  const L1CaloEcalScale *e = ecalScale.product();
181 
182  // get energy scale to convert input from HCAL
184  iSetup.get<L1CaloHcalScaleRcd>().get(hcalScale);
185  const L1CaloHcalScale *h = hcalScale.product();
186 
187  // set scales
190  }
191 
195  // lookupTable_->setHcalScale(h);
196  // lookupTable_->setEcalScale(e);
198 
199  for (unsigned short nCard = 0; nCard <= 6; nCard = nCard + 2) {
200  writeRcLutFile(nCard);
201  writeEicLutFile(nCard);
202  }
203  writeJscLutFile();
204 
205  unsigned int eicThreshold = rctParameters_->eicIsolationThreshold();
206  unsigned int jscThresholdBarrel = rctParameters_->jscQuietThresholdBarrel();
207  unsigned int jscThresholdEndcap = rctParameters_->jscQuietThresholdEndcap();
208  writeThresholdsFile(eicThreshold, jscThresholdBarrel, jscThresholdEndcap);
209 
210  if (dummyE != nullptr)
211  delete dummyE;
212  if (dummyH != nullptr)
213  delete dummyH;
214 }
const L1RCTParameters * rctParameters_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void setEventSetup(const edm::EventSetup &evtSetup)
Definition: EcalTPGScale.cc:19
void writeRcLutFile(unsigned short card)
unsigned eicIsolationThreshold() const
bool ecalMask[18][2][28]
void setBin(unsigned short rank, unsigned short eta, short etaSign, double et)
set scale element; use this to create non-linear scales
L1RCTLookupTables * lookupTable_
void setBin(unsigned short rank, unsigned short eta, short etaSign, double et)
set scale element; use this to create non-linear scales
double getTPGInGeV(const EcalTriggerPrimitiveDigi &tpDigi)
Definition: EcalTPGScale.cc:24
unsigned jscQuietThresholdEndcap() const
void setHcalScale(const L1CaloHcalScale *hcalScale)
static const unsigned short nBinRank
void writeThresholdsFile(unsigned int eicThreshold, unsigned int jscThresholdBarrel, unsigned int jscThresholdEndcap)
void setL1CaloEtScale(const L1CaloEtScale *etScale)
int k[5][pyjets_maxn]
void setEcalScale(const L1CaloEcalScale *ecalScale)
void setRCTParameters(const L1RCTParameters *rctParameters)
static const unsigned short nBinRank
T get() const
Definition: EventSetup.h:71
void setNoisyChannelMask(const L1RCTNoisyChannelMask *channelMask)
static const unsigned short nBinEta
static const unsigned short nBinEta
bool hcalMask[18][2][28]
virtual double hcaletValue(const int &ieta, const int &iphi, const int &version, const int &compressedValue) const =0
void writeEicLutFile(unsigned short card)
EcalSubdetector
T const * product() const
Definition: ESHandle.h:86
bool hfMask[18][2][4]
void setChannelMask(const L1RCTChannelMask *channelMask)
unsigned jscQuietThresholdBarrel() const
void L1RCTLutWriter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 218 of file L1RCTLutWriter.cc.

218 {}
void L1RCTLutWriter::writeEicLutFile ( unsigned short  card)
private

Definition at line 315 of file L1RCTLutWriter.cc.

References mps_check::command, data, TauDecayModes::dec, L1RCTLookupTables::emRank(), corrVsCorr::filename, keyName_, lookupTable_, lutFile_, and estimatePileup_makeJSON::trunc.

Referenced by analyze().

315  {
316  // try timestamp
317  char filename[256];
318  char command[264];
319  if (card != 6) {
320  int card2 = card + 1;
321  sprintf(filename, "EIC%i%i-%s.dat", card, card2, keyName_.c_str());
322  } else {
323  sprintf(filename, "EIC6-%s.dat", keyName_.c_str());
324  }
325  // open file for writing, delete any existing content
326  lutFile_.open(filename, std::ios::trunc);
327  lutFile_ << "Emulator-parameter generated EIC lut file, card " << card
328  << " key " << keyName_ << " ";
329  // close to append timestamp info
330  lutFile_.close();
331  sprintf(command, "date >> %s", filename);
332  system(command);
333 
334  // reopen file for writing values
335  lutFile_.open(filename, std::ios::app);
336 
337  unsigned long data = 0;
338 
339  // write all memory addresses in increasing order
340  // address = (1<<22) + (etIn7Bits<<1)
341 
342  // 2^7 = 0x7f = 128
343  for (int etIn7Bits = 0; etIn7Bits < 128; etIn7Bits++) {
344  data = lookupTable_->emRank(etIn7Bits);
345  if (data > 0x3f) {
346  data = 0x3f;
347  }
348  lutFile_ << std::hex << data << std::dec << std::endl;
349  }
350  lutFile_.close();
351  return;
352 }
L1RCTLookupTables * lookupTable_
std::string keyName_
unsigned int emRank(unsigned short energy) const
std::ofstream lutFile_
list command
Definition: mps_check.py:25
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void L1RCTLutWriter::writeJscLutFile ( )
private

Definition at line 355 of file L1RCTLutWriter.cc.

References mps_check::command, data, TauDecayModes::dec, corrVsCorr::filename, keyName_, L1RCTLookupTables::lookup(), lookupTable_, lutFile_, and estimatePileup_makeJSON::trunc.

Referenced by analyze().

355  {
356  char filename[256];
357  char command[264];
358  sprintf(filename, "JSC-%s.dat", keyName_.c_str());
359 
360  // open file; if it already existed, delete existing content
361  lutFile_.open(filename, std::ios::trunc);
362  lutFile_ << "Emulator parameter-generated lut file, key " << keyName_
363  << " ";
364  // close to append time-stamp
365  lutFile_.close();
366  sprintf(command, "date >> %s", filename);
367  system(command);
368  // reopen file for writing
369  lutFile_.open(filename, std::ios::app);
370 
371  unsigned long data = 0;
372  unsigned long data0 = 0;
373  unsigned long data1 = 0;
374 
375  // write all memory addresses in increasing order
376  // address = (1<<22) + (lutbits<<17) + (phi1et<<9) + (phi0et<<1);
377 
378  // ecl and U93/U225 lut id bits, identify eta segment of hf
379  for (int lutbits = 0; lutbits < 4; lutbits++) {
380  // 8-bit phi_1 et for each eta partition
381  for (unsigned int phi1et = 0; phi1et < 256; phi1et++) {
382  // 8-bit phi_0 et for each eta
383  for (unsigned int phi0et = 0; phi0et < 256; phi0et++) {
384  // lookup takes "(hf_et, crate, card, tower)"
385  // "card" convention for hf is 999, tower is 0-7
386  // but equivalent to 0-3 == lutbits
387  // crate doesn't matter, take 0
388  // only |ieta| matters
389  data0 = lookupTable_->lookup(phi0et, 0, 999, lutbits);
390  if (data0 > 0xff) {
391  data0 = 0xff; // 8-bit output energy for each phi region
392  }
393  data1 = lookupTable_->lookup(phi1et, 0, 999, lutbits);
394  if (data1 > 0xff) {
395  data1 = 0xff; // 8-bit output energy for each phi region
396  }
397  data = (data1 << 8) + (data0);
398  lutFile_ << std::hex << data << std::dec << std::endl;
399  /*
400  if (phi0et < 10 && phi1et < 10)
401  {
402  std::cout << "Writer: jsc. lutbits=" << lutbits
403  << " phi0et=" << phi0et << " data0=" << data0
404  << " phi1et=" << phi1et << " data1=" << data1
405  << std::endl;
406  }
407  */
408  }
409  }
410  }
411 
412  lutFile_.close();
413  return;
414 }
L1RCTLookupTables * lookupTable_
std::string keyName_
std::ofstream lutFile_
list command
Definition: mps_check.py:25
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned int lookup(unsigned short ecalInput, unsigned short hcalInput, unsigned short fgbit, unsigned short crtNo, unsigned short crdNo, unsigned short twrNo) const
void L1RCTLutWriter::writeRcLutFile ( unsigned short  card)
private

Definition at line 221 of file L1RCTLutWriter.cc.

References L1RCTParameters::calcCrate(), L1RCTParameters::calcTower(), mps_check::command, data, TauDecayModes::dec, corrVsCorr::filename, keyName_, L1RCTLookupTables::lookup(), lookupTable_, lutFile_, convertSQLitetoXML_cfg::output, rctParameters_, and estimatePileup_makeJSON::trunc.

Referenced by analyze().

221  {
222 
223  // don't mess yet with name
224  char filename[256];
225  char command[264];
226  if (card != 6) {
227  int card2 = card + 1;
228  sprintf(filename, "RC%i%i-%s.dat", card, card2, keyName_.c_str());
229  // sprintf(filename, "RC%i%i.dat", card, card2);
230  } else {
231  sprintf(filename, "RC6-%s.dat", keyName_.c_str());
232  // sprintf(filename, "RC6.dat");
233  }
234  // open file for writing, delete any existing content
235  lutFile_.open(filename, std::ios::trunc);
236  lutFile_ << "Emulator-parameter generated lut file, card " << card << " key "
237  << keyName_ << " ";
238 
239  // close to append timestamp info
240  lutFile_.close();
241  sprintf(command, "date >> %s", filename);
242  system(command);
243 
244  // reopen file for writing values
245  lutFile_.open(filename, std::ios::app);
246 
247  unsigned long data = 0;
248 
249  // write all memory addresses in increasing order
250  // address = (1<<22)+(nLUT<<19)+(eG?<18)+(hcalEt<<10)+(ecalfg<<9)+(ecalEt<<1)
251 
252  // loop through the physical LUTs on the card, 0-7
253  for (unsigned short nLUT = 0; nLUT < 8; nLUT++) {
254  // determine ieta, iphi, etc. everything
255  unsigned short iAbsEta = 0;
256  if (card != 6) {
257  iAbsEta = (card / 2) * 8 + nLUT + 1;
258  } else {
259  if (nLUT < 4) {
260  iAbsEta = (card / 2) * 8 + nLUT + 1;
261  } else {
262  iAbsEta = (card / 2) * 8 + (3 - (nLUT % 4)) + 1;
263  }
264  // std::cout << "LUT is " << nLUT << " iAbsEta is " << iAbsEta <<
265  // std::endl;
266  }
267 
268  // All RCT stuff uniform in phi, symmetric wrt eta = 0
269 
270  // below line always gives crate in +eta; makes no difference to us
271  unsigned short crate = rctParameters_->calcCrate(1, iAbsEta);
272  unsigned short tower = rctParameters_->calcTower(1, iAbsEta);
273 
274  // first do region sums half of LUTs, bit 18 of address is 0
275  // loop through 8 bits of hcal energy, 2^8 is 256
276  for (unsigned int hcalEt = 0; hcalEt < 256; hcalEt++) {
277  // loop through 1 bit of ecal fine grain
278  for (unsigned short ecalfg = 0; ecalfg < 2; ecalfg++) {
279  // loop through 8 bits of ecal energy
280  for (unsigned int ecalEt = 0; ecalEt < 256; ecalEt++) {
281  // assign 10-bit (9et,1mip) sums data here!
282  unsigned long output =
283  lookupTable_->lookup(ecalEt, hcalEt, ecalfg, crate, card, tower);
284  unsigned short etIn9Bits = (output >> 8) & 511;
285  unsigned short tauActivityBit = (output >> 17) & 1;
286  data = (tauActivityBit << 9) + etIn9Bits;
287  lutFile_ << std::hex << data << std::dec << std::endl;
288  }
289  }
290  }
291  // second do egamma half of LUTs, bit 18 of address is 1
292  // loop through 8 bits of hcal energy
293  for (unsigned int hcalEt = 0; hcalEt < 256; hcalEt++) {
294  // loop through 1 bit of ecal fine grain
295  for (unsigned short ecalfg = 0; ecalfg < 2; ecalfg++) {
296  // loop through 8 bits of ecal energy
297  for (unsigned int ecalEt = 0; ecalEt < 256; ecalEt++) {
298  // assign 8-bit (7et,1veto) egamma data here!
299  unsigned long output =
300  lookupTable_->lookup(ecalEt, hcalEt, ecalfg, crate, card, tower);
301  unsigned short etIn7Bits = output & 127;
302  unsigned short heFgVetoBit = (output >> 7) & 1;
303  data = (heFgVetoBit << 7) + etIn7Bits;
304  lutFile_ << std::hex << data << std::dec << std::endl;
305  }
306  }
307  }
308  }
309 
310  lutFile_.close();
311  return;
312 }
const L1RCTParameters * rctParameters_
L1RCTLookupTables * lookupTable_
std::string keyName_
unsigned short calcTower(unsigned short rct_iphi, unsigned short absIeta) const
std::ofstream lutFile_
list command
Definition: mps_check.py:25
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned short calcCrate(unsigned short rct_iphi, short ieta) const
unsigned int lookup(unsigned short ecalInput, unsigned short hcalInput, unsigned short fgbit, unsigned short crtNo, unsigned short crdNo, unsigned short twrNo) const
void L1RCTLutWriter::writeThresholdsFile ( unsigned int  eicThreshold,
unsigned int  jscThresholdBarrel,
unsigned int  jscThresholdEndcap 
)
private

Definition at line 417 of file L1RCTLutWriter.cc.

References corrVsCorr::filename, keyName_, and estimatePileup_makeJSON::trunc.

Referenced by analyze().

419  {
420  //
421  std::ofstream thresholdsFile;
422  char filename[256];
423  sprintf(filename, "Thresholds-%s.dat", keyName_.c_str());
424  thresholdsFile.open(filename, std::ios::trunc);
425 
426  thresholdsFile << "key is " << keyName_ << std::endl << std::endl;
427  thresholdsFile << "eicIsolationThreshold " << eicThreshold << std::endl;
428  thresholdsFile << "jscQuietThresholdBarrel " << jscThresholdBarrel
429  << std::endl;
430  thresholdsFile << "jscQuietThresholdEndcap " << jscThresholdEndcap
431  << std::endl;
432 
433  thresholdsFile.close();
434 }
std::string keyName_

Member Data Documentation

std::string L1RCTLutWriter::keyName_
private
L1RCTLookupTables* L1RCTLutWriter::lookupTable_
private
std::ofstream L1RCTLutWriter::lutFile_
private

Definition at line 68 of file L1RCTLutWriter.h.

Referenced by writeEicLutFile(), writeJscLutFile(), and writeRcLutFile().

const L1RCTParameters* L1RCTLutWriter::rctParameters_
private

Definition at line 66 of file L1RCTLutWriter.h.

Referenced by analyze(), and writeRcLutFile().

bool L1RCTLutWriter::useDebugTpgScales_
private

Definition at line 70 of file L1RCTLutWriter.h.

Referenced by analyze().