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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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 ()
 default constructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const SiStripFedCablingcabling_
 
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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 25 of file ExcludedFEDListProducer.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 24 of file ExcludedFEDListProducer.cc.

25  : runNumber_(0)
26  , cacheId_(0)
27  , cabling_(0)
28  , token_ ( consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("ProductLabel")) )
29  {
30  produces<DetIdCollection>();
31  }
T getParameter(std::string const &) const
const edm::EDGetTokenT< FEDRawDataCollection > token_
sistrip::ExcludedFEDListProducer::~ExcludedFEDListProducer ( )

default constructor

Definition at line 33 of file ExcludedFEDListProducer.cc.

34  {
35  }

Member Function Documentation

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

Definition at line 38 of file ExcludedFEDListProducer.cc.

References EnergyCorrector::c, cabling_, cacheId_, edm::EventSetup::get(), and edm::ESHandle< T >::product().

39  {
40  uint32_t cacheId = es.get<SiStripFedCablingRcd>().cacheIdentifier();
41 
42  if ( cacheId_ != cacheId ) {
43 
44  cacheId_ = cacheId;
45 
47  es.get<SiStripFedCablingRcd>().get( c );
48  cabling_ = c.product();
49  }
50  }
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
void sistrip::ExcludedFEDListProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 52 of file ExcludedFEDListProducer.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

52  {
54  desc.add<edm::InputTag>("ProductLabel",edm::InputTag("rawDataCollector"));
55  descriptions.add("siStripExcludedFEDListProducer",desc);
56  }
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 58 of file ExcludedFEDListProducer.cc.

References cabling_, detids_, SiStripFedCabling::fedConnections(), FEDRawDataCollection::FEDData(), 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_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

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

Member Data Documentation

const SiStripFedCabling* sistrip::ExcludedFEDListProducer::cabling_
private

Definition at line 39 of file ExcludedFEDListProducer.h.

Referenced by beginRun(), and produce().

uint32_t sistrip::ExcludedFEDListProducer::cacheId_
private

Definition at line 38 of file ExcludedFEDListProducer.h.

Referenced by beginRun().

DetIdCollection sistrip::ExcludedFEDListProducer::detids_
private

Definition at line 42 of file ExcludedFEDListProducer.h.

Referenced by produce().

unsigned int sistrip::ExcludedFEDListProducer::runNumber_
private

Definition at line 37 of file ExcludedFEDListProducer.h.

Referenced by produce().

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

Definition at line 40 of file ExcludedFEDListProducer.h.

Referenced by produce().