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 Attributes
sistrip::ExcludedFEDListProducer Class Reference

#include <ExcludedFEDListProducer.h>

Inheritance diagram for sistrip::ExcludedFEDListProducer:
edm::EDProducer 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::EDProducer
 EDProducer ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

const SiStripFedCablingcabling_
 
uint32_t cacheId_
 
DetIdCollection detids_
 
edm::InputTag productLabel_
 
unsigned int runNumber_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- 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 24 of file ExcludedFEDListProducer.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 23 of file ExcludedFEDListProducer.cc.

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

default constructor

Definition at line 32 of file ExcludedFEDListProducer.cc.

33  {
34  }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 37 of file ExcludedFEDListProducer.cc.

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

38  {
39  uint32_t cacheId = es.get<SiStripFedCablingRcd>().cacheIdentifier();
40 
41  if ( cacheId_ != cacheId ) {
42 
44  es.get<SiStripFedCablingRcd>().get( c );
45  cabling_ = c.product();
46  }
47  }
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void sistrip::ExcludedFEDListProducer::produce ( edm::Event event,
const edm::EventSetup es 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 49 of file ExcludedFEDListProducer.cc.

References cabling_, SiStripFedCabling::connections(), detids_, SiStripFedCabling::feds(), LaserDQM_cfg::input, sistrip::invalid32_, productLabel_, edm::EDCollection< T >::push_back(), edm::EDCollection< T >::reserve(), edm::Event::run(), runNumber_, edm::EDCollection< T >::size(), FEDRawData::size(), and edm::EDCollection< T >::swap().

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

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

Member Data Documentation

const SiStripFedCabling* sistrip::ExcludedFEDListProducer::cabling_
private

Definition at line 37 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 39 of file ExcludedFEDListProducer.h.

Referenced by produce().

edm::InputTag sistrip::ExcludedFEDListProducer::productLabel_
private

Definition at line 36 of file ExcludedFEDListProducer.h.

Referenced by produce().

unsigned int sistrip::ExcludedFEDListProducer::runNumber_
private

Definition at line 35 of file ExcludedFEDListProducer.h.

Referenced by produce().