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
 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
 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
 
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, c_max = hfFed
}
 

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][5]
 
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
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 
c_max 

Definition at line 84 of file L1RCTProducer.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file L1RCTProducer.cc.

References ecalDigis, and hcalDigis.

38  :
41  useEcal(conf.getParameter<bool>("useEcal")),
42  useHcal(conf.getParameter<bool>("useHcal")),
43  ecalDigis(conf.getParameter<std::vector<edm::InputTag> >("ecalDigis")),
44  hcalDigis(conf.getParameter<std::vector<edm::InputTag> >("hcalDigis")),
45  bunchCrossings(conf.getParameter<std::vector<int> >("BunchCrossings")),
46  getFedsFromOmds(conf.getParameter<bool>("getFedsFromOmds")),
47  queryDelayInLS(conf.getParameter<unsigned int>("queryDelayInLS")),
48  queryIntervalInLS(conf.getParameter<unsigned int>("queryIntervalInLS")),
49  conditionsLabel(conf.getParameter<std::string>("conditionsLabel")),
51 {
52  produces<L1CaloEmCollection>();
53  produces<L1CaloRegionCollection>();
54 
55  for(unsigned int ihc=0;ihc<hcalDigis.size();ihc++){
56  consumes<edm::SortedCollection<HcalTriggerPrimitiveDigi,edm::StrictWeakOrdering<HcalTriggerPrimitiveDigi> > >(hcalDigis[ihc]);
57  }
58 
59  for(unsigned int iec=0;iec<ecalDigis.size();iec++){
60  consumes<edm::SortedCollection<EcalTriggerPrimitiveDigi,edm::StrictWeakOrdering<EcalTriggerPrimitiveDigi> > >(ecalDigis[iec]);
61  }
62 }
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 64 of file L1RCTProducer.cc.

References fedUpdatedMask, rct, and rctLookupTables.

65 {
66  if(rct != 0) delete rct;
67  if(rctLookupTables != 0) delete rctLookupTables;
68  if(fedUpdatedMask != 0) delete fedUpdatedMask;
69 }
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 84 of file L1RCTProducer.cc.

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

