CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

void beginRun (const edm::Run &run, const edm::EventSetup &es) override
 
 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

const SiStripFedCablingcabling_
 
edm::ESGetToken
< SiStripFedCabling,
SiStripFedCablingRcd
cablingToken_
 
uint32_t cacheId_
 
DetIdCollection detids_
 
unsigned int runNumber_
 
const edm::EDGetTokenT
< FEDRawDataCollection
token_
 

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

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

constructor

Definition at line 20 of file ExcludedFEDListProducer.cc.

21  : runNumber_(0),
22  cacheId_(0),
23  cabling_(nullptr),
24  token_(consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("ProductLabel"))),
25  cablingToken_(esConsumes<SiStripFedCabling, SiStripFedCablingRcd, edm::Transition::BeginRun>()) {
26  produces<DetIdCollection>();
27  }
const edm::EDGetTokenT< FEDRawDataCollection > token_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > cablingToken_
sistrip::ExcludedFEDListProducer::~ExcludedFEDListProducer ( )
override

default constructor

Definition at line 29 of file ExcludedFEDListProducer.cc.

29 {}

Member Function Documentation

void sistrip::ExcludedFEDListProducer::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
override

Definition at line 31 of file ExcludedFEDListProducer.cc.

References c, cabling_, cablingToken_, cacheId_, edm::EventSetup::get(), edm::EventSetup::getHandle(), and edm::ESHandle< class >::product().

31  {
32  uint32_t cacheId = es.get<SiStripFedCablingRcd>().cacheIdentifier();
33 
34  if (cacheId_ != cacheId) {
35  cacheId_ = cacheId;
36 
38  cabling_ = c.product();
39  }
40  }
const edm::EventSetup & c
T const * product() const
Definition: ESHandle.h:86
T get() const
Definition: EventSetup.h:82
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > cablingToken_
void sistrip::ExcludedFEDListProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 42 of file ExcludedFEDListProducer.cc.

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

42  {
44  desc.add<edm::InputTag>("ProductLabel", edm::InputTag("rawDataCollector"));
45  descriptions.add("siStripExcludedFEDListProducer", desc);
46  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void sistrip::ExcludedFEDListProducer::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 48 of file ExcludedFEDListProducer.cc.

References cabling_, detids_, SiStripFedCabling::fedConnections(), SiStripFedCabling::fedIds(), input, sistrip::invalid32_, edm::EDCollection< T >::push_back(), edm::EDCollection< T >::reserve(), edm::Event::run(), runNumber_, edm::EDCollection< T >::size(), FEDRawData::size(), edm::EDCollection< T >::swap(), and token_.

48  {
49  if (runNumber_ != event.run()) {
50  runNumber_ = event.run();
51 
52  DetIdCollection emptyDetIdCollection;
53  detids_.swap(emptyDetIdCollection);
54  // Reserve space in bad module list
55  detids_.reserve(100);
56 
58  event.getByToken(token_, buffers);
59 
60  // Retrieve FED ids from cabling map and iterate through
61  for (auto ifed = cabling_->fedIds().begin(); ifed != cabling_->fedIds().end(); ifed++) {
62  // ignore trigger FED
63  // if ( *ifed == triggerFedId_ ) { continue; }
64 
65  // Retrieve FED raw data for given FED
66  const FEDRawData& input = buffers->FEDData(static_cast<int>(*ifed));
67  // The FEDData contains a vector<unsigned char>. Check the size of this vector:
68 
69  if (input.size() == 0) {
70  // std::cout << "Input size == 0 for FED number " << static_cast<int>(*ifed) << std::endl;
71  // get the cabling connections for this FED
72  auto conns = cabling_->fedConnections(*ifed);
73  // Mark FED modules as bad
74  detids_.reserve(detids_.size() + conns.size());
75  for (auto iconn = conns.begin(); iconn != conns.end(); ++iconn) {
76  if (!iconn->detId() || iconn->detId() == sistrip::invalid32_)
77  continue;
78  detids_.push_back(iconn->detId()); //@@ Possible multiple entries
79  }
80  }
81  }
82  }
83 
84  // for( unsigned int it = 0; it < detids->size(); ++it ) {
85  // std::cout << "detId = " << (*detids)[it]() << std::endl;
86  // }
87 
88  event.put(std::make_unique<DetIdCollection>(detids_));
89  }
size_type size() const
Definition: EDCollection.h:82
static const uint32_t invalid32_
Definition: Constants.h:15
void push_back(T const &t)
Definition: EDCollection.h:60
const edm::EDGetTokenT< FEDRawDataCollection > token_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
static std::string const input
Definition: EdmProvDump.cc:47
FedsConstIterRange fedIds() const
RunNumber_t run() const
Definition: Event.h:109
void reserve(size_type n)
Definition: EDCollection.h:92
ConnsConstIterRange fedConnections(uint16_t fed_id) const
void swap(EDCollection< T > &other)
Definition: EDCollection.h:65

Member Data Documentation

const SiStripFedCabling* sistrip::ExcludedFEDListProducer::cabling_
private

Definition at line 40 of file ExcludedFEDListProducer.h.

Referenced by beginRun(), and produce().

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

Definition at line 42 of file ExcludedFEDListProducer.h.

Referenced by beginRun().

uint32_t sistrip::ExcludedFEDListProducer::cacheId_
private

Definition at line 39 of file ExcludedFEDListProducer.h.

Referenced by beginRun().

DetIdCollection sistrip::ExcludedFEDListProducer::detids_
private

Definition at line 44 of file ExcludedFEDListProducer.h.

Referenced by produce().

unsigned int sistrip::ExcludedFEDListProducer::runNumber_
private

Definition at line 38 of file ExcludedFEDListProducer.h.

Referenced by produce().

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

Definition at line 41 of file ExcludedFEDListProducer.h.

Referenced by produce().