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::ProductRegistryHelper

Public Member Functions

void beginJob (const edm::EventSetup &es)
 
void beginRun (edm::Run &run, const edm::EventSetup &es)
 
void endJob ()
 
 ExcludedFEDListProducer (const edm::ParameterSet &pset)
 constructor More...
 
void produce (edm::Event &event, const edm::EventSetup &es)
 
 ~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 &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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::beginJob ( const edm::EventSetup es)

Definition at line 36 of file ExcludedFEDListProducer.cc.

37  {
38  }
void sistrip::ExcludedFEDListProducer::beginRun ( edm::Run run,
const edm::EventSetup es 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 40 of file ExcludedFEDListProducer.cc.

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

41  {
42  uint32_t cacheId = es.get<SiStripFedCablingRcd>().cacheIdentifier();
43 
44  if ( cacheId_ != cacheId ) {
45 
47  es.get<SiStripFedCablingRcd>().get( c );
48  cabling_ = c.product();
49  }
50  }
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void sistrip::ExcludedFEDListProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 52 of file ExcludedFEDListProducer.cc.

53  {
54  }
void sistrip::ExcludedFEDListProducer::produce ( edm::Event event,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 56 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().

57  {
58  if( runNumber_ != event.run() ) {
59 
60  runNumber_ = event.run();
61 
62  DetIdCollection emptyDetIdCollection;
63  detids_.swap(emptyDetIdCollection);
64  // Reserve space in bad module list
65  detids_.reserve(100);
66 
68  event.getByLabel( productLabel_, buffers );
69 
70  // Retrieve FED ids from cabling map and iterate through
71  std::vector<uint16_t>::const_iterator ifed = cabling_->feds().begin();
72  for ( ; ifed != cabling_->feds().end(); ifed++ ) {
73 
74  // ignore trigger FED
75  // if ( *ifed == triggerFedId_ ) { continue; }
76 
77  // Retrieve FED raw data for given FED
78  const FEDRawData& input = buffers->FEDData( static_cast<int>(*ifed) );
79  // The FEDData contains a vector<unsigned char>. Check the size of this vector:
80 
81  if( input.size() == 0 ) {
82  // std::cout << "Input size == 0 for FED number " << static_cast<int>(*ifed) << std::endl;
83  // get the cabling connections for this FED
84  const std::vector<FedChannelConnection>& conns = cabling_->connections(*ifed);
85  // Mark FED modules as bad
86  detids_.reserve(detids_.size()+conns.size());
87  std::vector<FedChannelConnection>::const_iterator iconn = conns.begin();
88  for ( ; 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  std::auto_ptr< DetIdCollection > detids( new DetIdCollection(detids_) );
97 
98  // for( unsigned int it = 0; it < detids->size(); ++it ) {
99  // std::cout << "detId = " << (*detids)[it]() << std::endl;
100  // }
101 
102  event.put(detids);
103  }
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:67
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 39 of file ExcludedFEDListProducer.h.

Referenced by beginRun(), and produce().

uint32_t sistrip::ExcludedFEDListProducer::cacheId_
private

Definition at line 40 of file ExcludedFEDListProducer.h.

Referenced by beginRun().

DetIdCollection sistrip::ExcludedFEDListProducer::detids_
private

Definition at line 41 of file ExcludedFEDListProducer.h.

Referenced by produce().

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

Definition at line 38 of file ExcludedFEDListProducer.h.

Referenced by produce().

unsigned int sistrip::ExcludedFEDListProducer::runNumber_
private

Definition at line 37 of file ExcludedFEDListProducer.h.

Referenced by produce().