CMS 3D CMS Logo

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

#include <EcalTrigPrimESProducer.h>

Inheritance diagram for EcalTrigPrimESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 EcalTrigPrimESProducer (const edm::ParameterSet &)
 
std::unique_ptr< EcalTPGStripStatusproduceBadStrip (const EcalTPGStripStatusRcd &)
 
std::unique_ptr< EcalTPGTowerStatusproduceBadTT (const EcalTPGTowerStatusRcd &)
 
std::unique_ptr< EcalTPGCrystalStatusproduceBadX (const EcalTPGCrystalStatusRcd &)
 
std::unique_ptr< EcalTPGFineGrainEBIdMapproduceFineGrainEB (const EcalTPGFineGrainEBIdMapRcd &)
 
std::unique_ptr< EcalTPGFineGrainEBGroupproduceFineGrainEBGroup (const EcalTPGFineGrainEBGroupRcd &)
 
std::unique_ptr< EcalTPGFineGrainStripEEproduceFineGrainEEstrip (const EcalTPGFineGrainStripEERcd &)
 
std::unique_ptr< EcalTPGFineGrainTowerEEproduceFineGrainEEtower (const EcalTPGFineGrainTowerEERcd &)
 
std::unique_ptr< EcalTPGLinearizationConstproduceLinearizationConst (const EcalTPGLinearizationConstRcd &)
 
std::unique_ptr< EcalTPGLutIdMapproduceLUT (const EcalTPGLutIdMapRcd &)
 
std::unique_ptr< EcalTPGLutGroupproduceLutGroup (const EcalTPGLutGroupRcd &)
 
std::unique_ptr< EcalTPGPedestalsproducePedestals (const EcalTPGPedestalsRcd &)
 
std::unique_ptr< EcalTPGPhysicsConstproducePhysicsConst (const EcalTPGPhysicsConstRcd &)
 
std::unique_ptr< EcalTPGSlidingWindowproduceSlidingWindow (const EcalTPGSlidingWindowRcd &)
 
std::unique_ptr< EcalTPGSpikeproduceSpike (const EcalTPGSpikeRcd &)
 
std::unique_ptr< EcalTPGWeightIdMapproduceWeight (const EcalTPGWeightIdMapRcd &)
 
std::unique_ptr< EcalTPGWeightGroupproduceWeightGroup (const EcalTPGWeightGroupRcd &)
 
 ~EcalTrigPrimESProducer () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Member Functions

std::vector< int > getRange (int subdet, int smNb, int towerNbInSm, int stripNbInTower=0, int xtalNbInStrip=0)
 
void parseTextFile ()
 

Private Attributes

std::string dbFilename_
 
bool flagPrint_
 
std::map< uint32_t, std::vector< uint32_t > > mapFg_
 
std::map< uint32_t, std::vector< uint32_t > > mapLut_
 
std::map< uint32_t, std::vector< float > > mapPhys_
 
std::map< uint32_t, std::vector< uint32_t > > mapStrip_ [2]
 
std::map< uint32_t, std::vector< uint32_t > > mapTower_ [2]
 
std::map< uint32_t, std::vector< uint32_t > > mapWeight_
 
std::map< uint32_t, std::vector< uint32_t > > mapXtal_
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 50 of file EcalTrigPrimESProducer.h.

Constructor & Destructor Documentation

EcalTrigPrimESProducer::EcalTrigPrimESProducer ( const edm::ParameterSet iConfig)

Definition at line 53 of file EcalTrigPrimESProducer.cc.

References produceBadStrip(), produceBadTT(), produceBadX(), produceFineGrainEB(), produceFineGrainEBGroup(), produceFineGrainEEstrip(), produceFineGrainEEtower(), produceLinearizationConst(), produceLUT(), produceLutGroup(), producePedestals(), producePhysicsConst(), produceSlidingWindow(), produceSpike(), produceWeight(), produceWeightGroup(), and edm::ESProducer::setWhatProduced().

