CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
L1RCTProducer Class Reference

#include <L1RCTProducer.h>

Inheritance diagram for L1RCTProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, const edm::EventSetup &context) final
 
void beginRun (edm::Run const &r, const edm::EventSetup &c) final
 
 L1RCTProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &c) final
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Types

enum  crateSection {
  c_min, ebOddFed = c_min, ebEvenFed, eeFed,
  hbheFed, hfFed, hfFedUp, c_max = hfFedUp
}
 

Private Member Functions

const std::vector< int > getFedVectorFromOmds (const edm::EventSetup &) const
 
const std::vector< int > getFedVectorFromRunInfo (const edm::ESGetToken< RunInfo, RunInfoRcd > &, const edm::EventSetup &) const
 
void printFedVector (const std::vector< int > &)
 
void printUpdatedFedMask ()
 
void printUpdatedFedMaskVerbose ()
 
void updateConfiguration (const edm::EventSetup &)
 
void updateFedVector (const L1RCTChannelMask &, const L1RCTNoisyChannelMask &, const std::vector< int > &Feds)
 

Private Attributes

edm::ESGetToken< L1RCTChannelMask, L1RCTChannelMaskRcdbeginLumiChannelMaskToken_
 
edm::ESGetToken< L1RCTNoisyChannelMask, L1RCTNoisyChannelMaskRcdbeginLumiHotChannelMaskToken_
 
edm::ESGetToken< RunInfo, RunInfoRcdbeginLumiRunInfoToken_
 
const edm::ESGetToken< L1RCTChannelMask, L1RCTChannelMaskRcdbeginRunChannelMaskToken_
 
const edm::ESGetToken< L1RCTNoisyChannelMask, L1RCTNoisyChannelMaskRcdbeginRunHotChannelMaskToken_
 
const edm::ESGetToken< RunInfo, RunInfoRcdbeginRunRunInfoToken_
 
std::vector< int > bunchCrossings
 
std::string conditionsLabel
 
std::vector< edm::InputTagecalDigis
 
const edm::ESGetToken< L1CaloEcalScale, L1CaloEcalScaleRcdecalScaleToken_
 
const edm::ESGetToken< L1CaloEtScale, L1EmEtScaleRcdemScaleToken_
 
std::unique_ptr< L1RCTChannelMaskfedUpdatedMask
 
bool getFedsFromOmds
 
std::vector< edm::InputTaghcalDigis
 
const edm::ESGetToken< L1CaloHcalScale, L1CaloHcalScaleRcdhcalScaleToken_
 
edm::ESGetToken< RunInfo, RunInfoRcdomdsRunInfoToken_
 
unsigned int queryDelayInLS
 
unsigned int queryIntervalInLS
 
std::unique_ptr< L1RCTrct
 
std::unique_ptr< L1RCTLookupTablesrctLookupTables
 
const edm::ESGetToken< L1RCTParameters, L1RCTParametersRcdrctParamsToken_
 
bool useEcal
 
bool useHcal
 

Static Private Attributes

static constexpr int maxBarrel = 17
 
static constexpr int maxEndcap = 28
 
static constexpr int maxHF = 32
 
static constexpr int minBarrel = 1
 
static constexpr int minEndcap = 17
 
static constexpr int minHF = 29
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 45 of file L1RCTProducer.h.

Member Enumeration Documentation

◆ crateSection

Constructor & Destructor Documentation

◆ L1RCTProducer()

L1RCTProducer::L1RCTProducer ( const edm::ParameterSet ps)
explicit

Definition at line 34 of file L1RCTProducer.cc.

References beginLumiChannelMaskToken_, beginLumiHotChannelMaskToken_, beginLumiRunInfoToken_, ecalDigis, getFedsFromOmds, hcalDigis, and omdsRunInfoToken_.

