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::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 83 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")),
50 {
51  produces<L1CaloEmCollection>();
52  produces<L1CaloRegionCollection>();
53 
54  for(unsigned int ihc=0;ihc<hcalDigis.size();ihc++){
55  consumes<edm::SortedCollection<HcalTriggerPrimitiveDigi,edm::StrictWeakOrdering<HcalTriggerPrimitiveDigi> > >(hcalDigis[ihc]);
56  }
57 
58  for(unsigned int iec=0;iec<ecalDigis.size();iec++){
59  consumes<edm::SortedCollection<EcalTriggerPrimitiveDigi,edm::StrictWeakOrdering<EcalTriggerPrimitiveDigi> > >(ecalDigis[iec]);
60  }
61 }
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:80
unsigned int queryIntervalInLS
Definition: L1RCTProducer.h:77
Definition: L1RCT.h:20
L1RCTProducer::~L1RCTProducer ( )
virtual

Definition at line 63 of file L1RCTProducer.cc.

References fedUpdatedMask, rct, and rctLookupTables.

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

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 83 of file L1RCTProducer.cc.

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

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

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

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

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

Definition at line 294 of file L1RCTProducer.cc.

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

Referenced by getFedVectorFromOmds(), and updateFedVector().

295 {
296  // std::cout << "Getting FED vector from standard RunInfo object" << std::endl;
297  // get FULL FED vector from RUNINFO
299  eventSetup.get<RunInfoRcd>().get(sum);
300  const RunInfo* summary=sum.product();
301  const std::vector<int> fedvector = summary->m_fed_in;
302 
303  return fedvector;
304 }
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:62
void L1RCTProducer::printFedVector ( const std::vector< int > &  fedVector)

Definition at line 404 of file L1RCTProducer.cc.

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

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

Definition at line 412 of file L1RCTProducer.cc.

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

413 {
414  if (fedUpdatedMask != 0)
415  {
417  }
418  else
419  {
420  std::cout << "Trying to print contents of fedUpdatedMask, but it doesn't exist!" << std::endl;
421  }
422 }
void print(std::ostream &s) const
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:80
tuple cout
Definition: gather_cfg.py:121
void L1RCTProducer::printUpdatedFedMaskVerbose ( )

Definition at line 425 of file L1RCTProducer.cc.

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

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

332 {
333 
334 
335  std::auto_ptr<L1CaloEmCollection> rctEmCands (new L1CaloEmCollection);
336  std::auto_ptr<L1CaloRegionCollection> rctRegions (new L1CaloRegionCollection);
337 
338 
339  if(!(ecalDigis.size()==hcalDigis.size()&&hcalDigis.size()==bunchCrossings.size()))
340  throw cms::Exception("BadInput")
341  << "From what I see the number of your your ECAL input digi collections.\n"
342  <<"is different from the size of your HCAL digi input collections\n"
343  <<"or the size of your BX factor collection"
344  <<"They must be the same to correspond to the same Bxs\n"
345  << "It does not matter if one of them is empty\n";
346 
347 
348 
349 
350  // loop through and process each bx
351  for (unsigned short sample = 0; sample < bunchCrossings.size(); sample++)
352  {
355 
358 
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  {
372  L1CaloEmCollection isolatedEGObjects = rct->getIsolatedEGObjects(j);
373  L1CaloEmCollection nonisolatedEGObjects = rct->getNonisolatedEGObjects(j);
374  for (int i = 0; i<4; i++)
375  {
376  isolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
377  nonisolatedEGObjects.at(i).setBx(bunchCrossings[sample]);
378  rctEmCands->push_back(isolatedEGObjects.at(i));
379  rctEmCands->push_back(nonisolatedEGObjects.at(i));
380  }
381  }
382 
383 
384  for (int i = 0; i < 18; i++)
385  {
386  std::vector<L1CaloRegion> regions = rct->getRegions(i);
387  for (int j = 0; j < 22; j++)
388  {
389  regions.at(j).setBx(bunchCrossings[sample]);
390  rctRegions->push_back(regions.at(j));
391  }
392  }
393 
394  }
395 
396 
397  //putting stuff back into event
398  event.put(rctEmCands);
399  event.put(rctRegions);
400 
401 }
int i
Definition: DBlmapReader.cc:9
std::vector< L1CaloEmCand > L1CaloEmCollection
std::vector< L1CaloRegion > getRegions(unsigned crate)
Definition: L1RCT.cc:363
L1CaloEmCollection getNonisolatedEGObjects(unsigned crate)
Definition: L1RCT.cc:349
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:332
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 107 of file L1RCTProducer.cc.

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

108 {
109  // Refresh configuration information every event
110  // Hopefully, this does not take too much time
111  // There should be a call back function in future to
112  // handle changes in configuration
113  // parameters to configure RCT (thresholds, etc)
114  edm::ESHandle<L1RCTParameters> rctParameters;
115  eventSetup.get<L1RCTParametersRcd>().get(rctParameters);
116  const L1RCTParameters* r = rctParameters.product();
117 
118  //SCALES
119 
120  // energy scale to convert eGamma output
122  eventSetup.get<L1EmEtScaleRcd>().get(emScale);
123  const L1CaloEtScale* s = emScale.product();
124 
125  // get energy scale to convert input from ECAL
127  eventSetup.get<L1CaloEcalScaleRcd>().get(ecalScale);
128  const L1CaloEcalScale* e = ecalScale.product();
129 
130  // get energy scale to convert input from HCAL
132  eventSetup.get<L1CaloHcalScaleRcd>().get(hcalScale);
133  const L1CaloHcalScale* h = hcalScale.product();
134 
135  // set scales
138 
141 }
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:62
void setEcalScale(const L1CaloEcalScale *ecalScale)
void setRCTParameters(const L1RCTParameters *rctParameters)
void L1RCTProducer::updateFedVector ( const edm::EventSetup eventSetup,
bool  getFromOmds,
int  runNumber 
)