85 {
86  // check LS number every LS, if the checkOMDS flag is set AND it's the right LS, update the FED vector from OMDS
87  // can pass the flag as the bool?? but only check LS number if flag is true anyhow
88  if (getFedsFromOmds)
89  {
90  unsigned int nLumi = lumiSeg.luminosityBlock(); // doesn't even need the (unsigned int) cast because LuminosityBlockNumber_t is already an unsigned int
91  // LS count starts at 1, want to be able to delay 0 LS's intuitively
92  if ( ( (nLumi - 1) == queryDelayInLS)
93  || (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
94  {
95  int runNumber = lumiSeg.run();
96  // std::cout << "Lumi section for this FED vector update is " << nLumi << std::endl;
97  updateFedVector(context,true,runNumber); // OMDS
98  }
99  else if (queryIntervalInLS <= 0)
100  {
101  // don't do interval checking... cout message??
102  }
103  }
104 }
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 72 of file L1RCTProducer.cc.

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

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

309 {
310 
311  // std::cout << "Getting FED vector from my specific ES RunInfo object" << std::endl;
312 
313  // get FULL FED vector from RunInfo object specifically created to have OMDS fed vector
315  eventSetup.get<RunInfoRcd>().get("OmdsFedVector",sum); // using label to get my specific instance of RunInfo
316  if (sum.isValid())
317  {
318  const RunInfo* summary=sum.product();
319  const std::vector<int> fedvector = summary->m_fed_in;
320 
321  return fedvector;
322  }
323  else
324  {
325  return getFedVectorFromRunInfo(eventSetup);
326  }
327 
328 }
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 295 of file L1RCTProducer.cc.

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

Referenced by getFedVectorFromOmds(), and updateFedVector().

296 {
297  // std::cout << "Getting FED vector from standard RunInfo object" << std::endl;
298  // get FULL FED vector from RUNINFO
300  eventSetup.get<RunInfoRcd>().get(sum);
301  const RunInfo* summary=sum.product();
302  const std::vector<int> fedvector = summary->m_fed_in;
303 
304  return fedvector;
305 }
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 405 of file L1RCTProducer.cc.

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

406 {
407  std::cout << "Contents of given fedVector: ";
408  std::copy(fedVector.begin(), fedVector.end(), std::ostream_iterator<int>(std::cout, ", "));
409  std::cout << std::endl;
410 }
tuple cout
Definition: gather_cfg.py:121
void L1RCTProducer::printUpdatedFedMask ( )

Definition at line 413 of file L1RCTProducer.cc.

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

414 {
415  if (fedUpdatedMask != 0)
416  {
418  }
419  else
420  {
421  std::cout << "Trying to print contents of fedUpdatedMask, but it doesn't exist!" << std::endl;
422  }
423 }
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 426 of file L1RCTProducer.cc.

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

427 {
428  if (fedUpdatedMask != 0)
429  {
430  // print contents of fedvector
431  std::cout << "Contents of fedUpdatedMask: ";
432 // std::copy(fedUpdatedMask.begin(), fedUpdatedMask.end(), std::ostream_iterator<int>(std::cout, ", "));
433  std::cout << "--> ECAL mask: " << std::endl;
434  for (int i = 0; i < 18; i++)
435  {
436  for (int j = 0; j < 2; j++)
437  {
438  for (int k = 0; k < 28; k++)
439  {
440  std::cout << fedUpdatedMask->ecalMask[i][j][k] << ", ";
441  }
442  }
443  }
444  std::cout << "--> HCAL mask: " << std::endl;
445  for (int i = 0; i < 18; i++)
446  {
447  for (int j = 0; j < 2; j++)
448  {
449  for (int k = 0; k < 28; k++)
450  {
451  std::cout << fedUpdatedMask->hcalMask[i][j][k] << ", ";
452  }
453  }
454  }
455  std::cout << "--> HF mask: " << std::endl;
456  for (int i = 0; i < 18; i++)
457  {
458  for (int j = 0; j < 2; j++)
459  {
460  for (int k = 0; k < 4; k++)
461  {
462  std::cout << fedUpdatedMask->hfMask[i][j][k] << ", ";
463  }
464  }
465  }
466 
467  std::cout << std::endl;
468  }
469  else
470  {
471  //print error message
472  std::cout << "Trying to print contents of fedUpdatedMask, but it doesn't exist!" << std::endl;
473  }
474 }
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 332 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.

333 {
334 
335 
336  std::auto_ptr<L1CaloEmCollection> rctEmCands (new L1CaloEmCollection);
337  std::auto_ptr<L1CaloRegionCollection> rctRegions (new L1CaloRegionCollection);
338 
339 
340  if(!(ecalDigis.size()==hcalDigis.size()&&hcalDigis.size()==bunchCrossings.size()))
341  throw cms::Exception("BadInput")
342  << "From what I see the number of your your ECAL input digi collections.\n"
343  <<"is different from the size of your HCAL digi input collections\n"
344  <<"or the size of your BX factor collection"
345  <<"They must be the same to correspond to the same Bxs\n"
346  << "It does not matter if one of them is empty\n";
347 
348 
349 
350 
351  // loop through and process each bx
352  for (unsigned short sample = 0; sample < bunchCrossings.size(); sample++)
353  {
356 
359 
360 
361  if(useHcal&&event.getByLabel(hcalDigis[sample], hcal))
362  hcalIn = *hcal;
363 
364  if(useEcal&&event.getByLabel(ecalDigis[sample],ecal))
365  ecalIn = *ecal;
366 
367  rct->digiInput(ecalIn,hcalIn);
368  rct->processEvent();
369 
370  // Stuff to create
371  for (int j = 0; j<18; j++)
372  {
373  L1CaloEmCollection isolatedEGObjects = rct->getIsolatedEGObjects(j);
374  L1CaloEmCollection nonisolatedEGObjects = rct->getNonisolatedEGObjects(j);
375  for (int i = 0; i<4; i++)
376  {
377  isolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
378  nonisolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
379  rctEmCands->push_back(isolatedEGObjects.at(i));
380  rctEmCands->push_back(nonisolatedEGObjects.at(i));
381  }
382  }
383 
384 
385  for (int i = 0; i < 18; i++)
386  {
387  std::vector<L1CaloRegion> regions = rct->getRegions(i);
388  for (int j = 0; j < 22; j++)
389  {
390  regions.at(j).setBx(bunchCrossings[sample]);
391  rctRegions->push_back(regions.at(j));
392  }
393  }
394 
395  }
396 
397 
398  //putting stuff back into event
399  event.put(rctEmCands);
400  event.put(rctRegions);
401 
402 }
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 108 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().

109 {
110  // Refresh configuration information every event
111  // Hopefully, this does not take too much time
112  // There should be a call back function in future to
113  // handle changes in configuration
114  // parameters to configure RCT (thresholds, etc)
115  edm::ESHandle<L1RCTParameters> rctParameters;
116  eventSetup.get<L1RCTParametersRcd>().get(conditionsLabel, rctParameters);
117  const L1RCTParameters* r = rctParameters.product();
118 
119  //SCALES
120 
121  // energy scale to convert eGamma output
123  eventSetup.get<L1EmEtScaleRcd>().get(conditionsLabel, emScale);
124  const L1CaloEtScale* s = emScale.product();
125 
126  // get energy scale to convert input from ECAL
128  eventSetup.get<L1CaloEcalScaleRcd>().get(conditionsLabel, ecalScale);
129  const L1CaloEcalScale* e = ecalScale.product();
130 
131  // get energy scale to convert input from HCAL
133  eventSetup.get<L1CaloHcalScaleRcd>().get(conditionsLabel, hcalScale);
134  const L1CaloHcalScale* h = hcalScale.product();
135 
136  // set scales
139 
142 }
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 145 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, L1RCTChannelMask::hfMask, i, j, roll_playback::k, maxBarrel, maxEndcap, maxHF, minBarrel, minEndcap, minHF, edm::ESHandle< class >::product(), rctLookupTables, L1RCTLookupTables::setChannelMask(), and L1RCTLookupTables::setNoisyChannelMask().

Referenced by beginLuminosityBlock(), and beginRun().

146 {
147  // list of RCT channels to mask
149  eventSetup.get<L1RCTChannelMaskRcd>().get(channelMask);
150  const L1RCTChannelMask* cEs = channelMask.product();
151 
152 
153  // list of Noisy RCT channels to mask
155  eventSetup.get<L1RCTNoisyChannelMaskRcd>().get(hotChannelMask);
156  const L1RCTNoisyChannelMask* cEsNoise = hotChannelMask.product();
158 
159 
160 
161  //Update the channel mask according to the FED VECTOR
162  //This is the beginning of run. We delete the old
163  //create the new and set it in the LUTs
164 
165  if(fedUpdatedMask!=0) delete fedUpdatedMask;
166 
168  // copy a constant object
169  for (int i = 0; i < 18; i++)
170  {
171  for (int j = 0; j < 2; j++)
172  {
173  for (int k = 0; k < 28; k++)
174  {
175  fedUpdatedMask->ecalMask[i][j][k] = cEs->ecalMask[i][j][k];
176  fedUpdatedMask->hcalMask[i][j][k] = cEs->hcalMask[i][j][k] ;
177  }
178  for (int k = 0; k < 4; k++)
179  {
180  fedUpdatedMask->hfMask[i][j][k] = cEs->hfMask[i][j][k];
181  }
182  }
183  }
184 
185 
186 // // adding fed mask into channel mask
187 
188  const std::vector<int> Feds = getFromOmds ? getFedVectorFromOmds(eventSetup) : getFedVectorFromRunInfo(eventSetup); // so can create/initialize/assign const quantity in one line accounting for if statement
189  // wikipedia says this is exactly what it's for: http://en.wikipedia.org/wiki/%3F:#C.2B.2B
190 
191 // std::cout << "Contents of ";
192 // std::cout << (getFromOmds ? "OMDS RunInfo" : "standard RunInfo");
193 // std::cout << " FED vector" << std::endl;
194 // printFedVector(Feds);
195 
196  std::vector<int> caloFeds; // pare down the feds to the interesting ones
197  // is this unneccesary?
198  // Mike B : This will decrease the find speed so better do it
199  for(std::vector<int>::const_iterator cf = Feds.begin(); cf != Feds.end(); ++cf)
200  {
201  int fedNum = *cf;
202  if(fedNum > 600 && fedNum <724)
203  caloFeds.push_back(fedNum);
204  }
205 
206  for(int cr = 0; cr < 18; ++cr)
207  {
208 
209  for(crateSection cs = c_min; cs <= c_max; cs = crateSection(cs +1))
210  {
211  bool fedFound = false;
212 
213 
214  //Try to find the FED
215  std::vector<int>::iterator fv = std::find(caloFeds.begin(),caloFeds.end(),crateFED[cr][cs]);
216  if(fv!=caloFeds.end())
217  fedFound = true;
218 
219  if(!fedFound) {
220  int eta_min=0;
221  int eta_max=0;
222  bool phi_even[2] = {false};//, phi_odd = false;
223  bool ecal=false;
224 
225  switch (cs) {
226  case ebEvenFed :
227  eta_min = minBarrel;
228  eta_max = maxBarrel;
229  phi_even[0] = true;
230  ecal = true;
231  break;
232 
233  case ebOddFed:
234  eta_min = minBarrel;
235  eta_max = maxBarrel;
236  phi_even[1] = true;
237  ecal = true;
238  break;
239 
240  case eeFed:
241  eta_min = minEndcap;
242  eta_max = maxEndcap;
243  phi_even[0] = true;
244  phi_even[1] = true;
245  ecal = true;
246  break;
247 
248  case hbheFed:
249  eta_min = minBarrel;
250  eta_max = maxEndcap;
251  phi_even[0] = true;
252  phi_even[1] = true;
253  ecal = false;
254  break;
255 
256  case hfFed:
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  default:
265  break;
266 
267  }
268  for(int ieta = eta_min; ieta <= eta_max; ++ieta)
269  {
270  if(ieta<=28) // barrel and endcap
271  for(int even = 0; even<=1 ; even++)
272  {
273  if(phi_even[even])
274  {
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 
292 
293 }
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]
static const int crateFED[18][5]
Definition: L1RCTProducer.h:96
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]
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},
{611, 612, 602, 700, 718},
{627, 610, 601, 716, 722},
{625, 626, 609, 714, 722},
{623, 624, 608, 712, 722},
{621, 622, 607, 710, 720},
{619, 620, 606, 708, 720},
{617, 618, 605, 706, 720},
{615, 616, 604, 704, 718},
{631, 632, 648, 703, 719},
{629, 630, 647, 701, 719},
{645, 628, 646, 717, 723},
{643, 644, 654, 715, 723},
{641, 642, 653, 713, 723},
{639, 640, 652, 711, 721},
{637, 638, 651, 709, 721},
{635, 636, 650, 707, 721},
{633, 634, 649, 705, 719}}

Definition at line 96 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().