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::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

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
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

edm::ParameterSet conf_
 
std::string dirName_
 
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > errin_
 
int eventNo
 
bool firstRun
 
MonitorElementmeNCRCs_
 
MonitorElementmeNErrors_
 
MonitorElementmeRawWords_
 
edm::EDGetTokenT< FEDRawDataCollectionrawin_
 
bool saveFile
 
bool slowDown
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeomToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

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 36 of file SiPixelHLTSource.h.

Constructor & Destructor Documentation

◆ SiPixelHLTSource()

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

Definition at line 50 of file SiPixelHLTSource.cc.

51  : conf_(iConfig),
52  rawin_(consumes<FEDRawDataCollection>(conf_.getParameter<edm::InputTag>("RawInput"))),
54  trackerGeomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()),
55  saveFile(conf_.getUntrackedParameter<bool>("saveFile", false)),
56  slowDown(conf_.getUntrackedParameter<bool>("slowDown", false)),
57  dirName_(conf_.getUntrackedParameter<string>("DirName", "Pixel/FEDIntegrity/")) {
58  firstRun = true;
59  LogInfo("PixelDQM") << "SiPixelHLTSource::SiPixelHLTSource: Got DQM BackEnd interface" << endl;
60 }

References firstRun.

◆ ~SiPixelHLTSource()

SiPixelHLTSource::~SiPixelHLTSource ( )
override

Definition at line 62 of file SiPixelHLTSource.cc.

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

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 86 of file SiPixelHLTSource.cc.

86  {
87  eventNo++;
89  // get raw input data
91  iEvent.getByToken(rawin_, rawinput);
92  // get error input data
94  iEvent.getByToken(errin_, errorinput);
95  if (!errorinput.isValid())
96  return;
97 
98  int fedId;
99 
100  for (fedId = 0; fedId <= 39; fedId++) {
101  // get event data for this fed
102  const FEDRawData &fedRawData = rawinput->FEDData(fedId);
103  if (fedRawData.size() != 0)
104  (meRawWords_)->Fill(fedId);
105  } // end for
106 
108 
109  for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) {
110  if (GeomDetEnumerators::isTrackerPixel((*it)->subDetector())) {
111  uint32_t detId = (*it)->geographicalId();
112  edm::DetSetVector<SiPixelRawDataError>::const_iterator isearch = errorinput->find(detId);
113  if (isearch != errorinput->end()) {
114  for (di = isearch->data.begin(); di != isearch->data.end(); di++) {
115  fedId = di->getFedId(); // FED the error came from
116  int errorType = di->getType(); // type of error
117  switch (errorType) {
118  case (35):
119  (meNErrors_)->Fill(fedId);
120  break;
121  case (36):
122  (meNErrors_)->Fill(fedId);
123  break;
124  case (37):
125  (meNErrors_)->Fill(fedId);
126  break;
127  case (38):
128  (meNErrors_)->Fill(fedId);
129  break;
130  default:
131  break;
132  }; // end switch
133  } // end for(di
134  } // end if( isearch
135  } // end if( ((*it)->subDetector()
136  } // for(TrackerGeometry
137 
138  edm::DetSetVector<SiPixelRawDataError>::const_iterator isearch = errorinput->find(0xffffffff);
139 
140  if (isearch != errorinput->end()) { // Not at empty iterator
141  for (di = isearch->data.begin(); di != isearch->data.end(); di++) {
142  fedId = di->getFedId(); // FED the error came from
143  int errorType = di->getType(); // type of error
144  switch (errorType) {
145  case (35):
146  (meNErrors_)->Fill(fedId);
147  break;
148  case (36):
149  (meNErrors_)->Fill(fedId);
150  break;
151  case (37):
152  (meNErrors_)->Fill(fedId);
153  break;
154  case (38):
155  (meNErrors_)->Fill(fedId);
156  break;
157  case (39):
158  (meNCRCs_)->Fill(fedId);
159  break;
160  default:
161  break;
162  }; // end switch
163  } // end for(di
164  } // end if( isearch
165  // slow down...
166  if (slowDown)
167  usleep(100000);
168 }

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::EventSetup::getHandle(), iEvent, GeomDetEnumerators::isTrackerPixel(), edm::HandleBase::isValid(), meNCRCs_, meNErrors_, meRawWords_, rawin_, slowDown, and trackerGeomToken_.

◆ bookHistograms()

void SiPixelHLTSource::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 78 of file SiPixelHLTSource.cc.

78  {
79  // Book Monitoring Elements
80  bookMEs(iBooker);
81 }

References bookMEs().

◆ bookMEs()

void SiPixelHLTSource::bookMEs ( DQMStore::IBooker iBooker)
virtual

Definition at line 173 of file SiPixelHLTSource.cc.