36  rct(new L1RCT(rctLookupTables.get())),
37  useEcal(conf.getParameter<bool>("useEcal")),
38  useHcal(conf.getParameter<bool>("useHcal")),
39  ecalDigis(conf.getParameter<std::vector<edm::InputTag>>("ecalDigis")),
40  hcalDigis(conf.getParameter<std::vector<edm::InputTag>>("hcalDigis")),
41  bunchCrossings(conf.getParameter<std::vector<int>>("BunchCrossings")),
42  getFedsFromOmds(conf.getParameter<bool>("getFedsFromOmds")),
43  queryDelayInLS(conf.getParameter<unsigned int>("queryDelayInLS")),
44  queryIntervalInLS(conf.getParameter<unsigned int>("queryIntervalInLS")),
45  conditionsLabel(conf.getParameter<std::string>("conditionsLabel")),
46  fedUpdatedMask(nullptr),
47 
48  rctParamsToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", conditionsLabel))),
49  emScaleToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", conditionsLabel))),
50  ecalScaleToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", conditionsLabel))),
51  hcalScaleToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", conditionsLabel))),
52 
53  beginRunRunInfoToken_(esConsumes<edm::Transition::BeginRun>()),
54 
55  beginRunChannelMaskToken_(esConsumes<edm::Transition::BeginRun>()),
56  beginRunHotChannelMaskToken_(esConsumes<edm::Transition::BeginRun>()) {
57  produces<L1CaloEmCollection>();
58  produces<L1CaloRegionCollection>();
59 
60  if (getFedsFromOmds) {
61  beginLumiChannelMaskToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>();
62  beginLumiHotChannelMaskToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>();
63  beginLumiRunInfoToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>();
64  omdsRunInfoToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>(edm::ESInputTag("", "OmdsFedVector"));
65  }
66 
67  for (unsigned int ihc = 0; ihc < hcalDigis.size(); ihc++) {
68  consumes<edm::SortedCollection<HcalTriggerPrimitiveDigi, edm::StrictWeakOrdering<HcalTriggerPrimitiveDigi>>>(
69  hcalDigis[ihc]);
70  }
71 
72  for (unsigned int iec = 0; iec < ecalDigis.size(); iec++) {
73  consumes<edm::SortedCollection<EcalTriggerPrimitiveDigi, edm::StrictWeakOrdering<EcalTriggerPrimitiveDigi>>>(
74  ecalDigis[iec]);
75  }
76 }
edm::ESGetToken< RunInfo, RunInfoRcd > beginLumiRunInfoToken_
Definition: L1RCTProducer.h:88
std::unique_ptr< L1RCT > rct
Definition: L1RCTProducer.h:66
const edm::ESGetToken< RunInfo, RunInfoRcd > beginRunRunInfoToken_
Definition: L1RCTProducer.h:87
const edm::ESGetToken< L1CaloEcalScale, L1CaloEcalScaleRcd > ecalScaleToken_
Definition: L1RCTProducer.h:83
std::string conditionsLabel
Definition: L1RCTProducer.h:75
edm::ESGetToken< L1RCTNoisyChannelMask, L1RCTNoisyChannelMaskRcd > beginLumiHotChannelMaskToken_
Definition: L1RCTProducer.h:97
unsigned int queryDelayInLS
Definition: L1RCTProducer.h:73
std::unique_ptr< L1RCTLookupTables > rctLookupTables
Definition: L1RCTProducer.h:65
std::unique_ptr< L1RCTChannelMask > fedUpdatedMask
Definition: L1RCTProducer.h:78
const edm::ESGetToken< L1CaloHcalScale, L1CaloHcalScaleRcd > hcalScaleToken_
Definition: L1RCTProducer.h:84
const edm::ESGetToken< L1RCTChannelMask, L1RCTChannelMaskRcd > beginRunChannelMaskToken_
Definition: L1RCTProducer.h:92
bool getFedsFromOmds
Definition: L1RCTProducer.h:72
std::vector< edm::InputTag > hcalDigis
Definition: L1RCTProducer.h:70
std::vector< edm::InputTag > ecalDigis
Definition: L1RCTProducer.h:69
std::vector< int > bunchCrossings
Definition: L1RCTProducer.h:71
const edm::ESGetToken< L1CaloEtScale, L1EmEtScaleRcd > emScaleToken_
Definition: L1RCTProducer.h:82
const edm::ESGetToken< L1RCTNoisyChannelMask, L1RCTNoisyChannelMaskRcd > beginRunHotChannelMaskToken_
Definition: L1RCTProducer.h:93
unsigned int queryIntervalInLS
Definition: L1RCTProducer.h:74
const edm::ESGetToken< L1RCTParameters, L1RCTParametersRcd > rctParamsToken_
Definition: L1RCTProducer.h:81
edm::ESGetToken< RunInfo, RunInfoRcd > omdsRunInfoToken_
Definition: L1RCTProducer.h:89
edm::ESGetToken< L1RCTChannelMask, L1RCTChannelMaskRcd > beginLumiChannelMaskToken_
Definition: L1RCTProducer.h:96
Definition: L1RCT.h:20

Member Function Documentation

◆ beginLuminosityBlock()

