CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private 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

virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, const edm::EventSetup &context) overridefinal
 
virtual void beginRun (edm::Run const &r, const edm::EventSetup &c) overridefinal
 
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 ()
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) overridefinal
 
void updateConfiguration (const edm::EventSetup &)
 
void updateFedVector (const edm::EventSetup &, bool getFromOmds, int)
 
virtual ~L1RCTProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private 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
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)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 47 of file L1RCTProducer.h.

Member Enumeration Documentation

Enumerator
c_min 
ebOddFed 
ebEvenFed 
eeFed 
hbheFed 
hfFed 
hfFedUp 
c_max 

Definition at line 84 of file L1RCTProducer.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file L1RCTProducer.cc.

References ecalDigis, and hcalDigis.

36  :
39  useEcal(conf.getParameter<bool>("useEcal")),
40  useHcal(conf.getParameter<bool>("useHcal")),
41  ecalDigis(conf.getParameter<std::vector<edm::InputTag> >("ecalDigis")),
42  hcalDigis(conf.getParameter<std::vector<edm::InputTag> >("hcalDigis")),
43  bunchCrossings(conf.getParameter<std::vector<int> >("BunchCrossings")),
44  getFedsFromOmds(conf.getParameter<bool>("getFedsFromOmds")),
45  queryDelayInLS(conf.getParameter<unsigned int>("queryDelayInLS")),
46  queryIntervalInLS(conf.getParameter<unsigned int>("queryIntervalInLS")),
47  conditionsLabel(conf.getParameter<std::string>("conditionsLabel")),
49 {
50  produces<L1CaloEmCollection>();
51  produces<L1CaloRegionCollection>();
52 
53  for(unsigned int ihc=0;ihc<hcalDigis.size();ihc++){
54  consumes<edm::SortedCollection<HcalTriggerPrimitiveDigi,edm::StrictWeakOrdering<HcalTriggerPrimitiveDigi> > >(hcalDigis[ihc]);
55  }
56 
57  for(unsigned int iec=0;iec<ecalDigis.size();iec++){
58  consumes<edm::SortedCollection<EcalTriggerPrimitiveDigi,edm::StrictWeakOrdering<EcalTriggerPrimitiveDigi> > >(ecalDigis[iec]);
59  }
60 }
std::string conditionsLabel
Definition: L1RCTProducer.h:78
L1RCTLookupTables * rctLookupTables
Definition: L1RCTProducer.h:68
unsigned int queryDelayInLS
Definition: L1RCTProducer.h:76
bool getFedsFromOmds
Definition: L1RCTProducer.h:75
std::vector< edm::InputTag > hcalDigis
Definition: L1RCTProducer.h:73
std::vector< edm::InputTag > ecalDigis
Definition: L1RCTProducer.h:72
std::vector< int > bunchCrossings
Definition: L1RCTProducer.h:74
tuple conf
Definition: dbtoconf.py:185
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:81
unsigned int queryIntervalInLS
Definition: L1RCTProducer.h:77
Definition: L1RCT.h:20
L1RCTProducer::~L1RCTProducer ( )
virtual

Definition at line 62 of file L1RCTProducer.cc.

References fedUpdatedMask, rct, and rctLookupTables.

63 {
64  if(rct != 0) delete rct;
65  if(rctLookupTables != 0) delete rctLookupTables;
66  if(fedUpdatedMask != 0) delete fedUpdatedMask;
67 }
L1RCTLookupTables * rctLookupTables
Definition: L1RCTProducer.h:68
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:81

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 82 of file L1RCTProducer.cc.

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

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

Reimplemented from edm::EDProducer.

Definition at line 70 of file L1RCTProducer.cc.

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

71 {
72  // std::cout << "getFedsFromOmds is " << getFedsFromOmds << std::endl;
73 
74  updateConfiguration(eventSetup);
75 
76  int runNumber = run.run();
77  updateFedVector(eventSetup,false,runNumber); // RUNINFO ONLY at beginning of run
78 
79 }
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 328 of file L1RCTProducer.cc.

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

Referenced by updateFedVector().

