CMS 3D CMS Logo

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

#include <L1RCTProducer.h>

Inheritance diagram for L1RCTProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
const std::vector< int > getFedVectorFromOmds (const edm::EventSetup &)
 
const std::vector< int > getFedVectorFromRunInfo (const edm::EventSetup &)
 
 L1RCTProducer (const edm::ParameterSet &ps)
 
void printFedVector (const std::vector< int > &)
 
void printUpdatedFedMask ()
 
void printUpdatedFedMaskVerbose ()
 
void produce (edm::Event &e, const edm::EventSetup &c) final
 
void updateConfiguration (const edm::EventSetup &)
 
void updateFedVector (const edm::EventSetup &, bool getFromOmds, int)
 
 ~L1RCTProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

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

Private Attributes

std::vector< int > bunchCrossings
 
std::string conditionsLabel
 
std::vector< edm::InputTagecalDigis
 
L1RCTChannelMaskfedUpdatedMask
 
bool getFedsFromOmds
 
std::vector< edm::InputTaghcalDigis
 
unsigned int queryDelayInLS
 
unsigned int queryIntervalInLS
 
L1RCTrct
 
L1RCTLookupTablesrctLookupTables
 
bool useEcal
 
bool useHcal
 

Static Private Attributes

static const int crateFED [18][6]
 
static const int maxBarrel = 17
 
static const int maxEndcap = 28
 
static const int maxHF = 32
 
static const int minBarrel = 1
 
static const int minEndcap = 17
 
static const int minHF = 29
 

Additional Inherited Members

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

Detailed Description

Definition at line 44 of file L1RCTProducer.h.

Member Enumeration Documentation

Enumerator
c_min 
ebOddFed 
ebEvenFed 
eeFed 
hbheFed 
hfFed 
hfFedUp 
c_max 

Definition at line 79 of file L1RCTProducer.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file L1RCTProducer.cc.

References edm::EDConsumerBase::consumes(), ecalDigis, and hcalDigis.

27  useEcal(conf.getParameter<bool>("useEcal")),
28  useHcal(conf.getParameter<bool>("useHcal")),
29  ecalDigis(conf.getParameter<std::vector<edm::InputTag>>("ecalDigis")),
30  hcalDigis(conf.getParameter<std::vector<edm::InputTag>>("hcalDigis")),
31  bunchCrossings(conf.getParameter<std::vector<int>>("BunchCrossings")),
32  getFedsFromOmds(conf.getParameter<bool>("getFedsFromOmds")),
33  queryDelayInLS(conf.getParameter<unsigned int>("queryDelayInLS")),
34  queryIntervalInLS(conf.getParameter<unsigned int>("queryIntervalInLS")),
35  conditionsLabel(conf.getParameter<std::string>("conditionsLabel")),
36  fedUpdatedMask(nullptr) {
37  produces<L1CaloEmCollection>();
38  produces<L1CaloRegionCollection>();
39 
40  for (unsigned int ihc = 0; ihc < hcalDigis.size(); ihc++) {
44  }
45 
46  for (unsigned int iec = 0; iec < ecalDigis.size(); iec++) {
50  }
51 }
std::string conditionsLabel
Definition: L1RCTProducer.h:74
L1RCTLookupTables * rctLookupTables
Definition: L1RCTProducer.h:64
unsigned int queryDelayInLS
Definition: L1RCTProducer.h:72
bool getFedsFromOmds
Definition: L1RCTProducer.h:71
std::vector< edm::InputTag > hcalDigis
Definition: L1RCTProducer.h:69
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< edm::InputTag > ecalDigis
Definition: L1RCTProducer.h:68
std::vector< int > bunchCrossings
Definition: L1RCTProducer.h:70
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:77
unsigned int queryIntervalInLS
Definition: L1RCTProducer.h:73
Definition: L1RCT.h:20
L1RCTProducer::~L1RCTProducer ( )
override

Definition at line 53 of file L1RCTProducer.cc.

References fedUpdatedMask, rct, and rctLookupTables.

53  {
54  if (rct != nullptr)
55  delete rct;
56  if (rctLookupTables != nullptr)
57  delete rctLookupTables;
58  if (fedUpdatedMask != nullptr)
59  delete fedUpdatedMask;
60 }
L1RCTLookupTables * rctLookupTables
Definition: L1RCTProducer.h:64
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:77

Member Function Documentation

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