void L1RCTProducer::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
const edm::EventSetup context 
)
final

Definition at line 92 of file L1RCTProducer.cc.

References beginLumiChannelMaskToken_, beginLumiHotChannelMaskToken_, visDQMUpload::context, getFedsFromOmds, getFedVectorFromOmds(), edm::LuminosityBlockBase::luminosityBlock(), queryDelayInLS, queryIntervalInLS, and updateFedVector().

92  {
93  // check LS number every LS, if the checkOMDS flag is set AND it's the right
94  // LS, update the FED vector from OMDS can pass the flag as the bool?? but
95  // only check LS number if flag is true anyhow
96  if (getFedsFromOmds) {
97  unsigned int nLumi = lumiSeg.luminosityBlock(); // doesn't even need the (unsigned int) cast
98  // because LuminosityBlockNumber_t is already
99  // an unsigned int
100  // LS count starts at 1, want to be able to delay 0 LS's intuitively
101  if (((nLumi - 1) == queryDelayInLS) ||
102  (queryIntervalInLS > 0 &&
103  nLumi % queryIntervalInLS == 0)) // to guard against problems if online DQM crashes; every 100
104  // LS is ~20-30 minutes, not too big a load, hopefully not too
105  // long between
106  {
107  // std::cout << "Lumi section for this FED vector update is " <<
108  // nLumi << std::endl;
109 
110  // list of RCT channels to mask
111  L1RCTChannelMask const &channelMask = context.getData(beginLumiChannelMaskToken_);
112 
113  // list of Noisy RCT channels to mask
114  L1RCTNoisyChannelMask const &hotChannelMask = context.getData(beginLumiHotChannelMaskToken_);
115 
116  updateFedVector(channelMask, hotChannelMask, getFedVectorFromOmds(context));
117  } else if (queryIntervalInLS <= 0) {
118  // don't do interval checking... cout message??
119  }
120  }
121 }
void updateFedVector(const L1RCTChannelMask &, const L1RCTNoisyChannelMask &, const std::vector< int > &Feds)
edm::ESGetToken< L1RCTNoisyChannelMask, L1RCTNoisyChannelMaskRcd > beginLumiHotChannelMaskToken_
Definition: L1RCTProducer.h:97
unsigned int queryDelayInLS
Definition: L1RCTProducer.h:73
bool getFedsFromOmds
Definition: L1RCTProducer.h:72
unsigned int queryIntervalInLS
Definition: L1RCTProducer.h:74
const std::vector< int > getFedVectorFromOmds(const edm::EventSetup &) const
edm::ESGetToken< L1RCTChannelMask, L1RCTChannelMaskRcd > beginLumiChannelMaskToken_
Definition: L1RCTProducer.h:96

◆ beginRun()

void L1RCTProducer::beginRun ( edm::Run const &  r,
const edm::EventSetup c 
)
final

Definition at line 78 of file L1RCTProducer.cc.

References beginRunChannelMaskToken_, beginRunHotChannelMaskToken_, beginRunRunInfoToken_, options_cfi::eventSetup, getFedVectorFromRunInfo(), updateConfiguration(), and updateFedVector().

78  {
79  // std::cout << "getFedsFromOmds is " << getFedsFromOmds << std::endl;
80 
82 
83  // list of RCT channels to mask
84  L1RCTChannelMask const &channelMask = eventSetup.getData(beginRunChannelMaskToken_);
85 
86  // list of Noisy RCT channels to mask
87  L1RCTNoisyChannelMask const &hotChannelMask = eventSetup.getData(beginRunHotChannelMaskToken_);
88 
90 }
const edm::ESGetToken< RunInfo, RunInfoRcd > beginRunRunInfoToken_
Definition: L1RCTProducer.h:87
void updateFedVector(const L1RCTChannelMask &, const L1RCTNoisyChannelMask &, const std::vector< int > &Feds)
const std::vector< int > getFedVectorFromRunInfo(const edm::ESGetToken< RunInfo, RunInfoRcd > &, const edm::EventSetup &) const
void updateConfiguration(const edm::EventSetup &)
const edm::ESGetToken< L1RCTChannelMask, L1RCTChannelMaskRcd > beginRunChannelMaskToken_
Definition: L1RCTProducer.h:92
const edm::ESGetToken< L1RCTNoisyChannelMask, L1RCTNoisyChannelMaskRcd > beginRunHotChannelMaskToken_
Definition: L1RCTProducer.h:93

◆ getFedVectorFromOmds()

