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 35 of file L1RCTProducer.cc.

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

37  rct(new L1RCT(rctLookupTables.get())),
38  useEcal(conf.getParameter<bool>("useEcal")),
39  useHcal(conf.getParameter<bool>("useHcal")),
40  ecalDigis(conf.getParameter<std::vector<edm::InputTag>>("ecalDigis")),
41  hcalDigis(conf.getParameter<std::vector<edm::InputTag>>("hcalDigis")),
42  bunchCrossings(conf.getParameter<std::vector<int>>("BunchCrossings")),
43  getFedsFromOmds(conf.getParameter<bool>("getFedsFromOmds")),
44  queryDelayInLS(conf.getParameter<unsigned int>("queryDelayInLS")),
45  queryIntervalInLS(conf.getParameter<unsigned int>("queryIntervalInLS")),
46  conditionsLabel(conf.getParameter<std::string>("conditionsLabel")),
47  fedUpdatedMask(nullptr),
48 
49  rctParamsToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", conditionsLabel))),
50  emScaleToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", conditionsLabel))),
51  ecalScaleToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", conditionsLabel))),
52  hcalScaleToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", conditionsLabel))),
53 
54  beginRunRunInfoToken_(esConsumes<edm::Transition::BeginRun>()),
55 
56  beginRunChannelMaskToken_(esConsumes<edm::Transition::BeginRun>()),
57  beginRunHotChannelMaskToken_(esConsumes<edm::Transition::BeginRun>()) {
58  produces<L1CaloEmCollection>();
59  produces<L1CaloRegionCollection>();
60 
61  if (getFedsFromOmds) {
62  beginLumiChannelMaskToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>();
63  beginLumiHotChannelMaskToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>();
64  beginLumiRunInfoToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>();
65  omdsRunInfoToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>(edm::ESInputTag("", "OmdsFedVector"));
66  }
67 
68  for (unsigned int ihc = 0; ihc < hcalDigis.size(); ihc++) {
69  consumes<edm::SortedCollection<HcalTriggerPrimitiveDigi, edm::StrictWeakOrdering<HcalTriggerPrimitiveDigi>>>(
70  hcalDigis[ihc]);
71  }
72 
73  for (unsigned int iec = 0; iec < ecalDigis.size(); iec++) {
74  consumes<edm::SortedCollection<EcalTriggerPrimitiveDigi, edm::StrictWeakOrdering<EcalTriggerPrimitiveDigi>>>(
75  ecalDigis[iec]);
76  }
77 }
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 93 of file L1RCTProducer.cc.

References Exception, and getFedsFromOmds.

93  {
94  // check LS number every LS, if the checkOMDS flag is set AND it's the right
95  // LS, update the FED vector from OMDS can pass the flag as the bool?? but
96  // only check LS number if flag is true anyhow
97  if (getFedsFromOmds) {
98  throw cms::Exception("L1RCTProducer Configuration")
99  << "L1RCTProducer is being run with the configuration parameter getFedsFromOmds set true. "
100  << "Underlying Framework changes have broken the implementation of that option. "
101  << "It was not fixed because we believe this option is no longer used or needed. "
102  << "If you actually need this option, please report this failure to the Framework. "
103  << "For more details see GitHub Issue 43697.";
104  /*
105  unsigned int nLumi = lumiSeg.luminosityBlock(); // doesn't even need the (unsigned int) cast
106  // because LuminosityBlockNumber_t is already
107  // an unsigned int
108  // LS count starts at 1, want to be able to delay 0 LS's intuitively
109  if (((nLumi - 1) == queryDelayInLS) ||
110  (queryIntervalInLS > 0 &&
111  nLumi % queryIntervalInLS == 0)) // to guard against problems if online DQM crashes; every 100
112  // LS is ~20-30 minutes, not too big a load, hopefully not too
113  // long between
114  {
115  // std::cout << "Lumi section for this FED vector update is " <<
116  // nLumi << std::endl;
117 
118  // list of RCT channels to mask
119  L1RCTChannelMask const &channelMask = context.getData(beginLumiChannelMaskToken_);
120 
121  // list of Noisy RCT channels to mask
122  L1RCTNoisyChannelMask const &hotChannelMask = context.getData(beginLumiHotChannelMaskToken_);
123 
124  updateFedVector(channelMask, hotChannelMask, getFedVectorFromOmds(context));
125  } else if (queryIntervalInLS <= 0) {
126  // don't do interval checking... cout message??
127  }
128  */
129  }
130 }
bool getFedsFromOmds
Definition: L1RCTProducer.h:72

◆ beginRun()

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

Definition at line 79 of file L1RCTProducer.cc.

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

79  {
80  // std::cout << "getFedsFromOmds is " << getFedsFromOmds << std::endl;
81 
83 
84  // list of RCT channels to mask
85  L1RCTChannelMask const &channelMask = eventSetup.getData(beginRunChannelMaskToken_);
86 
87  // list of Noisy RCT channels to mask
88  L1RCTNoisyChannelMask const &hotChannelMask = eventSetup.getData(beginRunHotChannelMaskToken_);
89 
91 }
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 310 of file L1RCTProducer.cc.

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

