CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void endJob ()
 
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 &)
 
- 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 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.

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

Definition at line 47 of file L1RCTLutWriter.cc.

References lookupTable_.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 63 of file L1RCTLutWriter.cc.

References gather_cfg::cout, alignCSCRings::e, EcalBarrel, EcalEndcap, L1RCTChannelMask::ecalMask, L1RCTNoisyChannelMask::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, i, j, L1RCTParameters::jscQuietThresholdBarrel(), L1RCTParameters::jscQuietThresholdEndcap(), relval_steps::k, lookupTable_, visualization-live-secondInstance_cfg::m, L1CaloEcalScale::nBinEta, L1CaloHcalScale::nBinEta, L1CaloEcalScale::nBinRank, L1CaloHcalScale::nBinRank, edm::ESHandle< class >::product(), rctParameters_, alignCSCRings::s, L1CaloHcalScale::setBin(), L1CaloEcalScale::setBin(), L1RCTLookupTables::setChannelMask(), L1RCTLookupTables::setEcalScale(), EcalTPGScale::setEventSetup(), L1RCTLookupTables::setHcalScale(), L1RCTLookupTables::setL1CaloEtScale(), L1RCTLookupTables::setNoisyChannelMask(), L1RCTLookupTables::setRCTParameters(), useDebugTpgScales_, writeEicLutFile(), writeJscLutFile(), writeRcLutFile(), and writeThresholdsFile().