const std::vector< int > L1RCTProducer::getFedVectorFromOmds ( const edm::EventSetup eventSetup) const
private

Definition at line 301 of file L1RCTProducer.cc.

References beginLumiRunInfoToken_, options_cfi::eventSetup, getFedVectorFromRunInfo(), edm::ESHandleBase::isValid(), RunInfo::m_fed_in, and omdsRunInfoToken_.

Referenced by beginLuminosityBlock().

301  {
302  // std::cout << "Getting FED vector from my specific ES RunInfo object" <<
303  // std::endl;
304 
305  // get FULL FED vector from RunInfo object specifically created to have OMDS
306  // fed vector
308  if (sum.isValid()) {
309  return sum->m_fed_in;
310  } else {
312  }
313 }
edm::ESGetToken< RunInfo, RunInfoRcd > beginLumiRunInfoToken_
Definition: L1RCTProducer.h:88
const std::vector< int > getFedVectorFromRunInfo(const edm::ESGetToken< RunInfo, RunInfoRcd > &, const edm::EventSetup &) const
std::vector< int > m_fed_in
Definition: RunInfo.h:25
bool isValid() const
Definition: ESHandle.h:44
edm::ESGetToken< RunInfo, RunInfoRcd > omdsRunInfoToken_
Definition: L1RCTProducer.h:89

◆ getFedVectorFromRunInfo()

const std::vector< int > L1RCTProducer::getFedVectorFromRunInfo ( const edm::ESGetToken< RunInfo, RunInfoRcd > &  token,
const edm::EventSetup eventSetup 
) const
private

Definition at line 293 of file L1RCTProducer.cc.

References options_cfi::eventSetup, and unpackBuffers-CaloStage2::token.

Referenced by beginRun(), and getFedVectorFromOmds().

294  {
295  // std::cout << "Getting FED vector from standard RunInfo object" <<
296  // std::endl;
297  // get FULL FED vector from RUNINFO
298  return eventSetup.getData(token).m_fed_in;
299 }

◆ printFedVector()

void L1RCTProducer::printFedVector ( const std::vector< int > &  fedVector)
private

Definition at line 371 of file L1RCTProducer.cc.

References filterCSVwithJSON::copy, and gather_cfg::cout.

371  {
372  std::cout << "Contents of given fedVector: ";
373  std::copy(fedVector.begin(), fedVector.end(), std::ostream_iterator<int>(std::cout, ", "));
374  std::cout << std::endl;
375 }

◆ printUpdatedFedMask()

void L1RCTProducer::printUpdatedFedMask ( )
private

Definition at line 378 of file L1RCTProducer.cc.

References gather_cfg::cout, and fedUpdatedMask.

378  {
379  if (fedUpdatedMask != nullptr) {
380  fedUpdatedMask->print(std::cout);
381  } else {
382  std::cout << "Trying to print contents of fedUpdatedMask, but it doesn't exist!" << std::endl;
383  }
384 }
std::unique_ptr< L1RCTChannelMask > fedUpdatedMask
Definition: L1RCTProducer.h:78

◆ printUpdatedFedMaskVerbose()

void L1RCTProducer::printUpdatedFedMaskVerbose ( )
private

Definition at line 387 of file L1RCTProducer.cc.

References gather_cfg::cout, fedUpdatedMask, mps_fire::i, dqmiolumiharvest::j, and dqmdumpme::k.

387  {
388  if (fedUpdatedMask != nullptr) {
389  // print contents of fedvector
390  std::cout << "Contents of fedUpdatedMask: ";
391  // std::copy(fedUpdatedMask.begin(), fedUpdatedMask.end(),
392  // std::ostream_iterator<int>(std::cout, ", "));
393  std::cout << "--> ECAL mask: " << std::endl;
394  for (int i = 0; i < 18; i++) {
395  for (int j = 0; j < 2; j++) {
396  for (int k = 0; k < 28; k++) {
397  std::cout << fedUpdatedMask->ecalMask[i][j][k] << ", ";
398  }
399  }
400  }
401  std::cout << "--> HCAL mask: " << std::endl;
402  for (int i = 0; i < 18; i++) {
403  for (int j = 0; j < 2; j++) {
404  for (int k = 0; k < 28; k++) {
405  std::cout << fedUpdatedMask->hcalMask[i][j][k] << ", ";
406  }
407  }
408  }
409  std::cout << "--> HF mask: " << std::endl;
410  for (int i = 0; i < 18; i++) {
411  for (int j = 0; j < 2; j++) {
412  for (int k = 0; k < 4; k++) {
413  std::cout << fedUpdatedMask->hfMask[i][j][k] << ", ";
414  }
415  }
416  }
417 
418  std::cout << std::endl;
419  } else {
420  // print error message
421  std::cout << "Trying to print contents of fedUpdatedMask, but it doesn't exist!" << std::endl;
422  }
423 }
std::unique_ptr< L1RCTChannelMask > fedUpdatedMask
Definition: L1RCTProducer.h:78

