CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiPixelHLTSource Class Reference

#include <SiPixelHLTSource.h>

Inheritance diagram for SiPixelHLTSource:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual void bookMEs (DQMStore::IBooker &)
 
void dqmBeginRun (const edm::Run &, edm::EventSetup const &) override
 
 SiPixelHLTSource (const edm::ParameterSet &conf)
 
 ~SiPixelHLTSource () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::ParameterSet conf_
 
std::string dirName_
 
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > errin_
 
int eventNo
 
bool firstRun
 
MonitorElementmeNCRCs_
 
MonitorElementmeNErrors_
 
MonitorElementmeRawWords_
 
edm::ESHandle< TrackerGeometrypDD
 
edm::EDGetTokenT< FEDRawDataCollectionrawin_
 
bool saveFile
 
bool slowDown
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Description: Produces histograms for error information generated at the raw2digi stage for the pixel tracker.

Implementation: Takes raw data and error data as input, and uses it to populate three histograms indexed by FED id.

Definition at line 46 of file SiPixelHLTSource.h.

Constructor & Destructor Documentation

SiPixelHLTSource::SiPixelHLTSource ( const edm::ParameterSet conf)
explicit

Definition at line 49 of file SiPixelHLTSource.cc.

References firstRun.

50  : conf_(iConfig),
51  rawin_(consumes<FEDRawDataCollection>(conf_.getParameter<edm::InputTag>("RawInput"))),
53  saveFile(conf_.getUntrackedParameter<bool>("saveFile", false)),
54  slowDown(conf_.getUntrackedParameter<bool>("slowDown", false)),
55  dirName_(conf_.getUntrackedParameter<string>("DirName", "Pixel/FEDIntegrity/")) {
56  firstRun = true;
57  LogInfo("PixelDQM") << "SiPixelHLTSource::SiPixelHLTSource: Got DQM BackEnd interface" << endl;
58 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet conf_
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > errin_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::string dirName_
edm::EDGetTokenT< FEDRawDataCollection > rawin_
SiPixelHLTSource::~SiPixelHLTSource ( )
override

Definition at line 60 of file SiPixelHLTSource.cc.

60  {
61  // do anything here that needs to be done at desctruction time
62  // (e.g. close files, deallocate resources etc.)
63  LogInfo("PixelDQM") << "SiPixelHLTSource::~SiPixelHLTSource: Destructor" << endl;
64 }

Member Function Documentation

void SiPixelHLTSource::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 84 of file SiPixelHLTSource.cc.

References edm::DetSetVector< T >::begin(), TrackerGeometry::dets(), edm::DetSetVector< T >::end(), errin_, eventNo, FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, l1t_dqm_sourceclient-live_cfg::fedRawData, HcalObjRepresent::Fill(), edm::Event::getByToken(), GeomDetEnumerators::isTrackerPixel(), edm::HandleBase::isValid(), meNCRCs_, meNErrors_, meRawWords_, pDD, rawin_, FEDRawData::size(), and slowDown.

84  {
85  eventNo++;
86  // get raw input data
88  iEvent.getByToken(rawin_, rawinput);
89  // get error input data
91  iEvent.getByToken(errin_, errorinput);
92  if (!errorinput.isValid())
93  return;
94 
95  int fedId;
96 
97  for (fedId = 0; fedId <= 39; fedId++) {
98  // get event data for this fed
99  const FEDRawData &fedRawData = rawinput->FEDData(fedId);
100  if (fedRawData.size() != 0)
101  (meRawWords_)->Fill(fedId);
102  } // end for
103 
105 
106  for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) {
107  if (GeomDetEnumerators::isTrackerPixel((*it)->subDetector())) {
108  uint32_t detId = (*it)->geographicalId();
109  edm::DetSetVector<SiPixelRawDataError>::const_iterator isearch = errorinput->find(detId);
110  if (isearch != errorinput->end()) {
111  for (di = isearch->data.begin(); di != isearch->data.end(); di++) {
112  fedId = di->getFedId(); // FED the error came from
113  int errorType = di->getType(); // type of error
114  switch (errorType) {
115  case (35):
116  (meNErrors_)->Fill(fedId);
117  break;
118  case (36):
119  (meNErrors_)->Fill(fedId);
120  break;
121  case (37):
122  (meNErrors_)->Fill(fedId);
123  break;
124  case (38):
125  (meNErrors_)->Fill(fedId);
126  break;
127  default:
128  break;
129  }; // end switch
130  } // end for(di
131  } // end if( isearch
132  } // end if( ((*it)->subDetector()
133  } // for(TrackerGeometry
134 
135  edm::DetSetVector<SiPixelRawDataError>::const_iterator isearch = errorinput->find(0xffffffff);
136 
137  if (isearch != errorinput->end()) { // Not at empty iterator
138  for (di = isearch->data.begin(); di != isearch->data.end(); di++) {
139  fedId = di->getFedId(); // FED the error came from
140  int errorType = di->getType(); // type of error
141  switch (errorType) {
142  case (35):
143  (meNErrors_)->Fill(fedId);
144  break;
145  case (36):
146  (meNErrors_)->Fill(fedId);
147  break;
148  case (37):
149  (meNErrors_)->Fill(fedId);
150  break;
151  case (38):
152  (meNErrors_)->Fill(fedId);
153  break;
154  case (39):
155  (meNCRCs_)->Fill(fedId);
156  break;
157  default:
158  break;
159  }; // end switch
160  } // end for(di
161  } // end if( isearch
162  // slow down...
163  if (slowDown)
164  usleep(100000);
165 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
MonitorElement * meNErrors_
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > errin_
MonitorElement * meNCRCs_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< FEDRawDataCollection > rawin_
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
MonitorElement * meRawWords_
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
edm::ESHandle< TrackerGeometry > pDD
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
void SiPixelHLTSource::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 76 of file SiPixelHLTSource.cc.

References bookMEs().

76  {
77  // Book Monitoring Elements
78  bookMEs(iBooker);
79 }
virtual void bookMEs(DQMStore::IBooker &)
void SiPixelHLTSource::bookMEs ( DQMStore::IBooker iBooker)
virtual

Definition at line 170 of file SiPixelHLTSource.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::cd(), conf_, DEFINE_FWK_MODULE, dirName_, edm::ParameterSet::getParameter(), edm::InputTag::label(), meNCRCs_, meNErrors_, meRawWords_, dqm::impl::MonitorElement::setAxisTitle(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms().

170  {
171  iBooker.cd();
172  iBooker.setCurrentFolder(dirName_);
173 
174  std::string rawhid;
175  std::string errhid;
176  // Get collection name and instantiate Histo Id builder
177  edm::InputTag rawin = conf_.getParameter<edm::InputTag>("RawInput");
178  SiPixelHistogramId *RawHistogramId = new SiPixelHistogramId(rawin.label());
179  edm::InputTag errin = conf_.getParameter<edm::InputTag>("ErrorInput");
180  SiPixelHistogramId *ErrorHistogramId = new SiPixelHistogramId(errin.label());
181 
182  // Is a FED sending raw data
183  meRawWords_ = iBooker.book1D("FEDEntries", "Number of raw words", 40, -0.5, 39.5);
184  meRawWords_->setAxisTitle("Number of raw words", 1);
185 
186  // Number of CRC errors
187  meNCRCs_ = iBooker.book1D("FEDFatal", "Number of fatal errors", 40, -0.5, 39.5);
188  meNCRCs_->setAxisTitle("Number of fatal errors", 1);
189 
190  // Number of translation error words
191  meNErrors_ = iBooker.book1D("FEDNonFatal", "Number of non-fatal errors", 40, -0.5, 39.5);
192  meNErrors_->setAxisTitle("Number of non-fatal errors", 1);
193 
194  delete RawHistogramId;
195  delete ErrorHistogramId;
196 }
T getParameter(std::string const &) const
edm::ParameterSet conf_
MonitorElement * meNErrors_
MonitorElement * meNCRCs_
std::string dirName_
MonitorElement * meRawWords_
std::string const & label() const
Definition: InputTag.h:36
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void SiPixelHLTSource::dqmBeginRun ( const edm::Run ,
edm::EventSetup const &   
)
override

Definition at line 66 of file SiPixelHLTSource.cc.

References eventNo, firstRun, edm::EventSetup::get(), and pDD.

66  {
67  LogInfo("PixelDQM") << " SiPixelHLTSource::beginJob - Initialisation ... " << std::endl;
68  iSetup.get<TrackerDigiGeometryRecord>().get(pDD);
69  if (firstRun) {
70  eventNo = 0;
71 
72  firstRun = false;
73  }
74 }
edm::ESHandle< TrackerGeometry > pDD

Member Data Documentation

edm::ParameterSet SiPixelHLTSource::conf_
private

Definition at line 57 of file SiPixelHLTSource.h.

Referenced by bookMEs().

std::string SiPixelHLTSource::dirName_
private

Definition at line 63 of file SiPixelHLTSource.h.

Referenced by bookMEs().

edm::EDGetTokenT<edm::DetSetVector<SiPixelRawDataError> > SiPixelHLTSource::errin_
private

Definition at line 59 of file SiPixelHLTSource.h.

Referenced by analyze().

int SiPixelHLTSource::eventNo
private

Definition at line 64 of file SiPixelHLTSource.h.

Referenced by analyze(), and dqmBeginRun().

bool SiPixelHLTSource::firstRun
private

Definition at line 68 of file SiPixelHLTSource.h.

Referenced by dqmBeginRun(), and SiPixelHLTSource().

MonitorElement* SiPixelHLTSource::meNCRCs_
private

Definition at line 66 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

MonitorElement* SiPixelHLTSource::meNErrors_
private

Definition at line 67 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

MonitorElement* SiPixelHLTSource::meRawWords_
private

Definition at line 65 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

edm::ESHandle<TrackerGeometry> SiPixelHLTSource::pDD
private

Definition at line 60 of file SiPixelHLTSource.h.

Referenced by analyze(), and dqmBeginRun().

edm::EDGetTokenT<FEDRawDataCollection> SiPixelHLTSource::rawin_
private

Definition at line 58 of file SiPixelHLTSource.h.

Referenced by analyze().

bool SiPixelHLTSource::saveFile
private

Definition at line 61 of file SiPixelHLTSource.h.

bool SiPixelHLTSource::slowDown
private

Definition at line 62 of file SiPixelHLTSource.h.

Referenced by analyze().