64 {
65 
66  // get all the configuration information from the event, set it
67  // in the lookuptable
68  edm::ESHandle<L1RCTParameters> rctParameters;
69  iSetup.get<L1RCTParametersRcd>().get(rctParameters);
70  rctParameters_ = rctParameters.product();
72  iSetup.get<L1EmEtScaleRcd>().get(emScale);
73  const L1CaloEtScale* s = emScale.product();
74 
75  // make dummy channel mask -- we don't want to mask
76  // any channels when writing LUTs, that comes afterwards
78  for (int i = 0; i < 18; i++)
79  {
80  for (int j = 0; j < 2; j++)
81  {
82  for (int k = 0; k < 28; k++)
83  {
84  m->ecalMask[i][j][k] = false;
85  m->hcalMask[i][j][k] = false;
86  }
87  for (int k = 0; k < 4; k++)
88  {
89  m->hfMask[i][j][k] = false;
90  }
91  }
92  }
93 
94 
95  //Same for Noisy mask
96  // make dummy channel mask -- we don't want to mask
97  // any channels when writing LUTs, that comes afterwards
99  for (int i = 0; i < 18; i++)
100  {
101  for (int j = 0; j < 2; j++)
102  {
103  for (int k = 0; k < 28; k++)
104  {
105  m2->ecalMask[i][j][k] = false;
106  m2->hcalMask[i][j][k] = false;
107  }
108  for (int k = 0; k < 4; k++)
109  {
110  m2->hfMask[i][j][k] = false;
111  }
112  }
113  }
114  m2->ecalThreshold = 0.0;
115  m2->hcalThreshold = 0.0;
116  m2->hfThreshold = 0.0;
117 
118 
119 
120  // use these dummies to get the delete right when using old-style
121  // scales to create set of L1CaloXcalScales
122  L1CaloEcalScale* dummyE(0);
123  L1CaloHcalScale* dummyH(0);
124 
125  if (useDebugTpgScales_) // generate new-style scales from tpg scales
126  {
127 
128  std::cout << "Using old-style TPG scales!" << std::endl;
129 
130  // old version of hcal energy scale to convert input
132  iSetup.get<CaloTPGRecord>().get(transcoder);
133  const CaloTPGTranscoder* h_tpg = transcoder.product();
134 
135  // old version of ecal energy scale to convert input
136  EcalTPGScale* e_tpg = new EcalTPGScale();
137  e_tpg->setEventSetup(iSetup);
138 
139  L1CaloEcalScale* ecalScale = new L1CaloEcalScale();
140  L1CaloHcalScale* hcalScale = new L1CaloHcalScale();
141 
142  // generate L1CaloXcalScales from old-style scales (thanks, werner!)
143 
144  // ECAL
145  for( unsigned short ieta = 1 ; ieta <= L1CaloEcalScale::nBinEta; ++ieta )
146  {
147  for( unsigned short irank = 0 ; irank < L1CaloEcalScale::nBinRank; ++irank )
148  {
149  EcalSubdetector subdet = ( ieta <= 17 ) ? EcalBarrel : EcalEndcap ;
150  double etGeVPos =
151  e_tpg->getTPGInGeV
152  ( irank, EcalTrigTowerDetId(1, // +ve eta
153  subdet,
154  ieta,
155  1 )); // dummy phi value
156  ecalScale->setBin( irank, ieta, 1, etGeVPos ) ;
157  }
158  }
159 
160  for( unsigned short ieta = 1 ; ieta <= L1CaloEcalScale::nBinEta; ++ieta )
161  {
162  for( unsigned short irank = 0 ; irank < L1CaloEcalScale::nBinRank; ++irank )
163  {
164  EcalSubdetector subdet = ( ieta <= 17 ) ? EcalBarrel : EcalEndcap ;
165 
166  double etGeVNeg =
167  e_tpg->getTPGInGeV
168  ( irank,
169  EcalTrigTowerDetId(-1, // -ve eta
170  subdet,
171  ieta,
172  2 )); // dummy phi value
173  ecalScale->setBin( irank, ieta, -1, etGeVNeg ) ;
174  }
175  }
176 
177  // HCAL
178  for( unsigned short ieta = 1 ; ieta <= L1CaloHcalScale::nBinEta; ++ieta )
179  {
180  for( unsigned short irank = 0 ; irank < L1CaloHcalScale::nBinRank; ++irank )
181  {
182  double etGeV = h_tpg->hcaletValue( ieta, irank ) ;
183 
184  hcalScale->setBin( irank, ieta, 1, etGeV ) ;
185  hcalScale->setBin( irank, ieta, -1, etGeV ) ;
186  }
187  }
188 
189  // set the input scales
190  lookupTable_->setEcalScale(ecalScale);
191  lookupTable_->setHcalScale(hcalScale);
192 
193  dummyE = ecalScale;
194  dummyH = hcalScale;
195 
196  delete e_tpg;
197 
198  }
199  else
200  {
201 
202  // get energy scale to convert input from ECAL
204  iSetup.get<L1CaloEcalScaleRcd>().get(ecalScale);
205  const L1CaloEcalScale* e = ecalScale.product();
206 
207  // get energy scale to convert input from HCAL
209  iSetup.get<L1CaloHcalScaleRcd>().get(hcalScale);
210  const L1CaloHcalScale* h = hcalScale.product();
211 
212  // set scales
215 
216  }
217 
221  //lookupTable_->setHcalScale(h);
222  //lookupTable_->setEcalScale(e);
224 
225  for (unsigned short nCard = 0; nCard <= 6; nCard = nCard + 2)
226  {
227  writeRcLutFile(nCard);
228  writeEicLutFile(nCard);
229  }
230  writeJscLutFile();
231 
232  unsigned int eicThreshold = rctParameters_->eicIsolationThreshold();
233  unsigned int jscThresholdBarrel = rctParameters_->jscQuietThresholdBarrel();
234  unsigned int jscThresholdEndcap = rctParameters_->jscQuietThresholdEndcap();
235  writeThresholdsFile(eicThreshold, jscThresholdBarrel, jscThresholdEndcap);
236 
237  if (dummyE != 0) delete dummyE;
238  if (dummyH != 0) delete dummyH;
239 
240 }
int i
Definition: DBlmapReader.cc:9
const L1RCTParameters * rctParameters_
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)
int j
Definition: DBlmapReader.cc:9
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void setL1CaloEtScale(const L1CaloEtScale *etScale)
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
void setEcalScale(const L1CaloEcalScale *ecalScale)
void setRCTParameters(const L1RCTParameters *rctParameters)
static const unsigned short nBinRank
void setNoisyChannelMask(const L1RCTNoisyChannelMask *channelMask)
static const unsigned short nBinEta
static const unsigned short nBinEta
bool hcalMask[18][2][28]
tuple cout
Definition: gather_cfg.py:121
void writeEicLutFile(unsigned short card)
EcalSubdetector
bool hfMask[18][2][4]
void setChannelMask(const L1RCTChannelMask *channelMask)
unsigned jscQuietThresholdBarrel() const
virtual double hcaletValue(const int &ieta, const int &compET) const =0
void L1RCTLutWriter::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 247 of file L1RCTLutWriter.cc.

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