◆ produce()

void L1RCTProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
final

Definition at line 315 of file L1RCTProducer.cc.

References bunchCrossings, bsc_activity_cfg::ecal, ecalDigis, Exception, hltEgammaHLTExtra_cfi::hcal, hcalDigis, mps_fire::i, dqmiolumiharvest::j, eostools::move(), rct, ecalGpuTask_cfi::sample, useEcal, and useHcal.

315  {
316  std::unique_ptr<L1CaloEmCollection> rctEmCands(new L1CaloEmCollection);
317  std::unique_ptr<L1CaloRegionCollection> rctRegions(new L1CaloRegionCollection);
318 
319  if (!(ecalDigis.size() == hcalDigis.size() && hcalDigis.size() == bunchCrossings.size()))
320  throw cms::Exception("BadInput") << "From what I see the number of your your ECAL input digi "
321  "collections.\n"
322  << "is different from the size of your HCAL digi input collections\n"
323  << "or the size of your BX factor collection"
324  << "They must be the same to correspond to the same Bxs\n"
325  << "It does not matter if one of them is empty\n";
326 
327  // loop through and process each bx
328  for (unsigned short sample = 0; sample < bunchCrossings.size(); sample++) {
331 
334 
335  if (useHcal && event.getByLabel(hcalDigis[sample], hcal))
336  hcalIn = *hcal;
337 
338  if (useEcal && event.getByLabel(ecalDigis[sample], ecal))
339  ecalIn = *ecal;
340 
341  rct->digiInput(ecalIn, hcalIn);
342  rct->processEvent();
343 
344  // Stuff to create
345  for (int j = 0; j < 18; j++) {
346  L1CaloEmCollection isolatedEGObjects = rct->getIsolatedEGObjects(j);
347  L1CaloEmCollection nonisolatedEGObjects = rct->getNonisolatedEGObjects(j);
348  for (int i = 0; i < 4; i++) {
349  isolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
350  nonisolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
351  rctEmCands->push_back(isolatedEGObjects.at(i));
352  rctEmCands->push_back(nonisolatedEGObjects.at(i));
353  }
354  }
355 
356  for (int i = 0; i < 18; i++) {
357  std::vector<L1CaloRegion> regions = rct->getRegions(i);
358  for (int j = 0; j < 22; j++) {
359  regions.at(j).setBx(bunchCrossings[sample]);
360  rctRegions->push_back(regions.at(j));
361  }
362  }
363  }
364 
365  // putting stuff back into event
366  event.put(std::move(rctEmCands));
367  event.put(std::move(rctRegions));
368 }
std::unique_ptr< L1RCT > rct
Definition: L1RCTProducer.h:66
std::vector< L1CaloEmCand > L1CaloEmCollection
std::vector< edm::InputTag > hcalDigis
Definition: L1RCTProducer.h:70
std::vector< edm::InputTag > ecalDigis
Definition: L1RCTProducer.h:69
std::vector< int > bunchCrossings
Definition: L1RCTProducer.h:71
std::vector< L1CaloRegion > L1CaloRegionCollection
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1

◆ updateConfiguration()

void L1RCTProducer::updateConfiguration ( const edm::EventSetup eventSetup)
private

Definition at line 123 of file L1RCTProducer.cc.

References MillePedeFileConverter_cfg::e, ecalScaleToken_, emScaleToken_, options_cfi::eventSetup, h, hcalScaleToken_, alignCSCRings::r, rctLookupTables, rctParamsToken_, and alignCSCRings::s.

Referenced by beginRun().

