CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
sistrip::ExcludedFEDListProducer Class Reference

#include <ExcludedFEDListProducer.h>

Inheritance diagram for sistrip::ExcludedFEDListProducer:
edm::stream::EDProducer<>

Public Member Functions

 ExcludedFEDListProducer (const edm::ParameterSet &pset)
 constructor More...
 
void produce (edm::Event &event, const edm::EventSetup &es) override
 
 ~ExcludedFEDListProducer () override
 default constructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcdcablingToken_
 
DetIdVector detids_
 
unsigned int runNumber_
 
const edm::EDGetTokenT< FEDRawDataCollectiontoken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 27 of file ExcludedFEDListProducer.h.

Constructor & Destructor Documentation

◆ ExcludedFEDListProducer()

sistrip::ExcludedFEDListProducer::ExcludedFEDListProducer ( const edm::ParameterSet pset)

constructor

Definition at line 20 of file ExcludedFEDListProducer.cc.

21  : runNumber_(0), token_(consumes(pset.getParameter<edm::InputTag>("ProductLabel"))), cablingToken_(esConsumes()) {
22  produces<DetIdVector>();
23  }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const edm::EDGetTokenT< FEDRawDataCollection > token_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > cablingToken_

◆ ~ExcludedFEDListProducer()

sistrip::ExcludedFEDListProducer::~ExcludedFEDListProducer ( )
override

default constructor

Definition at line 25 of file ExcludedFEDListProducer.cc.

25 {}

Member Function Documentation

◆ fillDescriptions()

void sistrip::ExcludedFEDListProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 27 of file ExcludedFEDListProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

27  {
29  desc.add<edm::InputTag>("ProductLabel", edm::InputTag("rawDataCollector"));
30  descriptions.add("siStripExcludedFEDListProducer", desc);
31  }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void sistrip::ExcludedFEDListProducer::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 33 of file ExcludedFEDListProducer.cc.

References cablingToken_, detids_, emptyDetIdVector, FEDRawDataCollection::FEDData(), edm::EventSetup::getData(), input, sistrip::invalid32_, runNumber_, and token_.

33  {
34  if (runNumber_ != event.run()) {
35  runNumber_ = event.run();
36 
37  auto const& cabling = es.getData(cablingToken_);
38 
41  // Reserve space in bad module list
42  detids_.reserve(100);
43 
45  event.getByToken(token_, buffers);
46 
47  // Retrieve FED ids from cabling map and iterate through
48  for (auto ifed = cabling.fedIds().begin(); ifed != cabling.fedIds().end(); ifed++) {
49  // ignore trigger FED
50  // if ( *ifed == triggerFedId_ ) { continue; }
51 
52  // Retrieve FED raw data for given FED
53  const FEDRawData& input = buffers->FEDData(static_cast<int>(*ifed));
54  // The FEDData contains a vector<unsigned char>. Check the size of this vector:
55 
56  if (input.size() == 0) {
57  // std::cout << "Input size == 0 for FED number " << static_cast<int>(*ifed) << std::endl;
58  // get the cabling connections for this FED
59  auto conns = cabling.fedConnections(*ifed);
60  // Mark FED modules as bad
61  detids_.reserve(detids_.size() + conns.size());
62  for (auto iconn = conns.begin(); iconn != conns.end(); ++iconn) {
63  if (!iconn->detId() || iconn->detId() == sistrip::invalid32_)
64  continue;
65  detids_.push_back(iconn->detId()); //@@ Possible multiple entries
66  }
67  }
68  }
69  }
70 
71  // for( unsigned int it = 0; it < detids->size(); ++it ) {
72  // std::cout << "detId = " << (*detids)[it]() << std::endl;
73  // }
74 
75  event.put(std::make_unique<DetIdVector>(detids_));
76  }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
static const uint32_t invalid32_
Definition: Constants.h:15
const edm::EDGetTokenT< FEDRawDataCollection > token_
static std::string const input
Definition: EdmProvDump.cc:50
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< DetId > DetIdVector
Definition: DetIdVector.h:7
static const std::vector< DetId > emptyDetIdVector
Definition: CaloTopology.cc:27
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > cablingToken_
Definition: event.py:1

Member Data Documentation

◆ cablingToken_

edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> sistrip::ExcludedFEDListProducer::cablingToken_
private

Definition at line 39 of file ExcludedFEDListProducer.h.

Referenced by produce().

◆ detids_

DetIdVector sistrip::ExcludedFEDListProducer::detids_
private

Definition at line 41 of file ExcludedFEDListProducer.h.

Referenced by produce().

◆ runNumber_

unsigned int sistrip::ExcludedFEDListProducer::runNumber_
private

Definition at line 37 of file ExcludedFEDListProducer.h.

Referenced by produce().

◆ token_

const edm::EDGetTokenT<FEDRawDataCollection> sistrip::ExcludedFEDListProducer::token_
private

Definition at line 38 of file ExcludedFEDListProducer.h.

Referenced by produce().