310  {
311  // std::cout << "Getting FED vector from my specific ES RunInfo object" <<
312  // std::endl;
313 
314  // get FULL FED vector from RunInfo object specifically created to have OMDS
315  // fed vector
317  if (sum.isValid()) {
318  return sum->m_fed_in;
319  } else {
321  }
322 }
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 302 of file L1RCTProducer.cc.

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

Referenced by beginRun(), and getFedVectorFromOmds().

303  {
304  // std::cout << "Getting FED vector from standard RunInfo object" <<
305  // std::endl;
306  // get FULL FED vector from RUNINFO
307  return eventSetup.getData(token).m_fed_in;
308 }

◆ printFedVector()

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

Definition at line 380 of file L1RCTProducer.cc.

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

380  {
381  std::cout << "Contents of given fedVector: ";
382  std::copy(fedVector.begin(), fedVector.end(), std::ostream_iterator<int>(std::cout, ", "));
383  std::cout << std::endl;
384 }

◆ printUpdatedFedMask()

void L1RCTProducer::printUpdatedFedMask ( )
private

Definition at line 387 of file L1RCTProducer.cc.

References gather_cfg::cout, and fedUpdatedMask.

387  {
388  if (fedUpdatedMask != nullptr) {
389  fedUpdatedMask->print(std::cout);
390  } else {
391  std::cout << "Trying to print contents of fedUpdatedMask, but it doesn't exist!" << std::endl;
392  }
393 }
std::unique_ptr< L1RCTChannelMask > fedUpdatedMask
Definition: L1RCTProducer.h:78

◆ printUpdatedFedMaskVerbose()

void L1RCTProducer::printUpdatedFedMaskVerbose ( )
private

Definition at line 396 of file L1RCTProducer.cc.

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

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

◆ produce()

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

Definition at line 324 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.

324  {
325  std::unique_ptr<L1CaloEmCollection> rctEmCands(new L1CaloEmCollection);
326  std::unique_ptr<L1CaloRegionCollection> rctRegions(new L1CaloRegionCollection);
327 
328  if (!(ecalDigis.size() == hcalDigis.size() && hcalDigis.size() == bunchCrossings.size()))
329  throw cms::Exception("BadInput") << "From what I see the number of your your ECAL input digi "
330  "collections.\n"
331  << "is different from the size of your HCAL digi input collections\n"
332  << "or the size of your BX factor collection"
333  << "They must be the same to correspond to the same Bxs\n"
334  << "It does not matter if one of them is empty\n";
335 
336  // loop through and process each bx
337  for (unsigned short sample = 0; sample < bunchCrossings.size(); sample++) {
340 
343 
344  if (useHcal && event.getByLabel(hcalDigis[sample], hcal))
345  hcalIn = *hcal;
346 
347  if (useEcal && event.getByLabel(ecalDigis[sample], ecal))
348  ecalIn = *ecal;
349 
350  rct->digiInput(ecalIn, hcalIn);
351  rct->processEvent();
352 
353  // Stuff to create
354  for (int j = 0; j < 18; j++) {
355  L1CaloEmCollection isolatedEGObjects = rct->getIsolatedEGObjects(j);
356  L1CaloEmCollection nonisolatedEGObjects = rct->getNonisolatedEGObjects(j);
357  for (int i = 0; i < 4; i++) {
358  isolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
359  nonisolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
360  rctEmCands->push_back(isolatedEGObjects.at(i));
361  rctEmCands->push_back(nonisolatedEGObjects.at(i));
362  }
363  }
364 
365  for (int i = 0; i < 18; i++) {
366  std::vector<L1CaloRegion> regions = rct->getRegions(i);
367  for (int j = 0; j < 22; j++) {
368  regions.at(j).setBx(bunchCrossings[sample]);
369  rctRegions->push_back(regions.at(j));
370  }
371  }
372  }
373 
374  // putting stuff back into event
375  event.put(std::move(rctEmCands));
376  event.put(std::move(rctRegions));
377 }
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 132 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().

132  {
133  // Refresh configuration information every event
134  // Hopefully, this does not take too much time
135  // There should be a call back function in future to
136  // handle changes in configuration
137  // parameters to configure RCT (thresholds, etc)
138  const L1RCTParameters *r = &eventSetup.getData(rctParamsToken_);
139 
140  // SCALES
141 
142  // energy scale to convert eGamma output
143  const L1CaloEtScale *s = &eventSetup.getData(emScaleToken_);
144 
145  // get energy scale to convert input from ECAL
146  const L1CaloEcalScale *e = &eventSetup.getData(ecalScaleToken_);
147 
148  // get energy scale to convert input from HCAL
149  const L1CaloHcalScale *h = &eventSetup.getData(hcalScaleToken_);
150 
151  // set scales
152  rctLookupTables->setEcalScale(e);
153  rctLookupTables->setHcalScale(h);
154 
155  rctLookupTables->setRCTParameters(r);
156  rctLookupTables->setL1CaloEtScale(s);
157 }
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 159 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, hcalRecHitTable_cff::ieta, dqmiolumiharvest::j, dqmdumpme::k, maxBarrel, maxEndcap, maxHF, minBarrel, minEndcap, minHF, and rctLookupTables.

Referenced by beginRun().

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

◆ beginLumiHotChannelMaskToken_

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

Definition at line 97 of file L1RCTProducer.h.

Referenced by 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.

◆ queryIntervalInLS

unsigned int L1RCTProducer::queryIntervalInLS
private

Definition at line 74 of file L1RCTProducer.h.

◆ 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().