123  {
124  // Refresh configuration information every event
125  // Hopefully, this does not take too much time
126  // There should be a call back function in future to
127  // handle changes in configuration
128  // parameters to configure RCT (thresholds, etc)
129  const L1RCTParameters *r = &eventSetup.getData(rctParamsToken_);
130 
131  // SCALES
132 
133  // energy scale to convert eGamma output
134  const L1CaloEtScale *s = &eventSetup.getData(emScaleToken_);
135 
136  // get energy scale to convert input from ECAL
137  const L1CaloEcalScale *e = &eventSetup.getData(ecalScaleToken_);
138 
139  // get energy scale to convert input from HCAL
140  const L1CaloHcalScale *h = &eventSetup.getData(hcalScaleToken_);
141 
142  // set scales
143  rctLookupTables->setEcalScale(e);
144  rctLookupTables->setHcalScale(h);
145 
146  rctLookupTables->setRCTParameters(r);
147  rctLookupTables->setL1CaloEtScale(s);
148 }
const edm::ESGetToken< L1CaloEcalScale, L1CaloEcalScaleRcd > ecalScaleToken_
Definition: L1RCTProducer.h:83
std::unique_ptr< L1RCTLookupTables > rctLookupTables
Definition: L1RCTProducer.h:65
const edm::ESGetToken< L1CaloHcalScale, L1CaloHcalScaleRcd > hcalScaleToken_
Definition: L1RCTProducer.h:84
const edm::ESGetToken< L1CaloEtScale, L1EmEtScaleRcd > emScaleToken_
Definition: L1RCTProducer.h:82
const edm::ESGetToken< L1RCTParameters, L1RCTParametersRcd > rctParamsToken_
Definition: L1RCTProducer.h:81
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ updateFedVector()

void L1RCTProducer::updateFedVector ( const L1RCTChannelMask channelMask,
const L1RCTNoisyChannelMask hotChannelMask,
const std::vector< int > &  Feds 
)
private

Definition at line 150 of file L1RCTProducer.cc.

References c_max, c_min, callgraph::cs, ebEvenFed, ebOddFed, L1RCTChannelMask::ecalMask, eeFed, egammaIdentification::eta_max, egammaIdentification::eta_min, fedUpdatedMask, spr::find(), hbheFed, L1RCTChannelMask::hcalMask, hfFed, hfFedUp, L1RCTChannelMask::hfMask, mps_fire::i, LEDCalibrationChannels::ieta, dqmiolumiharvest::j, dqmdumpme::k, maxBarrel, maxEndcap, maxHF, minBarrel, minEndcap, minHF, and rctLookupTables.

Referenced by beginLuminosityBlock(), and beginRun().