Definition at line 73 of file L1RCTProducer.cc.

References getFedsFromOmds, edm::LuminosityBlockBase::luminosityBlock(), queryDelayInLS, queryIntervalInLS, edm::LuminosityBlockBase::run(), convertSQLiteXML::runNumber, and updateFedVector().

74  {
75  // check LS number every LS, if the checkOMDS flag is set AND it's the right
76  // LS, update the FED vector from OMDS can pass the flag as the bool?? but
77  // only check LS number if flag is true anyhow
78  if (getFedsFromOmds) {
79  unsigned int nLumi =
80  lumiSeg.luminosityBlock(); // doesn't even need the (unsigned int) cast
81  // because LuminosityBlockNumber_t is already
82  // an unsigned int
83  // LS count starts at 1, want to be able to delay 0 LS's intuitively
84  if (((nLumi - 1) == queryDelayInLS) ||
85  (queryIntervalInLS > 0 &&
86  nLumi % queryIntervalInLS ==
87  0)) // to guard against problems if online DQM crashes; every 100
88  // LS is ~20-30 minutes, not too big a load, hopefully not too
89  // long between
90  {
91  int runNumber = lumiSeg.run();
92  // std::cout << "Lumi section for this FED vector update is " <<
93  // nLumi << std::endl;
94  updateFedVector(context, true, runNumber); // OMDS
95  } else if (queryIntervalInLS <= 0) {
96  // don't do interval checking... cout message??
97  }
98  }
99 }
unsigned int queryDelayInLS
Definition: L1RCTProducer.h:72
bool getFedsFromOmds
Definition: L1RCTProducer.h:71
void updateFedVector(const edm::EventSetup &, bool getFromOmds, int)
unsigned int queryIntervalInLS
Definition: L1RCTProducer.h:73
void L1RCTProducer::beginRun ( edm::Run const &  r,
const edm::EventSetup c 
)
final

Definition at line 62 of file L1RCTProducer.cc.

References edm::RunBase::run(), convertSQLiteXML::runNumber, updateConfiguration(), and updateFedVector().

63  {
64  // std::cout << "getFedsFromOmds is " << getFedsFromOmds << std::endl;
65 
66  updateConfiguration(eventSetup);
67 
68  int runNumber = run.run();
69  updateFedVector(eventSetup, false,
70  runNumber); // RUNINFO ONLY at beginning of run
71 }
void updateConfiguration(const edm::EventSetup &)
void updateFedVector(const edm::EventSetup &, bool getFromOmds, int)
const std::vector< int > L1RCTProducer::getFedVectorFromOmds ( const edm::EventSetup eventSetup)

Definition at line 314 of file L1RCTProducer.cc.

References edm::EventSetup::get(), getFedVectorFromRunInfo(), edm::ESHandleBase::isValid(), RunInfo::m_fed_in, edm::ESHandle< T >::product(), and heppy_report::summary.

Referenced by updateFedVector().

314  {
315 
316  // std::cout << "Getting FED vector from my specific ES RunInfo object" <<
317  // std::endl;
318 
319  // get FULL FED vector from RunInfo object specifically created to have OMDS
320  // fed vector
322  eventSetup.get<RunInfoRcd>().get(
323  "OmdsFedVector",
324  sum); // using label to get my specific instance of RunInfo
325  if (sum.isValid()) {
326  const RunInfo *summary = sum.product();
327  const std::vector<int> fedvector = summary->m_fed_in;
328 
329  return fedvector;
330  } else {
331  return getFedVectorFromRunInfo(eventSetup);
332  }
333 }
const std::vector< int > getFedVectorFromRunInfo(const edm::EventSetup &)
std::vector< int > m_fed_in
Definition: RunInfo.h:26
T get() const
Definition: EventSetup.h:71
bool isValid() const
Definition: ESHandle.h:44
T const * product() const
Definition: ESHandle.h:86
const std::vector< int > L1RCTProducer::getFedVectorFromRunInfo ( const edm::EventSetup eventSetup)

Definition at line 301 of file L1RCTProducer.cc.

References edm::EventSetup::get(), RunInfo::m_fed_in, edm::ESHandle< T >::product(), and heppy_report::summary.

Referenced by getFedVectorFromOmds(), and updateFedVector().