173  {
174  iBooker.cd();
175  iBooker.setCurrentFolder(dirName_);
176 
177  std::string rawhid;
178  std::string errhid;
179  // Get collection name and instantiate Histo Id builder
180  edm::InputTag rawin = conf_.getParameter<edm::InputTag>("RawInput");
181  SiPixelHistogramId *RawHistogramId = new SiPixelHistogramId(rawin.label());
182  edm::InputTag errin = conf_.getParameter<edm::InputTag>("ErrorInput");
183  SiPixelHistogramId *ErrorHistogramId = new SiPixelHistogramId(errin.label());
184 
185  // Is a FED sending raw data
186  meRawWords_ = iBooker.book1D("FEDEntries", "Number of raw words", 40, -0.5, 39.5);
187  meRawWords_->setAxisTitle("Number of raw words", 1);
188 
189  // Number of CRC errors
190  meNCRCs_ = iBooker.book1D("FEDFatal", "Number of fatal errors", 40, -0.5, 39.5);
191  meNCRCs_->setAxisTitle("Number of fatal errors", 1);
192 
193  // Number of translation error words
194  meNErrors_ = iBooker.book1D("FEDNonFatal", "Number of non-fatal errors", 40, -0.5, 39.5);
195  meNErrors_->setAxisTitle("Number of non-fatal errors", 1);
196 
197  delete RawHistogramId;
198  delete ErrorHistogramId;
199 }

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

Referenced by bookHistograms().

◆ dqmBeginRun()

void SiPixelHLTSource::dqmBeginRun ( const edm::Run r,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 68 of file SiPixelHLTSource.cc.

68  {
69  LogInfo("PixelDQM") << " SiPixelHLTSource::beginJob - Initialisation ... " << std::endl;
70 
71  if (firstRun) {
72  eventNo = 0;
73 
74  firstRun = false;
75  }
76 }

References eventNo, and firstRun.

Member Data Documentation

◆ conf_

edm::ParameterSet SiPixelHLTSource::conf_
private

Definition at line 47 of file SiPixelHLTSource.h.

Referenced by bookMEs().

◆ dirName_

std::string SiPixelHLTSource::dirName_
private

Definition at line 53 of file SiPixelHLTSource.h.

Referenced by bookMEs().

◆ errin_

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

Definition at line 49 of file SiPixelHLTSource.h.

Referenced by analyze().

◆ eventNo

int SiPixelHLTSource::eventNo
private

Definition at line 54 of file SiPixelHLTSource.h.

Referenced by analyze(), and dqmBeginRun().

◆ firstRun

bool SiPixelHLTSource::firstRun
private

Definition at line 58 of file SiPixelHLTSource.h.

Referenced by dqmBeginRun(), and SiPixelHLTSource().

◆ meNCRCs_

MonitorElement* SiPixelHLTSource::meNCRCs_
private

Definition at line 56 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

◆ meNErrors_

MonitorElement* SiPixelHLTSource::meNErrors_
private

Definition at line 57 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

◆ meRawWords_

MonitorElement* SiPixelHLTSource::meRawWords_
private

Definition at line 55 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

◆ rawin_

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

Definition at line 48 of file SiPixelHLTSource.h.

Referenced by analyze().

◆ saveFile

bool SiPixelHLTSource::saveFile
private

Definition at line 51 of file SiPixelHLTSource.h.

◆ slowDown

bool SiPixelHLTSource::slowDown
private

Definition at line 52 of file SiPixelHLTSource.h.

Referenced by analyze().

◆ trackerGeomToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelHLTSource::trackerGeomToken_
private

Definition at line 50 of file SiPixelHLTSource.h.

Referenced by analyze().

edm::DetSetVector
Definition: DetSetVector.h:61
SiPixelHLTSource::meRawWords_
MonitorElement * meRawWords_
Definition: SiPixelHLTSource.h:55
edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
SiPixelHLTSource::rawin_
edm::EDGetTokenT< FEDRawDataCollection > rawin_
Definition: SiPixelHLTSource.h:48
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< FEDRawDataCollection >
FEDRawData
Definition: FEDRawData.h:19
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
l1t_dqm_sourceclient-live_cfg.fedRawData
fedRawData
Definition: l1t_dqm_sourceclient-live_cfg.py:188
edm::ESHandle< TrackerGeometry >
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
SiPixelHLTSource::conf_
edm::ParameterSet conf_
Definition: SiPixelHLTSource.h:47
SiPixelHistogramId
Definition: SiPixelHistogramId.h:25
SiPixelHLTSource::meNErrors_
MonitorElement * meNErrors_
Definition: SiPixelHLTSource.h:57
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
SiPixelHLTSource::errin_
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > errin_
Definition: SiPixelHLTSource.h:49
GeomDetEnumerators::isTrackerPixel
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:68
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
TrackerGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: TrackerGeometry.h:62
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:89
SiPixelHLTSource::trackerGeomToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
Definition: SiPixelHLTSource.h:50
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
SiPixelHLTSource::firstRun
bool firstRun
Definition: SiPixelHLTSource.h:58
SiPixelHLTSource::dirName_
std::string dirName_
Definition: SiPixelHLTSource.h:53
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelHLTSource::eventNo
int eventNo
Definition: SiPixelHLTSource.h:54
SiPixelHLTSource::meNCRCs_
MonitorElement * meNCRCs_
Definition: SiPixelHLTSource.h:56
SiPixelHLTSource::slowDown
bool slowDown
Definition: SiPixelHLTSource.h:52
SiPixelHLTSource::bookMEs
virtual void bookMEs(DQMStore::IBooker &)
Definition: SiPixelHLTSource.cc:173
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:791
SiPixelHLTSource::saveFile
bool saveFile
Definition: SiPixelHLTSource.h:51
edm::InputTag
Definition: InputTag.h:15
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31