329 {
330 
331  // std::cout << "Getting FED vector from my specific ES RunInfo object" << std::endl;
332 
333  // get FULL FED vector from RunInfo object specifically created to have OMDS fed vector
335  eventSetup.get<RunInfoRcd>().get("OmdsFedVector",sum); // using label to get my specific instance of RunInfo
336  if (sum.isValid())
337  {
338  const RunInfo* summary=sum.product();
339  const std::vector<int> fedvector = summary->m_fed_in;
340 
341  return fedvector;
342  }
343  else
344  {
345  return getFedVectorFromRunInfo(eventSetup);
346  }
347 
348 }
const std::vector< int > getFedVectorFromRunInfo(const edm::EventSetup &)
std::vector< int > m_fed_in
Definition: RunInfo.h:26
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
bool isValid() const
Definition: ESHandle.h:47
const std::vector< int > L1RCTProducer::getFedVectorFromRunInfo ( const edm::EventSetup eventSetup)

Definition at line 315 of file L1RCTProducer.cc.

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

Referenced by getFedVectorFromOmds(), and updateFedVector().

316 {
317  // std::cout << "Getting FED vector from standard RunInfo object" << std::endl;
318  // get FULL FED vector from RUNINFO
320  eventSetup.get<RunInfoRcd>().get(sum);
321  const RunInfo* summary=sum.product();
322  const std::vector<int> fedvector = summary->m_fed_in;
323 
324  return fedvector;
325 }
std::vector< int > m_fed_in
Definition: RunInfo.h:26
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
void L1RCTProducer::printFedVector ( const std::vector< int > &  fedVector)

Definition at line 425 of file L1RCTProducer.cc.

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

426 {
427  std::cout << "Contents of given fedVector: ";
428  std::copy(fedVector.begin(), fedVector.end(), std::ostream_iterator<int>(std::cout, ", "));
429  std::cout << std::endl;
430 }
tuple cout
Definition: gather_cfg.py:121
void L1RCTProducer::printUpdatedFedMask ( )

Definition at line 433 of file L1RCTProducer.cc.

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

434 {
435  if (fedUpdatedMask != 0)
436  {
438  }
439  else
440  {
441  std::cout << "Trying to print contents of fedUpdatedMask, but it doesn't exist!" << std::endl;
442  }
443 }
void print(std::ostream &s) const
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:81
tuple cout
Definition: gather_cfg.py:121
void L1RCTProducer::printUpdatedFedMaskVerbose ( )

Definition at line 446 of file L1RCTProducer.cc.

References gather_cfg::cout, L1RCTChannelMask::ecalMask, fedUpdatedMask, L1RCTChannelMask::hcalMask, L1RCTChannelMask::hfMask, i, j, and relval_steps::k.

447 {
448  if (fedUpdatedMask != 0)
449  {
450  // print contents of fedvector
451  std::cout << "Contents of fedUpdatedMask: ";
452 // std::copy(fedUpdatedMask.begin(), fedUpdatedMask.end(), std::ostream_iterator<int>(std::cout, ", "));
453  std::cout << "--> ECAL mask: " << std::endl;
454  for (int i = 0; i < 18; i++)
455  {
456  for (int j = 0; j < 2; j++)
457  {
458  for (int k = 0; k < 28; k++)
459  {
460  std::cout << fedUpdatedMask->ecalMask[i][j][k] << ", ";
461  }
462  }
463  }
464  std::cout << "--> HCAL mask: " << std::endl;
465  for (int i = 0; i < 18; i++)
466  {
467  for (int j = 0; j < 2; j++)
468  {
469  for (int k = 0; k < 28; k++)
470  {
471  std::cout << fedUpdatedMask->hcalMask[i][j][k] << ", ";
472  }
473  }
474  }
475  std::cout << "--> HF mask: " << std::endl;
476  for (int i = 0; i < 18; i++)
477  {
478  for (int j = 0; j < 2; j++)
479  {
480  for (int k = 0; k < 4; k++)
481  {
482  std::cout << fedUpdatedMask->hfMask[i][j][k] << ", ";
483  }
484  }
485  }
486 
487  std::cout << std::endl;
488  }
489  else
490  {
491  //print error message
492  std::cout << "Trying to print contents of fedUpdatedMask, but it doesn't exist!" << std::endl;
493  }
494 }
int i
Definition: DBlmapReader.cc:9
bool ecalMask[18][2][28]
int j
Definition: DBlmapReader.cc:9
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:81
bool hcalMask[18][2][28]
tuple cout
Definition: gather_cfg.py:121
bool hfMask[18][2][4]
void L1RCTProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
finaloverridevirtual