Definition at line 366 of file L1RCTLutWriter.cc.

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

Referenced by analyze().

367 {
368  // try timestamp
369  char filename[256];
370  char command[64];
371  if (card != 6)
372  {
373  int card2 = card + 1;
374  sprintf(filename,"EIC%i%i-%s.dat", card, card2, keyName_.c_str() );
375  }
376  else
377  {
378  sprintf(filename,"EIC6-%s.dat", keyName_.c_str() );
379  }
380  // open file for writing, delete any existing content
381  lutFile_.open(filename, std::ios::trunc);
382  lutFile_ << "Emulator-parameter generated EIC lut file, card "
383  << card << " key " << keyName_ << " ";
384  // close to append timestamp info
385  lutFile_.close();
386  sprintf(command, "date >> %s", filename);
387  system(command);
388 
389  // reopen file for writing values
390  lutFile_.open(filename, std::ios::app);
391 
392  unsigned long data = 0;
393 
394  // write all memory addresses in increasing order
395  // address = (1<<22) + (etIn7Bits<<1)
396 
397  // 2^7 = 0x7f = 128
398  for (int etIn7Bits = 0; etIn7Bits < 128; etIn7Bits++)
399  {
400  data = lookupTable_->emRank(etIn7Bits);
401  if (data > 0x3f)
402  {
403  data = 0x3f;
404  }
405  lutFile_ << std::hex << data << std::dec << std::endl;
406  }
407  lutFile_.close();
408  return;
409 }
L1RCTLookupTables * lookupTable_
std::string keyName_
unsigned int emRank(unsigned short energy) const
std::ofstream lutFile_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple filename
Definition: lut2db_cfg.py:20
void L1RCTLutWriter::writeJscLutFile ( )
private

Definition at line 413 of file L1RCTLutWriter.cc.

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

Referenced by analyze().