154 {
155  rctLookupTables->setNoisyChannelMask(&hotChannelMask);
156 
157  // Update the channel mask according to the FED VECTOR
158  // This is the beginning of run. We delete the old
159  // create the new and set it in the LUTs
160 
161  fedUpdatedMask = std::make_unique<L1RCTChannelMask>();
162  // copy a constant object
163  for (int i = 0; i < 18; i++) {
164  for (int j = 0; j < 2; j++) {
165  for (int k = 0; k < 28; k++) {
166  fedUpdatedMask->ecalMask[i][j][k] = channelMask.ecalMask[i][j][k];
167  fedUpdatedMask->hcalMask[i][j][k] = channelMask.hcalMask[i][j][k];
168  }
169  for (int k = 0; k < 4; k++) {
170  fedUpdatedMask->hfMask[i][j][k] = channelMask.hfMask[i][j][k];
171  }
172  }
173  }
174 
175  // so can create/initialize/assign const quantity in one line accounting for
176  // if statement wikipedia says this is exactly what it's for:
177  // http://en.wikipedia.org/wiki/%3F:#C.2B.2B
178 
179  // std::cout << "Contents of ";
180  // std::cout << (getFromOmds ? "OMDS RunInfo" : "standard RunInfo");
181  // std::cout << " FED vector" << std::endl;
182  // printFedVector(Feds);
183 
184  bool useUpgradedHF = false;
185 
186  std::vector<int> caloFeds; // pare down the feds to the interesting ones
187  // is this unneccesary?
188  // Mike B : This will decrease the find speed so better do it
189  for (std::vector<int>::const_iterator cf = Feds.begin(); cf != Feds.end(); ++cf) {
190  int fedNum = *cf;
191  if ((fedNum > 600 && fedNum < 724) || fedNum == 1118 || fedNum == 1120 || fedNum == 1122)
192  caloFeds.push_back(fedNum);
193 
194  if (fedNum == 1118 || fedNum == 1120 || fedNum == 1122)
195  useUpgradedHF = true;
196  }
197 
198  for (int cr = 0; cr < 18; ++cr) {
199  for (crateSection cs = c_min; cs <= c_max; cs = crateSection(cs + 1)) {
200  bool fedFound = false;
201 
202  // Try to find the FED
203  std::vector<int>::iterator fv = std::find(caloFeds.begin(), caloFeds.end(), crateFED[cr][cs]);
204  if (fv != caloFeds.end())
205  fedFound = true;
206 
207  if (!fedFound) {
208  int eta_min = 0;
209  int eta_max = 0;
210  bool phi_even[2] = {false}; //, phi_odd = false;
211  bool ecal = false;
212 
213  switch (cs) {
214  case ebEvenFed:
215  eta_min = minBarrel;
216  eta_max = maxBarrel;
217  phi_even[0] = true;
218  ecal = true;
219  break;
220 
221  case ebOddFed:
222  eta_min = minBarrel;
223  eta_max = maxBarrel;
224  phi_even[1] = true;
225  ecal = true;
226  break;
227 
228  case eeFed:
229  eta_min = minEndcap;
230  eta_max = maxEndcap;
231  phi_even[0] = true;
232  phi_even[1] = true;
233  ecal = true;
234  break;
235 
236  case hbheFed:
237  eta_min = minBarrel;
238  eta_max = maxEndcap;
239  phi_even[0] = true;
240  phi_even[1] = true;
241  ecal = false;
242  break;
243 
244  case hfFed:
245  if (useUpgradedHF)
246  break;
247 
248  eta_min = minHF;
249  eta_max = maxHF;
250 
251  phi_even[0] = true;
252  phi_even[1] = true;
253  ecal = false;
254  break;
255 
256  case hfFedUp:
257  if (!useUpgradedHF)
258  break;
259 
260  eta_min = minHF;
261  eta_max = maxHF;
262 
263  phi_even[0] = true;
264  phi_even[1] = true;
265  ecal = false;
266  break;
267 
268  default:
269  break;
270  }
271  for (int ieta = eta_min; ieta <= eta_max; ++ieta) {
272  if (ieta <= 28) // barrel and endcap
273  for (int even = 0; even <= 1; even++) {
274  if (phi_even[even]) {
275  if (ecal)
276  fedUpdatedMask->ecalMask[cr][even][ieta - 1] = true;
277  else
278  fedUpdatedMask->hcalMask[cr][even][ieta - 1] = true;
279  }
280  }
281  else
282  for (int even = 0; even <= 1; even++)
283  if (phi_even[even])
284  fedUpdatedMask->hfMask[cr][even][ieta - 29] = true;
285  }
286  }
287  }
288  }
289 
290  rctLookupTables->setChannelMask(fedUpdatedMask.get());
291 }
bool ecalMask[18][2][28]
std::unique_ptr< L1RCTLookupTables > rctLookupTables
Definition: L1RCTProducer.h:65
static constexpr int minEndcap
std::unique_ptr< L1RCTChannelMask > fedUpdatedMask
Definition: L1RCTProducer.h:78
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
static constexpr int maxBarrel
static constexpr int minBarrel
static constexpr int maxHF
bool hcalMask[18][2][28]
static constexpr int minHF
bool hfMask[18][2][4]
static constexpr int maxEndcap

Member Data Documentation

◆ beginLumiChannelMaskToken_

edm::ESGetToken<L1RCTChannelMask, L1RCTChannelMaskRcd> L1RCTProducer::beginLumiChannelMaskToken_
private

Definition at line 96 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock(), and L1RCTProducer().

◆ beginLumiHotChannelMaskToken_

edm::ESGetToken<L1RCTNoisyChannelMask, L1RCTNoisyChannelMaskRcd> L1RCTProducer::beginLumiHotChannelMaskToken_
private

Definition at line 97 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock(), and L1RCTProducer().

◆ beginLumiRunInfoToken_

edm::ESGetToken<RunInfo, RunInfoRcd> L1RCTProducer::beginLumiRunInfoToken_
private

Definition at line 88 of file L1RCTProducer.h.

Referenced by getFedVectorFromOmds(), and L1RCTProducer().

◆ beginRunChannelMaskToken_

const edm::ESGetToken<L1RCTChannelMask, L1RCTChannelMaskRcd> L1RCTProducer::beginRunChannelMaskToken_
private

Definition at line 92 of file L1RCTProducer.h.

Referenced by beginRun().

◆ beginRunHotChannelMaskToken_

const edm::ESGetToken<L1RCTNoisyChannelMask, L1RCTNoisyChannelMaskRcd> L1RCTProducer::beginRunHotChannelMaskToken_
private

Definition at line 93 of file L1RCTProducer.h.

Referenced by beginRun().

◆ beginRunRunInfoToken_

const edm::ESGetToken<RunInfo, RunInfoRcd> L1RCTProducer::beginRunRunInfoToken_
private