Implements edm::EDProducer.

Definition at line 352 of file L1RCTProducer.cc.

References bunchCrossings, L1RCT::digiInput(), patCandidatesForDimuonsSequences_cff::ecal, ecalDigis, edm::hlt::Exception, edm::Event::getByLabel(), L1RCT::getIsolatedEGObjects(), L1RCT::getNonisolatedEGObjects(), L1RCT::getRegions(), patCandidatesForDimuonsSequences_cff::hcal, hcalDigis, i, j, L1RCT::processEvent(), rct, compare_using_db::sample, useEcal, and useHcal.

353 {
354 
355 
356  std::auto_ptr<L1CaloEmCollection> rctEmCands (new L1CaloEmCollection);
357  std::auto_ptr<L1CaloRegionCollection> rctRegions (new L1CaloRegionCollection);
358 
359 
360  if(!(ecalDigis.size()==hcalDigis.size()&&hcalDigis.size()==bunchCrossings.size()))
361  throw cms::Exception("BadInput")
362  << "From what I see the number of your your ECAL input digi collections.\n"
363  <<"is different from the size of your HCAL digi input collections\n"
364  <<"or the size of your BX factor collection"
365  <<"They must be the same to correspond to the same Bxs\n"
366  << "It does not matter if one of them is empty\n";
367 
368 
369 
370 
371  // loop through and process each bx
372  for (unsigned short sample = 0; sample < bunchCrossings.size(); sample++)
373  {
376 
379 
380 
381  if(useHcal&&event.getByLabel(hcalDigis[sample], hcal))
382  hcalIn = *hcal;
383 
384  if(useEcal&&event.getByLabel(ecalDigis[sample],ecal))
385  ecalIn = *ecal;
386 
387  rct->digiInput(ecalIn,hcalIn);
388  rct->processEvent();
389 
390  // Stuff to create
391  for (int j = 0; j<18; j++)
392  {
393  L1CaloEmCollection isolatedEGObjects = rct->getIsolatedEGObjects(j);
394  L1CaloEmCollection nonisolatedEGObjects = rct->getNonisolatedEGObjects(j);
395  for (int i = 0; i<4; i++)
396  {
397  isolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
398  nonisolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
399  rctEmCands->push_back(isolatedEGObjects.at(i));
400  rctEmCands->push_back(nonisolatedEGObjects.at(i));
401  }
402  }
403 
404 
405  for (int i = 0; i < 18; i++)
406  {
407  std::vector<L1CaloRegion> regions = rct->getRegions(i);
408  for (int j = 0; j < 22; j++)
409  {
410  regions.at(j).setBx(bunchCrossings[sample]);
411  rctRegions->push_back(regions.at(j));
412  }
413  }
414 
415  }
416 
417 
418  //putting stuff back into event
419  event.put(rctEmCands);
420  event.put(rctRegions);
421 
422 }
int i
Definition: DBlmapReader.cc:9
std::vector< L1CaloEmCand > L1CaloEmCollection
std::vector< L1CaloRegion > getRegions(unsigned crate)
Definition: L1RCT.cc:366
L1CaloEmCollection getNonisolatedEGObjects(unsigned crate)
Definition: L1RCT.cc:352
std::vector< edm::InputTag > hcalDigis
Definition: L1RCTProducer.h:73
std::vector< edm::InputTag > ecalDigis
Definition: L1RCTProducer.h:72
std::vector< int > bunchCrossings
Definition: L1RCTProducer.h:74
L1CaloEmCollection getIsolatedEGObjects(unsigned crate)
Definition: L1RCT.cc:335
int j
Definition: DBlmapReader.cc:9
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void processEvent()
Definition: L1RCT.cc:36
void digiInput(const EcalTrigPrimDigiCollection &ecalCollection, const HcalTrigPrimDigiCollection &hcalCollection)
Definition: L1RCT.cc:116
std::vector< L1CaloRegion > L1CaloRegionCollection
void L1RCTProducer::updateConfiguration ( const edm::EventSetup eventSetup)

Definition at line 106 of file L1RCTProducer.cc.

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

Referenced by beginRun().