Definition at line 144 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, gen::k, maxBarrel, maxEndcap, maxHF, minBarrel, minEndcap, minHF, edm::ESHandle< class >::product(), rctLookupTables, L1RCTLookupTables::setChannelMask(), and L1RCTLookupTables::setNoisyChannelMask().

Referenced by beginLuminosityBlock(), and beginRun().

145 {
146  // list of RCT channels to mask
148  eventSetup.get<L1RCTChannelMaskRcd>().get(channelMask);
149  const L1RCTChannelMask* cEs = channelMask.product();
150 
151 
152  // list of Noisy RCT channels to mask
154  eventSetup.get<L1RCTNoisyChannelMaskRcd>().get(hotChannelMask);
155  const L1RCTNoisyChannelMask* cEsNoise = hotChannelMask.product();
157 
158 
159 
160  //Update the channel mask according to the FED VECTOR
161  //This is the beginning of run. We delete the old
162  //create the new and set it in the LUTs
163 
164  if(fedUpdatedMask!=0) delete fedUpdatedMask;
165 
167  // copy a constant object
168  for (int i = 0; i < 18; i++)
169  {
170  for (int j = 0; j < 2; j++)
171  {
172  for (int k = 0; k < 28; k++)
173  {
174  fedUpdatedMask->ecalMask[i][j][k] = cEs->ecalMask[i][j][k];
175  fedUpdatedMask->hcalMask[i][j][k] = cEs->hcalMask[i][j][k] ;
176  }
177  for (int k = 0; k < 4; k++)
178  {
179  fedUpdatedMask->hfMask[i][j][k] = cEs->hfMask[i][j][k];
180  }
181  }
182  }
183 
184 
185 // // adding fed mask into channel mask
186 
187  const std::vector<int> Feds = getFromOmds ? getFedVectorFromOmds(eventSetup) : getFedVectorFromRunInfo(eventSetup); // 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  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  {
200  int fedNum = *cf;
201  if(fedNum > 600 && fedNum <724)
202  caloFeds.push_back(fedNum);
203  }
204 
205  for(int cr = 0; cr < 18; ++cr)
206  {
207 
208  for(crateSection cs = c_min; cs <= c_max; cs = crateSection(cs +1))
209  {
210  bool fedFound = false;
211 
212 
213  //Try to find the FED
214  std::vector<int>::iterator fv = std::find(caloFeds.begin(),caloFeds.end(),crateFED[cr][cs]);
215  if(fv!=caloFeds.end())
216  fedFound = true;
217 
218  if(!fedFound) {
219  int eta_min=0;
220  int eta_max=0;
221  bool phi_even[2] = {false};//, phi_odd = false;
222  bool ecal=false;
223 
224  switch (cs) {
225  case ebEvenFed :
226  eta_min = minBarrel;
227  eta_max = maxBarrel;
228  phi_even[0] = true;
229  ecal = true;
230  break;
231 
232  case ebOddFed:
233  eta_min = minBarrel;
234  eta_max = maxBarrel;
235  phi_even[1] = true;
236  ecal = true;
237  break;
238 
239  case eeFed:
240  eta_min = minEndcap;
241  eta_max = maxEndcap;
242  phi_even[0] = true;
243  phi_even[1] = true;
244  ecal = true;
245  break;
246 
247  case hbheFed:
248  eta_min = minBarrel;
249  eta_max = maxEndcap;
250  phi_even[0] = true;
251  phi_even[1] = true;
252  ecal = false;
253  break;
254 
255  case hfFed:
256  eta_min = minHF;
257  eta_max = maxHF;
258 
259  phi_even[0] = true;
260  phi_even[1] = true;
261  ecal = false;
262  break;
263  default:
264  break;
265 
266  }
267  for(int ieta = eta_min; ieta <= eta_max; ++ieta)
268  {
269  if(ieta<=28) // barrel and endcap
270  for(int even = 0; even<=1 ; even++)
271  {
272  if(phi_even[even])
273  {
274  if(ecal)
275  fedUpdatedMask->ecalMask[cr][even][ieta-1] = true;
276  else
277  fedUpdatedMask->hcalMask[cr][even][ieta-1] = true;
278  }
279  }
280  else
281  for(int even = 0; even<=1 ; even++)
282  if(phi_even[even])
283  fedUpdatedMask->hfMask[cr][even][ieta-29] = true;
284 
285  }
286  }
287  }
288  }
289 
291 
292 }
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:95
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:96
int k[5][pyjets_maxn]
static const int minEndcap
Definition: L1RCTProducer.h:98
L1RCTChannelMask * fedUpdatedMask
Definition: L1RCTProducer.h:80
const T & get() const
Definition: EventSetup.h:55
static const int maxBarrel
Definition: L1RCTProducer.h:97
T const * product() const
Definition: ESHandle.h:62
static const int maxEndcap
Definition: L1RCTProducer.h:99
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().

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 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 97 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::maxEndcap = 28
staticprivate

Definition at line 99 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::maxHF =32
staticprivate

Definition at line 101 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::minBarrel = 1
staticprivate

Definition at line 96 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::minEndcap = 17
staticprivate

Definition at line 98 of file L1RCTProducer.h.

Referenced by updateFedVector().

const int L1RCTProducer::minHF = 29
staticprivate

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