54  : dbFilename_(
55  iConfig.getUntrackedParameter<std::string>("DatabaseFile", "")),
56  flagPrint_(iConfig.getParameter<bool>("WriteInFile")) {
57  // the following line is needed to tell the framework what
58  // data is being produced
75  // now do what ever other initialization is needed
76 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< EcalTPGWeightGroup > produceWeightGroup(const EcalTPGWeightGroupRcd &)
std::unique_ptr< EcalTPGCrystalStatus > produceBadX(const EcalTPGCrystalStatusRcd &)
std::unique_ptr< EcalTPGLinearizationConst > produceLinearizationConst(const EcalTPGLinearizationConstRcd &)
std::unique_ptr< EcalTPGFineGrainEBIdMap > produceFineGrainEB(const EcalTPGFineGrainEBIdMapRcd &)
std::unique_ptr< EcalTPGLutIdMap > produceLUT(const EcalTPGLutIdMapRcd &)
std::unique_ptr< EcalTPGTowerStatus > produceBadTT(const EcalTPGTowerStatusRcd &)
std::unique_ptr< EcalTPGPedestals > producePedestals(const EcalTPGPedestalsRcd &)
std::unique_ptr< EcalTPGPhysicsConst > producePhysicsConst(const EcalTPGPhysicsConstRcd &)
std::unique_ptr< EcalTPGFineGrainTowerEE > produceFineGrainEEtower(const EcalTPGFineGrainTowerEERcd &)
std::unique_ptr< EcalTPGSpike > produceSpike(const EcalTPGSpikeRcd &)
std::unique_ptr< EcalTPGSlidingWindow > produceSlidingWindow(const EcalTPGSlidingWindowRcd &)
std::unique_ptr< EcalTPGFineGrainEBGroup > produceFineGrainEBGroup(const EcalTPGFineGrainEBGroupRcd &)
std::unique_ptr< EcalTPGLutGroup > produceLutGroup(const EcalTPGLutGroupRcd &)
std::unique_ptr< EcalTPGFineGrainStripEE > produceFineGrainEEstrip(const EcalTPGFineGrainStripEERcd &)
std::unique_ptr< EcalTPGWeightIdMap > produceWeight(const EcalTPGWeightIdMapRcd &)
std::unique_ptr< EcalTPGStripStatus > produceBadStrip(const EcalTPGStripStatusRcd &)
EcalTrigPrimESProducer::~EcalTrigPrimESProducer ( )
override

Definition at line 78 of file EcalTrigPrimESProducer.cc.

78 {}

Member Function Documentation

std::vector< int > EcalTrigPrimESProducer::getRange ( int  subdet,
int  smNb,
int  towerNbInSm,
int  stripNbInTower = 0,
int  xtalNbInStrip = 0 
)
private

Definition at line 708 of file EcalTrigPrimESProducer.cc.

711  {
712  std::vector<int> range;
713  if (subdet == 0) {
714  // Barrel
715  range.push_back(37); // stccNbMin
716  range.push_back(73); // tccNbMax
717  range.push_back(1); // towerNbMin
718  range.push_back(69); // towerNbMax
719  range.push_back(1); // stripNbMin
720  range.push_back(6); // stripNbMax
721  range.push_back(1); // xtalNbMin
722  range.push_back(6); // xtalNbMax
723  } else {
724  // Endcap eta >0
725  if (subdet > 0) {
726  range.push_back(73); // tccNbMin
727  range.push_back(109); // tccNbMax
728  } else { // endcap eta <0
729  range.push_back(1); // tccNbMin
730  range.push_back(37); // tccNbMax
731  }
732  range.push_back(1); // towerNbMin
733  range.push_back(29); // towerNbMax
734  range.push_back(1); // stripNbMin
735  range.push_back(6); // stripNbMax
736  range.push_back(1); // xtalNbMin
737  range.push_back(6); // xtalNbMax
738  }
739 
740  if (tccNb > 0) {
741  range[0] = tccNb;
742  range[1] = tccNb + 1;
743  }
744  if (towerNbInTcc > 0) {
745  range[2] = towerNbInTcc;
746  range[3] = towerNbInTcc + 1;
747  }
748  if (stripNbInTower > 0) {
749  range[4] = stripNbInTower;
750  range[5] = stripNbInTower + 1;
751  }
752  if (xtalNbInStrip > 0) {
753  range[6] = xtalNbInStrip;
754  range[7] = xtalNbInStrip + 1;
755  }
756 
757  return range;
758 }
void EcalTrigPrimESProducer::parseTextFile ( )
private

Definition at line 324 of file EcalTrigPrimESProducer.cc.

References gather_cfg::cout, data, dbFilename_, TauDecayModes::dec, corrVsCorr::filename, flagPrint_, edm::FileInPath::fullPath(), mps_fire::i, triggerObjects_cff::id, gen::k, mps_splice::line, mapFg_, mapLut_, mapPhys_, mapStrip_, mapTower_, mapWeight_, mapXtal_, pickleFileParser::slash, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceBadTT(), produceBadX(), produceFineGrainEB(), produceFineGrainEBGroup(), produceFineGrainEEstrip(), produceFineGrainEEtower(), produceLinearizationConst(), produceLUT(), produceLutGroup(), producePedestals(), producePhysicsConst(), produceSlidingWindow(), produceSpike(), produceWeight(), and produceWeightGroup().

324  {
325  if (!mapXtal_.empty())
326  return; // just parse the file once!
327 
328  uint32_t id;
329  std::string dataCard;
331  std::ifstream infile;
332  std::vector<unsigned int> param;
333  std::vector<float> paramF;
334  int NBstripparams[2] = {4, 4};
335  unsigned int data;
336  float dataF;
337 
338  std::string bufString;
339  std::string iString;
340  std::string fString;
342  "SimCalorimetry/EcalTrigPrimProducers/data/" + dbFilename_;
343  std::string finalFileName;
344  size_t slash = dbFilename_.find("/");
345  if (slash != 0) {
346  edm::FileInPath fileInPath(filename);
347  finalFileName = fileInPath.fullPath();
348  } else {
349  finalFileName = dbFilename_;
350  edm::LogWarning("EcalTPG") << "Couldnt find database file via fileinpath, "
351  "trying with pathname directly!!";
352  }
353 
354  int k = 0;
355 
356  GzInputStream gis(finalFileName.c_str());
357  while (gis >> dataCard) {
358 
359  if (dataCard == "PHYSICS_EB" || dataCard == "PHYSICS_EE") {
360  gis >> std::dec >> id;
361 
362  if (flagPrint_) {
363  std::cout << dataCard << " " << std::dec << id << std::endl;
364  }
365 
366  paramF.clear();
367 
368  std::string st1;
369  std::string st2;
370 
371  for (int i = 0; i < 7; i++) {
372  gis >> std::dec >> dataF;
373  paramF.push_back(dataF);
374 
375  // std::cout<<", "<<std::dec<<dataF ;
376  if (flagPrint_) {
377  //---------------------------------
378  if (i < 3) {
379  std::ostringstream oss;
380  oss << dataF;
381  std::string result1 = oss.str();
382 
383  st1.append(result1);
384  if (i != 2)
385  st1.append(" ");
386  }
387 
388  if (i > 2) {
389  std::ostringstream oss;
390  oss << dataF;
391  std::string result2 = oss.str();
392 
393  st2.append(result2);
394  if (i != 6)
395  st2.append(" ");
396  }
397  //----------------------------------
398  }
399  }
400 
401  if (flagPrint_) {
402  std::cout << "" << st1 << std::endl;
403  std::cout << "" << st2 << std::endl;
404  std::cout << "" << std::endl;
405  }
406 
407  // std::cout<<std::endl ;
408  mapPhys_[id] = paramF;
409  }
410 
411  if (dataCard == "CRYSTAL") {
412 
413  gis >> std::dec >> id;
414  // std::cout<<dataCard<<" "<<std::dec<<id;
415  std::string st3;
416  std::string st4;
417  std::string st5;
418 
419  if (flagPrint_) {
420  // Print this comment only one time
421  if (k == 0)
422  std::cout << "COMMENT ====== barrel crystals ====== " << std::endl;
423 
424  if (k == 61200)
425  std::cout << "COMMENT ====== endcap crystals ====== " << std::endl;
426 
427  k = k + 1;
428 
429  std::cout << dataCard << " " << std::dec << id << std::endl;
430  }
431 
432  param.clear();
433  for (int i = 0; i < 9; i++) {
434  gis >> std::hex >> data;
435  // std::cout<<", "<<std::hex<<data ;
436  param.push_back(data);
437 
438  if (flagPrint_) {
439  if (i < 3) {
440  std::ostringstream oss;
441  oss << std::hex << data;
442  std::string result1 = oss.str();
443 
444  st3.append("0x");
445  st3.append(result1);
446  if (i != 2)
447  st3.append(" ");
448 
449  } else if (i > 2 && i < 6) {
450  std::ostringstream oss;
451  oss << std::hex << data;
452  std::string result2 = oss.str();
453 
454  st4.append("0x");
455  st4.append(result2);
456  if (i != 5)
457  st4.append(" ");
458  } else if (i > 5 && i < 9) {
459  std::ostringstream oss;
460  oss << std::hex << data;
461  std::string result3 = oss.str();
462 
463  st5.append("0x");
464  st5.append(result3);
465  if (i != 8)
466  st5.append(" ");
467  }
468  }
469 
470  } // end for
471 
472  if (flagPrint_) {
473  std::cout << " " << st3 << std::endl;
474  std::cout << " " << st4 << std::endl;
475  std::cout << " " << st5 << std::endl;
476  }
477 
478  // std::cout<<std::endl ;
479  mapXtal_[id] = param;
480  }
481 
482  if (dataCard == "STRIP_EB") {
483  gis >> std::dec >> id;
484 
485  std::string st1;
486 
487  if (flagPrint_)
488  std::cout << dataCard << " " << std::dec << id << std::endl;
489 
490  param.clear();
491  for (int i = 0; i < NBstripparams[0]; i++) {
492  gis >> std::hex >> data;
493  // std::cout << " data = " << data << std::endl;
494  param.push_back(data);
495 
496  if (flagPrint_) {
497  if (i == 0) {
498  std::cout << "0x" << std::hex << data << std::endl;
499  } else if (i == 1) {
500  std::cout << "" << std::hex << data << std::endl;
501  } else if (i > 1) {
502  std::ostringstream oss;
503  if (i == 2) {
504  oss << "0x" << std::hex << data;
505  std::string result4 = oss.str();
506  st1.append(result4);
507  } else if (i == 3) {
508  std::ostringstream oss;
509  oss << " 0x" << std::hex << data;
510  std::string result5 = oss.str();
511 
512  st1.append(result5);
513  std::cout << "" << st1 << std::endl;
514  }
515  }
516  }
517  }
518 
519  // std::cout<<std::endl ;
520  mapStrip_[0][id] = param;
521  }
522 
523  if (dataCard == "STRIP_EE") {
524  gis >> std::dec >> id;
525 
526  std::string st6;
527 
528  if (flagPrint_) {
529  std::cout << dataCard << " " << std::dec << id << std::endl;
530  }
531 
532  param.clear();
533  for (int i = 0; i < NBstripparams[1]; i++) {
534  gis >> std::hex >> data;
535  param.push_back(data);
536 
537  if (flagPrint_) {
538  if (i == 0) {
539  std::cout << "0x" << std::hex << data << std::endl;
540  } else if (i == 1) {
541  std::cout << " " << std::hex << data << std::endl;
542  } else if (i > 1) {
543  std::ostringstream oss;
544  if (i == 2) {
545  oss << "0x" << std::hex << data;
546  std::string result4 = oss.str();
547  st6.append(result4);
548  } else if (i == 3) {
549  std::ostringstream oss;
550  oss << " 0x" << std::hex << data;
551  std::string result5 = oss.str();
552 
553  st6.append(result5);
554  std::cout << "" << st6 << std::endl;
555  }
556  }
557  }
558  }
559 
560  // std::cout<<std::endl ;
561  mapStrip_[1][id] = param;
562  }
563 
564  if (dataCard == "TOWER_EE") {
565  gis >> std::dec >> id;
566 
567  if (flagPrint_)
568  std::cout << dataCard << " " << std::dec << id << std::endl;
569 
570  param.clear();
571  for (int i = 0; i < 2; i++) {
572  gis >> std::hex >> data;
573  param.push_back(data);
574 
575  if (flagPrint_) {
576  if (i == 1) {
577  std::cout << "0x" << std::dec << data << std::endl;
578  } else {
579  std::cout << " " << std::dec << data << std::endl;
580  }
581  }
582  }
583 
584  // std::cout<<std::endl ;
585  mapTower_[1][id] = param;
586  }
587 
588  if (dataCard == "TOWER_EB") {
589  gis >> std::dec >> id;
590 
591  if (flagPrint_)
592  std::cout << dataCard << " " << std::dec << id << std::endl;
593 
594  param.clear();
595  for (int i = 0; i < 3; i++) {
596  gis >> std::dec >> data;
597 
598  if (flagPrint_) {
599  std::cout << " " << std::dec << data << std::endl;
600  }
601 
602  param.push_back(data);
603  }
604 
605  // std::cout<<std::endl ;
606  mapTower_[0][id] = param;
607  }
608 
609  if (dataCard == "WEIGHT") {
610 
611  if (flagPrint_)
612  std::cout << std::endl;
613 
614  gis >> std::hex >> id;
615  if (flagPrint_) {
616  std::cout << dataCard << " " << std::dec << id << std::endl;
617  }
618 
619  param.clear();
620 
621  std::string st6;
622  for (int i = 0; i < 5; i++) {
623  gis >> std::hex >> data;
624  param.push_back(data);
625 
626  if (flagPrint_) {
627  std::ostringstream oss;
628  oss << std::hex << data;
629  std::string result4 = oss.str();
630 
631  st6.append("0x");
632  st6.append(result4);
633  st6.append(" ");
634  }
635  }
636 
637  if (flagPrint_) {
638  std::cout << st6 << std::endl;
639  std::cout << std::endl;
640  }
641 
642  // std::cout<<std::endl ;
643  mapWeight_[id] = param;
644  }
645 
646  if (dataCard == "FG") {
647 
648  if (flagPrint_)
649  std::cout << std::endl;
650 
651  gis >> std::hex >> id;
652  if (flagPrint_)
653  std::cout << dataCard << " " << std::dec << id << std::endl;
654 
655  param.clear();
656  std::string st7;
657  for (int i = 0; i < 5; i++) {
658  gis >> std::hex >> data;
659  param.push_back(data);
660 
661  if (flagPrint_) {
662  std::ostringstream oss;
663  oss << std::hex << data;
664 
665  std::string result5 = oss.str();
666 
667  st7.append("0x");
668  st7.append(result5);
669  if (i != 4)
670  st7.append(" ");
671  }
672  }
673 
674  if (flagPrint_) {
675  std::cout << st7 << std::endl;
676  std::cout << std::endl;
677  }
678 
679  mapFg_[id] = param;
680  }
681 
682  if (dataCard == "LUT") {
683  gis >> std::hex >> id;
684 
685  if (flagPrint_)
686  std::cout << dataCard << " " << std::dec << id << std::endl;
687 
688  param.clear();
689  for (int i = 0; i < 1024; i++) {
690  gis >> std::hex >> data;
691  param.push_back(data);
692 
693  if (flagPrint_) {
694  std::cout << "0x" << std::hex << data << std::endl;
695  }
696  }
697 
698  if (flagPrint_) {
699  std::cout << std::endl;
700  std::cout << std::endl;
701  }
702 
703  mapLut_[id] = param;
704  }
705  }
706 }
std::map< uint32_t, std::vector< uint32_t > > mapTower_[2]
std::map< uint32_t, std::vector< uint32_t > > mapXtal_
int k[5][pyjets_maxn]
std::map< uint32_t, std::vector< uint32_t > > mapWeight_
std::map< uint32_t, std::vector< uint32_t > > mapFg_
std::map< uint32_t, std::vector< float > > mapPhys_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::map< uint32_t, std::vector< uint32_t > > mapLut_
std::map< uint32_t, std::vector< uint32_t > > mapStrip_[2]
std::unique_ptr< EcalTPGStripStatus > EcalTrigPrimESProducer::produceBadStrip ( const EcalTPGStripStatusRcd iRecord)

Definition at line 287 of file EcalTrigPrimESProducer.cc.

References parseEventContent::prod.

Referenced by EcalTrigPrimESProducer().

287  {
288  auto prod = std::make_unique<EcalTPGStripStatus>();
289  // returns an empty map
290  return prod;
291 }
std::unique_ptr< EcalTPGTowerStatus > EcalTrigPrimESProducer::produceBadTT ( const EcalTPGTowerStatusRcd iRecord)

Definition at line 294 of file EcalTrigPrimESProducer.cc.

References begin, mapTower_, parseTextFile(), and parseEventContent::prod.

Referenced by EcalTrigPrimESProducer().

294  {
295  auto prod = std::make_unique<EcalTPGTowerStatus>();
296  parseTextFile();
297  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
298  // Barrel
299  for (it = mapTower_[0].begin(); it != mapTower_[0].end(); it++) {
300  // set the BadTT status to 0
301  prod->setValue(it->first, 0);
302  }
303  // Endcap
304  for (it = mapTower_[1].begin(); it != mapTower_[1].end(); it++) {
305  // set the BadTT status to 0
306  prod->setValue(it->first, 0);
307  }
308 
309  return prod;
310 }
std::map< uint32_t, std::vector< uint32_t > > mapTower_[2]
#define begin
Definition: vmac.h:32
std::unique_ptr< EcalTPGCrystalStatus > EcalTrigPrimESProducer::produceBadX ( const EcalTPGCrystalStatusRcd iRecord)

Definition at line 273 of file EcalTrigPrimESProducer.cc.

References mapXtal_, parseTextFile(), parseEventContent::prod, and EcalTPGCrystalStatusCode::setStatusCode().

Referenced by EcalTrigPrimESProducer().

273  {
274  auto prod = std::make_unique<EcalTPGCrystalStatus>();
275  parseTextFile();
276  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
277  for (it = mapXtal_.begin(); it != mapXtal_.end(); it++) {
278 
279  EcalTPGCrystalStatusCode badXValue;
280  badXValue.setStatusCode(0);
281  prod->setValue(it->first, badXValue);
282  }
283  return prod;
284 }
void setStatusCode(const uint16_t &val)
std::map< uint32_t, std::vector< uint32_t > > mapXtal_
std::unique_ptr< EcalTPGFineGrainEBIdMap > EcalTrigPrimESProducer::produceFineGrainEB ( const EcalTPGFineGrainEBIdMapRcd iRecord)

Definition at line 135 of file EcalTrigPrimESProducer.cc.

References mapFg_, parseTextFile(), parseEventContent::prod, and EcalTPGFineGrainConstEB::setValues().

Referenced by EcalTrigPrimESProducer().

136  {
137  auto prod = std::make_unique<EcalTPGFineGrainEBIdMap>();
138  parseTextFile();
140  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
141  for (it = mapFg_.begin(); it != mapFg_.end(); it++) {
142  fg.setValues((it->second)[0], (it->second)[1], (it->second)[2],
143  (it->second)[3], (it->second)[4]);
144  prod->setValue(it->first, fg);
145  }
146  return prod;
147 }
void setValues(const uint32_t &ThresholdETLow, const uint32_t &ThresholdETHigh, const uint32_t &RatioLow, const uint32_t &RatioHigh, const uint32_t &LUT)
std::map< uint32_t, std::vector< uint32_t > > mapFg_
std::unique_ptr< EcalTPGFineGrainEBGroup > EcalTrigPrimESProducer::produceFineGrainEBGroup ( const EcalTPGFineGrainEBGroupRcd iRecord)

Definition at line 241 of file EcalTrigPrimESProducer.cc.

References begin, mapTower_, parseTextFile(), and parseEventContent::prod.

Referenced by EcalTrigPrimESProducer().

242  {
243  auto prod = std::make_unique<EcalTPGFineGrainEBGroup>();
244  parseTextFile();
245  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
246  for (it = mapTower_[0].begin(); it != mapTower_[0].end(); it++) {
247  prod->setValue(it->first, (it->second)[1]);
248  }
249  return prod;
250 }
std::map< uint32_t, std::vector< uint32_t > > mapTower_[2]
#define begin
Definition: vmac.h:32
std::unique_ptr< EcalTPGFineGrainStripEE > EcalTrigPrimESProducer::produceFineGrainEEstrip ( const EcalTPGFineGrainStripEERcd iRecord)

Definition at line 150 of file EcalTrigPrimESProducer.cc.

References begin, EcalTPGFineGrainStripEE::Item::lut, mapStrip_, parseTextFile(), parseEventContent::prod, and EcalTPGFineGrainStripEE::Item::threshold.

Referenced by EcalTrigPrimESProducer().

151  {
152  auto prod = std::make_unique<EcalTPGFineGrainStripEE>();
153  parseTextFile();
154  // EE Strips
155  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
156  for (it = mapStrip_[1].begin(); it != mapStrip_[1].end(); it++) {
158  item.threshold = (it->second)[2];
159  item.lut = (it->second)[3];
160  prod->setValue(it->first, item);
161  }
162  // EB Strips
163  for (it = mapStrip_[0].begin(); it != mapStrip_[0].end(); it++) {
165  item.threshold = (it->second)[2];
166  item.lut = (it->second)[3];
167  prod->setValue(it->first, item);
168  }
169  return prod;
170 }
#define begin
Definition: vmac.h:32
std::map< uint32_t, std::vector< uint32_t > > mapStrip_[2]
std::unique_ptr< EcalTPGFineGrainTowerEE > EcalTrigPrimESProducer::produceFineGrainEEtower ( const EcalTPGFineGrainTowerEERcd iRecord)

Definition at line 173 of file EcalTrigPrimESProducer.cc.

References begin, mapTower_, parseTextFile(), and parseEventContent::prod.

Referenced by EcalTrigPrimESProducer().

174  {
175  auto prod = std::make_unique<EcalTPGFineGrainTowerEE>();
176  parseTextFile();
177  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
178  for (it = mapTower_[1].begin(); it != mapTower_[1].end(); it++) {
179  prod->setValue(it->first, (it->second)[1]);
180  }
181  return prod;
182 }
std::map< uint32_t, std::vector< uint32_t > > mapTower_[2]
#define begin
Definition: vmac.h:32
std::unique_ptr< EcalTPGLinearizationConst > EcalTrigPrimESProducer::produceLinearizationConst ( const EcalTPGLinearizationConstRcd iRecord)

Definition at line 102 of file EcalTrigPrimESProducer.cc.

References mapXtal_, EcalTPGLinearizationConstant::mult_x1, EcalTPGLinearizationConstant::mult_x12, EcalTPGLinearizationConstant::mult_x6, parseTextFile(), parseEventContent::prod, EcalTPGLinearizationConstant::shift_x1, EcalTPGLinearizationConstant::shift_x12, and EcalTPGLinearizationConstant::shift_x6.

Referenced by EcalTrigPrimESProducer().

103  {
104  auto prod = std::make_unique<EcalTPGLinearizationConst>();
105  parseTextFile();
106  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
107  for (it = mapXtal_.begin(); it != mapXtal_.end(); it++) {
109  item.mult_x12 = (it->second)[1];
110  item.mult_x6 = (it->second)[4];
111  item.mult_x1 = (it->second)[7];
112  item.shift_x12 = (it->second)[2];
113  item.shift_x6 = (it->second)[5];
114  item.shift_x1 = (it->second)[8];
115  prod->setValue(it->first, item);
116  }
117  return prod;
118 }
std::map< uint32_t, std::vector< uint32_t > > mapXtal_
std::unique_ptr< EcalTPGLutIdMap > EcalTrigPrimESProducer::produceLUT ( const EcalTPGLutIdMapRcd iRecord)

Definition at line 185 of file EcalTrigPrimESProducer.cc.

References mps_fire::i, lumiPlot::lut, mapLut_, parseTextFile(), parseEventContent::prod, and EcalTPGLut::setLut().

Referenced by EcalTrigPrimESProducer().

185  {
186  auto prod = std::make_unique<EcalTPGLutIdMap>();
187  parseTextFile();
188  EcalTPGLut lut;
189  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
190  for (it = mapLut_.begin(); it != mapLut_.end(); it++) {
191  unsigned int lutArray[1024];
192  for (int i = 0; i < 1024; i++)
193  lutArray[i] = (it->second)[i];
194  lut.setLut(lutArray);
195  prod->setValue(it->first, lut);
196  }
197  return prod;
198 }
void setLut(const unsigned int *lut)
Definition: EcalTPGLut.cc:20
std::map< uint32_t, std::vector< uint32_t > > mapLut_
std::unique_ptr< EcalTPGLutGroup > EcalTrigPrimESProducer::produceLutGroup ( const EcalTPGLutGroupRcd iRecord)

Definition at line 228 of file EcalTrigPrimESProducer.cc.

References begin, mapTower_, parseTextFile(), and parseEventContent::prod.

Referenced by EcalTrigPrimESProducer().

228  {
229  auto prod = std::make_unique<EcalTPGLutGroup>();
230  parseTextFile();
231  for (int subdet = 0; subdet < 2; subdet++) {
232  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
233  for (it = mapTower_[subdet].begin(); it != mapTower_[subdet].end(); it++) {
234  prod->setValue(it->first, (it->second)[0]);
235  }
236  }
237  return prod;
238 }
std::map< uint32_t, std::vector< uint32_t > > mapTower_[2]
#define begin
Definition: vmac.h:32
std::unique_ptr< EcalTPGPedestals > EcalTrigPrimESProducer::producePedestals ( const EcalTPGPedestalsRcd iRecord)

Definition at line 87 of file EcalTrigPrimESProducer.cc.

References mapXtal_, EcalTPGPedestal::mean_x1, EcalTPGPedestal::mean_x12, EcalTPGPedestal::mean_x6, parseTextFile(), and parseEventContent::prod.

Referenced by EcalTrigPrimESProducer().

87  {
88  auto prod = std::make_unique<EcalTPGPedestals>();
89  parseTextFile();
90  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
91  for (it = mapXtal_.begin(); it != mapXtal_.end(); it++) {
92  EcalTPGPedestal item;
93  item.mean_x12 = (it->second)[0];
94  item.mean_x6 = (it->second)[3];
95  item.mean_x1 = (it->second)[6];
96  prod->setValue(it->first, item);
97  }
98  return prod;
99 }
std::map< uint32_t, std::vector< uint32_t > > mapXtal_
std::unique_ptr< EcalTPGPhysicsConst > EcalTrigPrimESProducer::producePhysicsConst ( const EcalTPGPhysicsConstRcd iRecord)

Definition at line 253 of file EcalTrigPrimESProducer.cc.

References EcalTPGPhysicsConst::Item::EtSat, EcalTPGPhysicsConst::Item::FG_highRatio, EcalTPGPhysicsConst::Item::FG_highThreshold, EcalTPGPhysicsConst::Item::FG_lowRatio, EcalTPGPhysicsConst::Item::FG_lowThreshold, mapPhys_, parseTextFile(), parseEventContent::prod, EcalTPGPhysicsConst::Item::ttf_threshold_High, and EcalTPGPhysicsConst::Item::ttf_threshold_Low.

Referenced by EcalTrigPrimESProducer().

254  {
255  auto prod = std::make_unique<EcalTPGPhysicsConst>();
256  parseTextFile();
257  std::map<uint32_t, std::vector<float>>::const_iterator it;
258  for (it = mapPhys_.begin(); it != mapPhys_.end(); it++) {
260  item.EtSat = (it->second)[0];
261  item.ttf_threshold_Low = (it->second)[1];
262  item.ttf_threshold_High = (it->second)[2];
263  item.FG_lowThreshold = (it->second)[3];
264  item.FG_highThreshold = (it->second)[4];
265  item.FG_lowRatio = (it->second)[5];
266  item.FG_highRatio = (it->second)[6];
267  prod->setValue(it->first, item);
268  }
269  return prod;
270 }
std::map< uint32_t, std::vector< float > > mapPhys_
std::unique_ptr< EcalTPGSlidingWindow > EcalTrigPrimESProducer::produceSlidingWindow ( const EcalTPGSlidingWindowRcd iRecord)

Definition at line 121 of file EcalTrigPrimESProducer.cc.

References begin, mapStrip_, parseTextFile(), and parseEventContent::prod.

Referenced by EcalTrigPrimESProducer().

122  {
123  auto prod = std::make_unique<EcalTPGSlidingWindow>();
124  parseTextFile();
125  for (int subdet = 0; subdet < 2; subdet++) {
126  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
127  for (it = mapStrip_[subdet].begin(); it != mapStrip_[subdet].end(); it++) {
128  prod->setValue(it->first, (it->second)[0]);
129  }
130  }
131  return prod;
132 }
#define begin
Definition: vmac.h:32
std::map< uint32_t, std::vector< uint32_t > > mapStrip_[2]
std::unique_ptr< EcalTPGSpike > EcalTrigPrimESProducer::produceSpike ( const EcalTPGSpikeRcd iRecord)

Definition at line 313 of file EcalTrigPrimESProducer.cc.

References begin, mapTower_, parseTextFile(), and parseEventContent::prod.

Referenced by EcalTrigPrimESProducer().

313  {
314  auto prod = std::make_unique<EcalTPGSpike>();
315  parseTextFile();
316  // Only need to do barrel
317  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
318  for (it = mapTower_[0].begin(); it != mapTower_[0].end(); ++it) {
319  prod->setValue(it->first, (it->second)[2]);
320  }
321  return prod;
322 }
std::map< uint32_t, std::vector< uint32_t > > mapTower_[2]
#define begin
Definition: vmac.h:32
std::unique_ptr< EcalTPGWeightIdMap > EcalTrigPrimESProducer::produceWeight ( const EcalTPGWeightIdMapRcd iRecord)

Definition at line 201 of file EcalTrigPrimESProducer.cc.

References mapWeight_, parseTextFile(), parseEventContent::prod, EcalTPGWeights::setValues(), and HGCalRecHit_cfi::weights.

Referenced by EcalTrigPrimESProducer().

201  {
202  auto prod = std::make_unique<EcalTPGWeightIdMap>();
203  parseTextFile();
205  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
206  for (it = mapWeight_.begin(); it != mapWeight_.end(); it++) {
207  weights.setValues((it->second)[0], (it->second)[1], (it->second)[2],
208  (it->second)[3], (it->second)[4]);
209  prod->setValue(it->first, weights);
210  }
211  return prod;
212 }
std::map< uint32_t, std::vector< uint32_t > > mapWeight_
void setValues(const uint32_t &w0, const uint32_t &w1, const uint32_t &w2, const uint32_t &w3, const uint32_t &w4)
std::unique_ptr< EcalTPGWeightGroup > EcalTrigPrimESProducer::produceWeightGroup ( const EcalTPGWeightGroupRcd iRecord)

Definition at line 214 of file EcalTrigPrimESProducer.cc.

References begin, mapStrip_, parseTextFile(), and parseEventContent::prod.

Referenced by EcalTrigPrimESProducer().

215  {
216  auto prod = std::make_unique<EcalTPGWeightGroup>();
217  parseTextFile();
218  for (int subdet = 0; subdet < 2; subdet++) {
219  std::map<uint32_t, std::vector<uint32_t>>::const_iterator it;
220  for (it = mapStrip_[subdet].begin(); it != mapStrip_[subdet].end(); it++) {
221  prod->setValue(it->first, (it->second)[1]);
222  }
223  }
224  return prod;
225 }
#define begin
Definition: vmac.h:32
std::map< uint32_t, std::vector< uint32_t > > mapStrip_[2]

Member Data Documentation

std::string EcalTrigPrimESProducer::dbFilename_
private

Definition at line 91 of file EcalTrigPrimESProducer.h.

Referenced by parseTextFile().

bool EcalTrigPrimESProducer::flagPrint_
private

Definition at line 92 of file EcalTrigPrimESProducer.h.

Referenced by parseTextFile().

std::map<uint32_t, std::vector<uint32_t> > EcalTrigPrimESProducer::mapFg_
private

Definition at line 97 of file EcalTrigPrimESProducer.h.

Referenced by parseTextFile(), and produceFineGrainEB().

std::map<uint32_t, std::vector<uint32_t> > EcalTrigPrimESProducer::mapLut_
private

Definition at line 98 of file EcalTrigPrimESProducer.h.

Referenced by parseTextFile(), and produceLUT().

std::map<uint32_t, std::vector<float> > EcalTrigPrimESProducer::mapPhys_
private

Definition at line 99 of file EcalTrigPrimESProducer.h.

Referenced by parseTextFile(), and producePhysicsConst().

std::map<uint32_t, std::vector<uint32_t> > EcalTrigPrimESProducer::mapStrip_[2]
private
std::map<uint32_t, std::vector<uint32_t> > EcalTrigPrimESProducer::mapTower_[2]
private
std::map<uint32_t, std::vector<uint32_t> > EcalTrigPrimESProducer::mapWeight_
private

Definition at line 96 of file EcalTrigPrimESProducer.h.

Referenced by parseTextFile(), and produceWeight().

std::map<uint32_t, std::vector<uint32_t> > EcalTrigPrimESProducer::mapXtal_
private