107 {
108  // Refresh configuration information every event
109  // Hopefully, this does not take too much time
110  // There should be a call back function in future to
111  // handle changes in configuration
112  // parameters to configure RCT (thresholds, etc)
113  edm::ESHandle<L1RCTParameters> rctParameters;
114  eventSetup.get<L1RCTParametersRcd>().get(conditionsLabel, rctParameters);
115  const L1RCTParameters* r = rctParameters.product();
116 
117  //SCALES
118 
119  // energy scale to convert eGamma output
121  eventSetup.get<L1EmEtScaleRcd>().get(conditionsLabel, emScale);
122  const L1CaloEtScale* s = emScale.product();
123 
124  // get energy scale to convert input from ECAL
126  eventSetup.get<L1CaloEcalScaleRcd>().get(conditionsLabel, ecalScale);
127  const L1CaloEcalScale* e = ecalScale.product();
128 
129  // get energy scale to convert input from HCAL
131  eventSetup.get<L1CaloHcalScaleRcd>().get(conditionsLabel, hcalScale);
132  const L1CaloHcalScale* h = hcalScale.product();
133 
134  // set scales
137 
140 }
std::string conditionsLabel
Definition: L1RCTProducer.h:78
L1RCTLookupTables * rctLookupTables
Definition: L1RCTProducer.h:68
void setHcalScale(const L1CaloHcalScale *hcalScale)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void setL1CaloEtScale(const L1CaloEtScale *etScale)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
void setEcalScale(const L1CaloEcalScale *ecalScale)
void setRCTParameters(const L1RCTParameters *rctParameters)
void L1RCTProducer::updateFedVector ( const edm::EventSetup eventSetup,
bool  getFromOmds,
int  runNumber 
)

Definition at line 143 of file L1RCTProducer.cc.

References c_max, c_min, crateFED, fwrapper::cs, ebEvenFed, ebOddFed, patCandidatesForDimuonsSequences_cff::ecal, L1RCTChannelMask::ecalMask, eeFed, fedUpdatedMask, spr::find(), edm::EventSetup::get(), getFedVectorFromOmds(), getFedVectorFromRunInfo(), hbheFed, L1RCTChannelMask::hcalMask, hfFed, hfFedUp, L1RCTChannelMask::hfMask, i, j, relval_steps::k, maxBarrel, maxEndcap, maxHF, minBarrel, minEndcap, minHF, edm::ESHandle< class >::product(), rctLookupTables, L1RCTLookupTables::setChannelMask(), and L1RCTLookupTables::setNoisyChannelMask().

Referenced by beginLuminosityBlock(), and beginRun().

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

Member Data Documentation

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

Definition at line 74 of file L1RCTProducer.h.

Referenced by produce().

std::string L1RCTProducer::conditionsLabel
private

Definition at line 78 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 95 of file L1RCTProducer.h.

Referenced by updateFedVector().

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

Definition at line 72 of file L1RCTProducer.h.

Referenced by L1RCTProducer(), and produce().

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

Definition at line 75 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock().

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

Definition at line 73 of file L1RCTProducer.h.

Referenced by L1RCTProducer(), and produce().

const int L1RCTProducer::maxBarrel = 17
staticprivate

Definition at line 98 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::maxEndcap = 28
staticprivate

Definition at line 100 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::maxHF =32
staticprivate

Definition at line 102 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::minBarrel = 1
staticprivate

Definition at line 97 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::minEndcap = 17
staticprivate

Definition at line 99 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::minHF = 29
staticprivate

Definition at line 101 of file L1RCTProducer.h.

Referenced by updateFedVector().

unsigned int L1RCTProducer::queryDelayInLS
private

Definition at line 76 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock().

unsigned int L1RCTProducer::queryIntervalInLS
private

Definition at line 77 of file L1RCTProducer.h.

Referenced by beginLuminosityBlock().

L1RCT* L1RCTProducer::rct
private

Definition at line 69 of file L1RCTProducer.h.

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

L1RCTLookupTables* L1RCTProducer::rctLookupTables
private

Definition at line 68 of file L1RCTProducer.h.

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

bool L1RCTProducer::useEcal
private

Definition at line 70 of file L1RCTProducer.h.

Referenced by produce().

bool L1RCTProducer::useHcal
private

Definition at line 71 of file L1RCTProducer.h.

Referenced by produce().