301  {
302  // std::cout << "Getting FED vector from standard RunInfo object" <<
303  // std::endl;
304  // get FULL FED vector from RUNINFO
306  eventSetup.get<RunInfoRcd>().get(sum);
307  const RunInfo *summary = sum.product();
308  const std::vector<int> fedvector = summary->m_fed_in;
309 
310  return fedvector;
311 }
std::vector< int > m_fed_in
Definition: RunInfo.h:26
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
void L1RCTProducer::printFedVector ( const std::vector< int > &  fedVector)

Definition at line 396 of file L1RCTProducer.cc.

References popcon2dropbox::copy(), and gather_cfg::cout.

396  {
397  std::cout << "Contents of given fedVector: ";
398  std::copy(fedVector.begin(), fedVector.end(),
399  std::ostream_iterator<int>(std::cout, ", "));
400  std::cout << std::endl;
401 }
def copy(args, dbName)
void L1RCTProducer::printUpdatedFedMask ( )

Definition at line 404 of file L1RCTProducer.cc.

References gather_cfg::cout, fedUpdatedMask, and L1RCTChannelMask::print().

404  {
405  if (fedUpdatedMask != nullptr) {
407  } else {
408  std::cout
409  << "Trying to print contents of fedUpdatedMask, but it doesn't exist!"
410  << std::endl;
411  }
412 }
void print(std::ostream &s) const
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:77
void L1RCTProducer::printUpdatedFedMaskVerbose ( )

Definition at line 415 of file L1RCTProducer.cc.

References gather_cfg::cout, L1RCTChannelMask::ecalMask, fedUpdatedMask, L1RCTChannelMask::hcalMask, L1RCTChannelMask::hfMask, mps_fire::i, and gen::k.

415  {
416  if (fedUpdatedMask != nullptr) {
417  // print contents of fedvector
418  std::cout << "Contents of fedUpdatedMask: ";
419  // std::copy(fedUpdatedMask.begin(), fedUpdatedMask.end(),
420  // std::ostream_iterator<int>(std::cout, ", "));
421  std::cout << "--> ECAL mask: " << std::endl;
422  for (int i = 0; i < 18; i++) {
423  for (int j = 0; j < 2; j++) {
424  for (int k = 0; k < 28; k++) {
425  std::cout << fedUpdatedMask->ecalMask[i][j][k] << ", ";
426  }
427  }
428  }
429  std::cout << "--> HCAL mask: " << std::endl;
430  for (int i = 0; i < 18; i++) {
431  for (int j = 0; j < 2; j++) {
432  for (int k = 0; k < 28; k++) {
433  std::cout << fedUpdatedMask->hcalMask[i][j][k] << ", ";
434  }
435  }
436  }
437  std::cout << "--> HF mask: " << std::endl;
438  for (int i = 0; i < 18; i++) {
439  for (int j = 0; j < 2; j++) {
440  for (int k = 0; k < 4; k++) {
441  std::cout << fedUpdatedMask->hfMask[i][j][k] << ", ";
442  }
443  }
444  }
445 
446  std::cout << std::endl;
447  } else {
448  // print error message
449  std::cout
450  << "Trying to print contents of fedUpdatedMask, but it doesn't exist!"
451  << std::endl;
452  }
453 }
bool ecalMask[18][2][28]
int k[5][pyjets_maxn]
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:77
bool hcalMask[18][2][28]
bool hfMask[18][2][4]
void L1RCTProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
final

Definition at line 335 of file L1RCTProducer.cc.

References bunchCrossings, L1RCT::digiInput(), digitizers_cfi::ecal, ecalDigis, Exception, edm::Event::getByLabel(), L1RCT::getIsolatedEGObjects(), L1RCT::getNonisolatedEGObjects(), L1RCT::getRegions(), digitizers_cfi::hcal, hcalDigis, mps_fire::i, eostools::move(), L1RCT::processEvent(), rct, simplePhotonAnalyzer_cfi::sample, useEcal, and useHcal.

