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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
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
 
- 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 46 of file SiPixelHLTSource.h.

Constructor & Destructor Documentation

◆ SiPixelHLTSource()

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

Definition at line 49 of file SiPixelHLTSource.cc.

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 }

References firstRun.

◆ ~SiPixelHLTSource()

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

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 84 of file SiPixelHLTSource.cc.

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 }

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

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 76 of file SiPixelHLTSource.cc.

76  {
77  // Book Monitoring Elements
78  bookMEs(iBooker);
79 }

References bookMEs().

◆ bookMEs()

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

Definition at line 170 of file SiPixelHLTSource.cc.

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 }

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 66 of file SiPixelHLTSource.cc.

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 }

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

Member Data Documentation

◆ conf_

edm::ParameterSet SiPixelHLTSource::conf_
private

Definition at line 57 of file SiPixelHLTSource.h.

Referenced by bookMEs().

◆ dirName_

std::string SiPixelHLTSource::dirName_
private

Definition at line 63 of file SiPixelHLTSource.h.

Referenced by bookMEs().

◆ errin_

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

Definition at line 59 of file SiPixelHLTSource.h.

Referenced by analyze().

◆ eventNo

int SiPixelHLTSource::eventNo
private

Definition at line 64 of file SiPixelHLTSource.h.

Referenced by analyze(), and dqmBeginRun().

◆ firstRun

bool SiPixelHLTSource::firstRun
private

Definition at line 68 of file SiPixelHLTSource.h.

Referenced by dqmBeginRun(), and SiPixelHLTSource().

◆ meNCRCs_

MonitorElement* SiPixelHLTSource::meNCRCs_
private

Definition at line 66 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

◆ meNErrors_

MonitorElement* SiPixelHLTSource::meNErrors_
private

Definition at line 67 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

◆ meRawWords_

MonitorElement* SiPixelHLTSource::meRawWords_
private

Definition at line 65 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

◆ pDD

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

Definition at line 60 of file SiPixelHLTSource.h.

Referenced by analyze(), and dqmBeginRun().

◆ rawin_

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

Definition at line 58 of file SiPixelHLTSource.h.

Referenced by analyze().

◆ saveFile

bool SiPixelHLTSource::saveFile
private

Definition at line 61 of file SiPixelHLTSource.h.

◆ slowDown

bool SiPixelHLTSource::slowDown
private

Definition at line 62 of file SiPixelHLTSource.h.

Referenced by analyze().

edm::DetSetVector
Definition: DetSetVector.h:61
SiPixelHLTSource::meRawWords_
MonitorElement * meRawWords_
Definition: SiPixelHLTSource.h:65
edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
SiPixelHLTSource::rawin_
edm::EDGetTokenT< FEDRawDataCollection > rawin_
Definition: SiPixelHLTSource.h:58
edm::LogInfo
Definition: MessageLogger.h:254
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::Handle
Definition: AssociativeIterator.h:50
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:182
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
SiPixelHLTSource::conf_
edm::ParameterSet conf_
Definition: SiPixelHLTSource.h:57
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelHistogramId
Definition: SiPixelHistogramId.h:25
SiPixelHLTSource::pDD
edm::ESHandle< TrackerGeometry > pDD
Definition: SiPixelHLTSource.h:60
SiPixelHLTSource::meNErrors_
MonitorElement * meNErrors_
Definition: SiPixelHLTSource.h:67
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:59
GeomDetEnumerators::isTrackerPixel
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:68
iEvent
int iEvent
Definition: GenABIO.cc:224
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:82
get
#define get
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SiPixelHLTSource::firstRun
bool firstRun
Definition: SiPixelHLTSource.h:68
SiPixelHLTSource::dirName_
std::string dirName_
Definition: SiPixelHLTSource.h:63
SiPixelHLTSource::eventNo
int eventNo
Definition: SiPixelHLTSource.h:64
SiPixelHLTSource::meNCRCs_
MonitorElement * meNCRCs_
Definition: SiPixelHLTSource.h:66
SiPixelHLTSource::slowDown
bool slowDown
Definition: SiPixelHLTSource.h:62
SiPixelHLTSource::bookMEs
virtual void bookMEs(DQMStore::IBooker &)
Definition: SiPixelHLTSource.cc:170
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:800
SiPixelHLTSource::saveFile
bool saveFile
Definition: SiPixelHLTSource.h:61
edm::InputTag
Definition: InputTag.h:15
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31