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

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const SiStripFedCablingcabling_
 
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcdcablingToken_
 
uint32_t cacheId_
 
DetIdCollection detids_
 
unsigned int runNumber_
 
const edm::EDGetTokenT< FEDRawDataCollectiontoken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 22 of file ExcludedFEDListProducer.cc.

23  : runNumber_(0),
24  cacheId_(0),
25  cabling_(nullptr),
26  token_(consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("ProductLabel"))),
27  cablingToken_(esConsumes<SiStripFedCabling, SiStripFedCablingRcd, edm::Transition::BeginRun>()) {
28  produces<DetIdCollection>();
29  }

◆ ~ExcludedFEDListProducer()

sistrip::ExcludedFEDListProducer::~ExcludedFEDListProducer ( )
override

default constructor

Definition at line 31 of file ExcludedFEDListProducer.cc.

31 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 33 of file ExcludedFEDListProducer.cc.

33  {
34  uint32_t cacheId = es.get<SiStripFedCablingRcd>().cacheIdentifier();
35 
36  if (cacheId_ != cacheId) {
37  cacheId_ = cacheId;
38 
40  cabling_ = c.product();
41  }
42  }

References c, cabling_, cablingToken_, cacheId_, edm::EventSetup::get(), and edm::EventSetup::getHandle().

◆ fillDescriptions()

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

Definition at line 44 of file ExcludedFEDListProducer.cc.

44  {
46  desc.add<edm::InputTag>("ProductLabel", edm::InputTag("rawDataCollector"));
47  descriptions.add("siStripExcludedFEDListProducer", desc);
48  }

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

◆ produce()

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

Definition at line 50 of file ExcludedFEDListProducer.cc.

50  {
51  if (runNumber_ != event.run()) {
52  runNumber_ = event.run();
53 
54  DetIdCollection emptyDetIdCollection;
55  detids_.swap(emptyDetIdCollection);
56  // Reserve space in bad module list
57  detids_.reserve(100);
58 
60  event.getByToken(token_, buffers);
61 
62  // Retrieve FED ids from cabling map and iterate through
63  for (auto ifed = cabling_->fedIds().begin(); ifed != cabling_->fedIds().end(); ifed++) {
64  // ignore trigger FED
65  // if ( *ifed == triggerFedId_ ) { continue; }
66 
67  // Retrieve FED raw data for given FED
68  const FEDRawData& input = buffers->FEDData(static_cast<int>(*ifed));
69  // The FEDData contains a vector<unsigned char>. Check the size of this vector:
70 
71  if (input.size() == 0) {
72  // std::cout << "Input size == 0 for FED number " << static_cast<int>(*ifed) << std::endl;
73  // get the cabling connections for this FED
74  auto conns = cabling_->fedConnections(*ifed);
75  // Mark FED modules as bad
76  detids_.reserve(detids_.size() + conns.size());
77  for (auto iconn = conns.begin(); iconn != conns.end(); ++iconn) {
78  if (!iconn->detId() || iconn->detId() == sistrip::invalid32_)
79  continue;
80  detids_.push_back(iconn->detId()); //@@ Possible multiple entries
81  }
82  }
83  }
84  }
85 
86  // for( unsigned int it = 0; it < detids->size(); ++it ) {
87  // std::cout << "detId = " << (*detids)[it]() << std::endl;
88  // }
89 
90  event.put(std::make_unique<DetIdCollection>(detids_));
91  }

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

Member Data Documentation

◆ cabling_

const SiStripFedCabling* sistrip::ExcludedFEDListProducer::cabling_
private

Definition at line 40 of file ExcludedFEDListProducer.h.

Referenced by beginRun(), and produce().

◆ cablingToken_

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

Definition at line 42 of file ExcludedFEDListProducer.h.

Referenced by beginRun().

◆ cacheId_

uint32_t sistrip::ExcludedFEDListProducer::cacheId_
private

Definition at line 39 of file ExcludedFEDListProducer.h.

Referenced by beginRun().

◆ detids_

DetIdCollection sistrip::ExcludedFEDListProducer::detids_
private

Definition at line 44 of file ExcludedFEDListProducer.h.

Referenced by produce().

◆ runNumber_

unsigned int sistrip::ExcludedFEDListProducer::runNumber_
private

Definition at line 38 of file ExcludedFEDListProducer.h.

Referenced by produce().

◆ token_

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

Definition at line 41 of file ExcludedFEDListProducer.h.

Referenced by produce().

edm::EDCollection::push_back
void push_back(T const &t)
Definition: EDCollection.h:60
input
static const std::string input
Definition: EdmProvDump.cc:48
sistrip::invalid32_
static const uint32_t invalid32_
Definition: Constants.h:15
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
sistrip::ExcludedFEDListProducer::runNumber_
unsigned int runNumber_
Definition: ExcludedFEDListProducer.h:38
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
sistrip::ExcludedFEDListProducer::detids_
DetIdCollection detids_
Definition: ExcludedFEDListProducer.h:44
sistrip::ExcludedFEDListProducer::cacheId_
uint32_t cacheId_
Definition: ExcludedFEDListProducer.h:39
edm::Handle< FEDRawDataCollection >
FEDRawData
Definition: FEDRawData.h:19
SiStripFedCablingRcd
Definition: SiStripCondDataRecords.h:22
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
sistrip::ExcludedFEDListProducer::token_
const edm::EDGetTokenT< FEDRawDataCollection > token_
Definition: ExcludedFEDListProducer.h:41
edm::ESHandle
Definition: DTSurvey.h:22
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
edm::EDCollection::swap
void swap(EDCollection< T > &other)
Definition: EDCollection.h:65
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
edm::EDCollection::reserve
void reserve(size_type n)
Definition: EDCollection.h:92
edm::EDCollection< DetId >
sistrip::ExcludedFEDListProducer::cabling_
const SiStripFedCabling * cabling_
Definition: ExcludedFEDListProducer.h:40
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::EDCollection::size
size_type size() const
Definition: EDCollection.h:82
SiStripFedCabling::fedIds
FedsConstIterRange fedIds() const
Definition: SiStripFedCabling.h:154
sistrip::ExcludedFEDListProducer::cablingToken_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > cablingToken_
Definition: ExcludedFEDListProducer.h:42
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
event
Definition: event.py:1
SiStripFedCabling::fedConnections
ConnsConstIterRange fedConnections(uint16_t fed_id) const
Definition: SiStripFedCabling.cc:160
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27