336  {
337 
338  std::unique_ptr<L1CaloEmCollection> rctEmCands(new L1CaloEmCollection);
339  std::unique_ptr<L1CaloRegionCollection> rctRegions(
341 
342  if (!(ecalDigis.size() == hcalDigis.size() &&
343  hcalDigis.size() == bunchCrossings.size()))
344  throw cms::Exception("BadInput")
345  << "From what I see the number of your your ECAL input digi "
346  "collections.\n"
347  << "is different from the size of your HCAL digi input collections\n"
348  << "or the size of your BX factor collection"
349  << "They must be the same to correspond to the same Bxs\n"
350  << "It does not matter if one of them is empty\n";
351 
352  // loop through and process each bx
353  for (unsigned short sample = 0; sample < bunchCrossings.size(); sample++) {
356 
359 
360  if (useHcal && event.getByLabel(hcalDigis[sample], hcal))
361  hcalIn = *hcal;
362 
363  if (useEcal && event.getByLabel(ecalDigis[sample], ecal))
364  ecalIn = *ecal;
365 
366  rct->digiInput(ecalIn, hcalIn);
367  rct->processEvent();
368 
369  // Stuff to create
370  for (int j = 0; j < 18; j++) {
371  L1CaloEmCollection isolatedEGObjects = rct->getIsolatedEGObjects(j);
372  L1CaloEmCollection nonisolatedEGObjects = rct->getNonisolatedEGObjects(j);
373  for (int i = 0; i < 4; i++) {
374  isolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
375  nonisolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
376  rctEmCands->push_back(isolatedEGObjects.at(i));
377  rctEmCands->push_back(nonisolatedEGObjects.at(i));
378  }
379  }
380 
381  for (int i = 0; i < 18; i++) {
382  std::vector<L1CaloRegion> regions = rct->getRegions(i);
383  for (int j = 0; j < 22; j++) {
384  regions.at(j).setBx(bunchCrossings[sample]);
385  rctRegions->push_back(regions.at(j));
386  }
387  }
388  }
389 
390  // putting stuff back into event
391  event.put(std::move(rctEmCands));
392  event.put(std::move(rctRegions));
393 }
std::vector< L1CaloEmCand > L1CaloEmCollection
std::vector< L1CaloRegion > getRegions(unsigned crate)
Definition: L1RCT.cc:386
L1CaloEmCollection getNonisolatedEGObjects(unsigned crate)
Definition: L1RCT.cc:370
std::vector< edm::InputTag > hcalDigis
Definition: L1RCTProducer.h:69
std::vector< edm::InputTag > ecalDigis
Definition: L1RCTProducer.h:68
std::vector< int > bunchCrossings
Definition: L1RCTProducer.h:70
L1CaloEmCollection getIsolatedEGObjects(unsigned crate)
Definition: L1RCT.cc:352
void processEvent()
Definition: L1RCT.cc:36
void digiInput(const EcalTrigPrimDigiCollection &ecalCollection, const HcalTrigPrimDigiCollection &hcalCollection)
Definition: L1RCT.cc:109
std::vector< L1CaloRegion > L1CaloRegionCollection
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1
void L1RCTProducer::updateConfiguration ( const edm::EventSetup eventSetup)

Definition at line 101 of file L1RCTProducer.cc.

References conditionsLabel, MillePedeFileConverter_cfg::e, edm::EventSetup::get(), h, edm::ESHandle< T >::product(), alignCSCRings::r, rctLookupTables, alignCSCRings::s, L1RCTLookupTables::setEcalScale(), L1RCTLookupTables::setHcalScale(), L1RCTLookupTables::setL1CaloEtScale(), and L1RCTLookupTables::setRCTParameters().

Referenced by beginRun().

101  {
102  // Refresh configuration information every event
103  // Hopefully, this does not take too much time
104  // There should be a call back function in future to
105  // handle changes in configuration
106  // parameters to configure RCT (thresholds, etc)
107  edm::ESHandle<L1RCTParameters> rctParameters;
108  eventSetup.get<L1RCTParametersRcd>().get(conditionsLabel, rctParameters);
109  const L1RCTParameters *r = rctParameters.product();
110 
111  // SCALES
112 
113  // energy scale to convert eGamma output
115  eventSetup.get<L1EmEtScaleRcd>().get(conditionsLabel, emScale);
116  const L1CaloEtScale *s = emScale.product();
117 
118  // get energy scale to convert input from ECAL
120  eventSetup.get<L1CaloEcalScaleRcd>().get(conditionsLabel, ecalScale);
121  const L1CaloEcalScale *e = ecalScale.product();
122 
123  // get energy scale to convert input from HCAL
125  eventSetup.get<L1CaloHcalScaleRcd>().get(conditionsLabel, hcalScale);
126  const L1CaloHcalScale *h = hcalScale.product();
127 
128  // set scales
131 
134 }
std::string conditionsLabel
Definition: L1RCTProducer.h:74
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
L1RCTLookupTables * rctLookupTables
Definition: L1RCTProducer.h:64
void setHcalScale(const L1CaloHcalScale *hcalScale)
void setL1CaloEtScale(const L1CaloEtScale *etScale)
void setEcalScale(const L1CaloEcalScale *ecalScale)
void setRCTParameters(const L1RCTParameters *rctParameters)
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
void L1RCTProducer::updateFedVector ( const edm::EventSetup eventSetup,
bool  getFromOmds,
int  runNumber 
)

Definition at line 136 of file L1RCTProducer.cc.

References c_max, c_min, crateFED, fwrapper::cs, ebEvenFed, ebOddFed, digitizers_cfi::ecal, L1RCTChannelMask::ecalMask, eeFed, MuonTCMETValueMapProducer_cff::eta_max, MuonME0RecHits_cfi::eta_min, fedUpdatedMask, spr::find(), edm::EventSetup::get(), getFedVectorFromOmds(), getFedVectorFromRunInfo(), hbheFed, L1RCTChannelMask::hcalMask, hfFed, hfFedUp, L1RCTChannelMask::hfMask, mps_fire::i, gen::k, maxBarrel, maxEndcap, maxHF, minBarrel, minEndcap, minHF, edm::ESHandle< T >::product(), rctLookupTables, L1RCTLookupTables::setChannelMask(), and L1RCTLookupTables::setNoisyChannelMask().

Referenced by beginLuminosityBlock(), and beginRun().

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

Member Data Documentation

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

Definition at line 70 of file L1RCTProducer.h.

Referenced by produce().

std::string L1RCTProducer::conditionsLabel
private

Definition at line 74 of file L1RCTProducer.h.

Referenced by updateConfiguration().

const int L1RCTProducer::crateFED
staticprivate
Initial value:
= {
{613, 614, 603, 702, 718, 1118}, {611, 612, 602, 700, 718, 1118},
{627, 610, 601, 716, 722, 1122}, {625, 626, 609, 714, 722, 1122},
{623, 624, 608, 712, 722, 1122}, {621, 622, 607, 710, 720, 1120},
{619, 620, 606, 708, 720, 1120}, {617, 618, 605, 706, 720, 1120},
{615, 616, 604, 704, 718, 1118}, {631, 632, 648, 703, 719, 1118},
{629, 630, 647, 701, 719, 1118}, {645, 628, 646, 717, 723, 1122},
{643, 644, 654, 715, 723, 1122}, {641, 642, 653, 713, 723, 1122},
{639, 640, 652, 711, 721, 1120}, {637, 638, 651, 709, 721, 1120},
{635, 636, 650, 707, 721, 1120}, {633, 634, 649, 705, 719, 1118}}

Definition at line 90 of file L1RCTProducer.h.

Referenced by updateFedVector().

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

Definition at line 68 of file L1RCTProducer.h.

Referenced by L1RCTProducer(), and produce().

L1RCTChannelMask* L1RCTProducer::fedUpdatedMask
private
bool L1RCTProducer::getFedsFromOmds
private

Definition at line 71 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock().

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

Definition at line 69 of file L1RCTProducer.h.

Referenced by L1RCTProducer(), and produce().

const int L1RCTProducer::maxBarrel = 17
staticprivate

Definition at line 93 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::maxEndcap = 28
staticprivate

Definition at line 95 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::maxHF = 32
staticprivate

Definition at line 97 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::minBarrel = 1
staticprivate

Definition at line 92 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::minEndcap = 17
staticprivate

Definition at line 94 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::minHF = 29
staticprivate

Definition at line 96 of file L1RCTProducer.h.

Referenced by updateFedVector().

unsigned int L1RCTProducer::queryDelayInLS
private

Definition at line 72 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock().

unsigned int L1RCTProducer::queryIntervalInLS
private

Definition at line 73 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock().

L1RCT* L1RCTProducer::rct
private

Definition at line 65 of file L1RCTProducer.h.

Referenced by produce(), and ~L1RCTProducer().

L1RCTLookupTables* L1RCTProducer::rctLookupTables
private

Definition at line 64 of file L1RCTProducer.h.

Referenced by updateConfiguration(), updateFedVector(), and ~L1RCTProducer().

bool L1RCTProducer::useEcal
private

Definition at line 66 of file L1RCTProducer.h.

Referenced by produce().

bool L1RCTProducer::useHcal
private

Definition at line 67 of file L1RCTProducer.h.

Referenced by produce().