Definition at line 87 of file L1RCTProducer.h.

Referenced by beginRun().

◆ bunchCrossings

std::vector<int> L1RCTProducer::bunchCrossings
private

Definition at line 71 of file L1RCTProducer.h.

Referenced by produce().

◆ conditionsLabel

std::string L1RCTProducer::conditionsLabel
private

Definition at line 75 of file L1RCTProducer.h.

◆ ecalDigis

std::vector<edm::InputTag> L1RCTProducer::ecalDigis
private

Definition at line 69 of file L1RCTProducer.h.

Referenced by L1RCTProducer(), and produce().

◆ ecalScaleToken_

const edm::ESGetToken<L1CaloEcalScale, L1CaloEcalScaleRcd> L1RCTProducer::ecalScaleToken_
private

Definition at line 83 of file L1RCTProducer.h.

Referenced by updateConfiguration().

◆ emScaleToken_

const edm::ESGetToken<L1CaloEtScale, L1EmEtScaleRcd> L1RCTProducer::emScaleToken_
private

Definition at line 82 of file L1RCTProducer.h.

Referenced by updateConfiguration().

◆ fedUpdatedMask

std::unique_ptr<L1RCTChannelMask> L1RCTProducer::fedUpdatedMask
private

◆ getFedsFromOmds

bool L1RCTProducer::getFedsFromOmds
private

Definition at line 72 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock(), and L1RCTProducer().

◆ hcalDigis

std::vector<edm::InputTag> L1RCTProducer::hcalDigis
private

Definition at line 70 of file L1RCTProducer.h.

Referenced by L1RCTProducer(), and produce().

◆ hcalScaleToken_

const edm::ESGetToken<L1CaloHcalScale, L1CaloHcalScaleRcd> L1RCTProducer::hcalScaleToken_
private

Definition at line 84 of file L1RCTProducer.h.

Referenced by updateConfiguration().

◆ maxBarrel

constexpr int L1RCTProducer::maxBarrel = 17
staticprivate

Definition at line 102 of file L1RCTProducer.h.

Referenced by updateFedVector().

◆ maxEndcap

constexpr int L1RCTProducer::maxEndcap = 28
staticprivate

Definition at line 104 of file L1RCTProducer.h.

Referenced by updateFedVector().

◆ maxHF

constexpr int L1RCTProducer::maxHF = 32
staticprivate

Definition at line 106 of file L1RCTProducer.h.

Referenced by updateFedVector().

◆ minBarrel

constexpr int L1RCTProducer::minBarrel = 1
staticprivate

Definition at line 101 of file L1RCTProducer.h.

Referenced by updateFedVector().

◆ minEndcap

constexpr int L1RCTProducer::minEndcap = 17
staticprivate

Definition at line 103 of file L1RCTProducer.h.

Referenced by updateFedVector().

◆ minHF

constexpr int L1RCTProducer::minHF = 29
staticprivate

Definition at line 105 of file L1RCTProducer.h.

Referenced by updateFedVector().

◆ omdsRunInfoToken_

edm::ESGetToken<RunInfo, RunInfoRcd> L1RCTProducer::omdsRunInfoToken_
private

Definition at line 89 of file L1RCTProducer.h.

Referenced by getFedVectorFromOmds(), and L1RCTProducer().

◆ queryDelayInLS

unsigned int L1RCTProducer::queryDelayInLS
private

Definition at line 73 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock().

◆ queryIntervalInLS

unsigned int L1RCTProducer::queryIntervalInLS
private

Definition at line 74 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock().

◆ rct

std::unique_ptr<L1RCT> L1RCTProducer::rct
private

Definition at line 66 of file L1RCTProducer.h.

Referenced by produce().

◆ rctLookupTables

std::unique_ptr<L1RCTLookupTables> L1RCTProducer::rctLookupTables
private

Definition at line 65 of file L1RCTProducer.h.

Referenced by updateConfiguration(), and updateFedVector().

◆ rctParamsToken_

const edm::ESGetToken<L1RCTParameters, L1RCTParametersRcd> L1RCTProducer::rctParamsToken_
private

Definition at line 81 of file L1RCTProducer.h.

Referenced by updateConfiguration().

◆ useEcal

bool L1RCTProducer::useEcal
private

Definition at line 67 of file L1RCTProducer.h.

Referenced by produce().

◆ useHcal

bool L1RCTProducer::useHcal
private

Definition at line 68 of file L1RCTProducer.h.

Referenced by produce().