414 {
415  char filename[256];
416  char command[64];
417  sprintf(filename, "JSC-%s.dat", keyName_.c_str() );
418 
419  // open file; if it already existed, delete existing content
420  lutFile_.open(filename, std::ios::trunc);
421  lutFile_ << "Emulator parameter-generated lut file, key " << keyName_
422  << " ";
423  // close to append time-stamp
424  lutFile_.close();
425  sprintf(command, "date >> %s", filename);
426  system(command);
427  // reopen file for writing
428  lutFile_.open(filename, std::ios::app);
429 
430  unsigned long data = 0;
431  unsigned long data0 = 0;
432  unsigned long data1 = 0;
433 
434  // write all memory addresses in increasing order
435  // address = (1<<22) + (lutbits<<17) + (phi1et<<9) + (phi0et<<1);
436 
437  // ecl and U93/U225 lut id bits, identify eta segment of hf
438  for (int lutbits = 0; lutbits < 4; lutbits++)
439  {
440  // 8-bit phi_1 et for each eta partition
441  for (unsigned int phi1et = 0; phi1et < 256; phi1et++)
442  {
443  // 8-bit phi_0 et for each eta
444  for (unsigned int phi0et = 0; phi0et < 256; phi0et++)
445  {
446  // lookup takes "(hf_et, crate, card, tower)"
447  // "card" convention for hf is 999, tower is 0-7
448  // but equivalent to 0-3 == lutbits
449  // crate doesn't matter, take 0
450  // only |ieta| matters
451  data0 = lookupTable_->lookup(phi0et, 0, 999, lutbits);
452  if (data0 > 0xff)
453  {
454  data0 = 0xff; // 8-bit output energy for each phi region
455  }
456  data1 = lookupTable_->lookup(phi1et, 0, 999, lutbits);
457  if (data1 > 0xff)
458  {
459  data1 = 0xff; // 8-bit output energy for each phi region
460  }
461  data = (data1<<8) + (data0);
462  lutFile_ << std::hex << data << std::dec << std::endl;
463  /*
464  if (phi0et < 10 && phi1et < 10)
465  {
466  std::cout << "Writer: jsc. lutbits=" << lutbits
467  << " phi0et=" << phi0et << " data0=" << data0
468  << " phi1et=" << phi1et << " data1=" << data1
469  << std::endl;
470  }
471  */
472  }
473  }
474  }
475 
476  lutFile_.close();
477  return;
478 }
L1RCTLookupTables * lookupTable_
std::string keyName_
std::ofstream lutFile_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple filename
Definition: lut2db_cfg.py:20
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 253 of file L1RCTLutWriter.cc.

References L1RCTParameters::calcCrate(), L1RCTParameters::calcTower(), edmPickEvents::command, data, TauDecayModes::dec, lut2db_cfg::filename, keyName_, lookupTable_, lutFile_, convertSQLitetoXML_cfg::output, rctParameters_, and estimatePileup_makeJSON::trunc.

Referenced by analyze().

254 {
255 
256  // don't mess yet with name
257  char filename[256];
258  char command[64];
259  if (card != 6)
260  {
261  int card2 = card + 1;
262  sprintf(filename,"RC%i%i-%s.dat",card,card2,keyName_.c_str() );
263  //sprintf(filename, "RC%i%i.dat", card, card2);
264  }
265  else
266  {
267  sprintf(filename,"RC6-%s.dat",keyName_.c_str() );
268  //sprintf(filename, "RC6.dat");
269  }
270  // open file for writing, delete any existing content
271  lutFile_.open(filename, std::ios::trunc);
272  lutFile_ << "Emulator-parameter generated lut file, card "
273  << card << " key " << keyName_ << " ";
274 
275  // close to append timestamp info
276  lutFile_.close();
277  sprintf(command, "date >> %s", filename);
278  system(command);
279 
280  // reopen file for writing values
281  lutFile_.open(filename, std::ios::app);
282 
283  unsigned long data = 0;
284 
285  // write all memory addresses in increasing order
286  // address = (1<<22)+(nLUT<<19)+(eG?<18)+(hcalEt<<10)+(ecalfg<<9)+(ecalEt<<1)
287 
288  // loop through the physical LUTs on the card, 0-7
289  for (unsigned short nLUT = 0; nLUT < 8; nLUT++)
290  {
291  // determine ieta, iphi, etc. everything
292  unsigned short iAbsEta = 0;
293  if (card != 6)
294  {
295  iAbsEta = (card/2)*8 + nLUT + 1;
296  }
297  else
298  {
299  if (nLUT < 4)
300  {
301  iAbsEta = (card/2)*8 + nLUT + 1;
302  }
303  else
304  {
305  iAbsEta = (card/2)*8 + (3 - (nLUT%4) ) + 1;
306  }
307  //std::cout << "LUT is " << nLUT << " iAbsEta is " << iAbsEta << std::endl;
308  }
309 
310 
311  // All RCT stuff uniform in phi, symmetric wrt eta = 0
312 
313  // below line always gives crate in +eta; makes no difference to us
314  unsigned short crate = rctParameters_->calcCrate(1, iAbsEta);
315  unsigned short tower = rctParameters_->calcTower(1, iAbsEta);
316 
317  // first do region sums half of LUTs, bit 18 of address is 0
318  // loop through 8 bits of hcal energy, 2^8 is 256
319  for (unsigned int hcalEt = 0; hcalEt < 256; hcalEt++)
320  {
321  // loop through 1 bit of ecal fine grain
322  for (unsigned short ecalfg = 0; ecalfg < 2; ecalfg++)
323  {
324  // loop through 8 bits of ecal energy
325  for (unsigned int ecalEt = 0; ecalEt < 256; ecalEt++)
326  {
327  // assign 10-bit (9et,1mip) sums data here!
328  unsigned long output = lookupTable_->
329  lookup(ecalEt, hcalEt, ecalfg, crate, card, tower);
330  unsigned short etIn9Bits = (output>>8)&511;
331  unsigned short tauActivityBit = (output>>17)&1;
332  data = (tauActivityBit<<9)+etIn9Bits;
333  lutFile_ << std::hex << data << std::dec << std::endl;
334  }
335  }
336  }
337  // second do egamma half of LUTs, bit 18 of address is 1
338  // loop through 8 bits of hcal energy
339  for (unsigned int hcalEt = 0; hcalEt < 256; hcalEt++)
340  {
341  // loop through 1 bit of ecal fine grain
342  for (unsigned short ecalfg = 0; ecalfg < 2; ecalfg++)
343  {
344  // loop through 8 bits of ecal energy
345  for (unsigned int ecalEt = 0; ecalEt < 256; ecalEt++)
346  {
347  // assign 8-bit (7et,1veto) egamma data here!
348  unsigned long output = lookupTable_->
349  lookup(ecalEt, hcalEt, ecalfg, crate, card, tower);
350  unsigned short etIn7Bits = output&127;
351  unsigned short heFgVetoBit = (output>>7)&1;
352  data = (heFgVetoBit<<7)+etIn7Bits;
353  lutFile_ << std::hex << data << std::dec << std::endl;
354  }
355  }
356  }
357  }
358 
359  lutFile_.close();
360  return;
361 
362 }
const L1RCTParameters * rctParameters_
L1RCTLookupTables * lookupTable_
std::string keyName_
unsigned short calcTower(unsigned short rct_iphi, unsigned short absIeta) const
std::ofstream lutFile_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple filename
Definition: lut2db_cfg.py:20
unsigned short calcCrate(unsigned short rct_iphi, short ieta) const
void L1RCTLutWriter::writeThresholdsFile ( unsigned int  eicThreshold,
unsigned int  jscThresholdBarrel,
unsigned int  jscThresholdEndcap 
)
private

Definition at line 482 of file L1RCTLutWriter.cc.

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

Referenced by analyze().

485 {
486  //
487  std::ofstream thresholdsFile;
488  char filename[256];
489  sprintf(filename, "Thresholds-%s.dat", keyName_.c_str() );
490  thresholdsFile.open(filename, std::ios::trunc);
491 
492  thresholdsFile << "key is " << keyName_ << std::endl << std::endl;
493  thresholdsFile << "eicIsolationThreshold " << eicThreshold << std::endl;
494  thresholdsFile << "jscQuietThresholdBarrel " << jscThresholdBarrel << std::endl;
495  thresholdsFile << "jscQuietThresholdEndcap " << jscThresholdEndcap << std::endl;
496 
497  thresholdsFile.close();
498 }
std::string keyName_
tuple filename
Definition: lut2db_cfg.py:20

Member Data Documentation

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

Definition at line 69 of file L1RCTLutWriter.h.

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

const L1RCTParameters* L1RCTLutWriter::rctParameters_
private

Definition at line 67 of file L1RCTLutWriter.h.

Referenced by analyze(), and writeRcLutFile().

bool L1RCTLutWriter::useDebugTpgScales_
private

Definition at line 71 of file L1RCTLutWriter.h.

Referenced by analyze().