CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< FEDRawDataCollection
rawin_
 
bool saveFile
 
bool slowDown
 
edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
trackerGeomToken_
 

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
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (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 ( const edm::ParameterSet conf)
explicit

Definition at line 50 of file SiPixelHLTSource.cc.

References firstRun.

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 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet conf_
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > errin_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
std::string dirName_
edm::EDGetTokenT< FEDRawDataCollection > rawin_
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 }
Log< level::Info, false > LogInfo

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 86 of file SiPixelHLTSource.cc.

References edm::DetSetVector< T >::begin(), edm::DetSetVector< T >::end(), errin_, eventNo, l1tstage2_dqm_sourceclient-live_cfg::fedId, HcalObjRepresent::Fill(), edm::Event::getByToken(), edm::EventSetup::getHandle(), GeomDetEnumerators::isTrackerPixel(), edm::HandleBase::isValid(), meNCRCs_, meNErrors_, meRawWords_, rawin_, FEDRawData::size(), slowDown, and trackerGeomToken_.

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 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
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
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
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
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
collection_type::const_iterator const_iterator
Definition: DetSet.h:31
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
void SiPixelHLTSource::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 78 of file SiPixelHLTSource.cc.

References bookMEs().

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

Definition at line 173 of file SiPixelHLTSource.cc.

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().

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 }
edm::ParameterSet conf_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * meNErrors_
MonitorElement * meNCRCs_
std::string dirName_
MonitorElement * meRawWords_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
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 r,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 68 of file SiPixelHLTSource.cc.

References eventNo, and firstRun.

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

Member Data Documentation

edm::ParameterSet SiPixelHLTSource::conf_
private

Definition at line 47 of file SiPixelHLTSource.h.

Referenced by bookMEs().

std::string SiPixelHLTSource::dirName_
private

Definition at line 53 of file SiPixelHLTSource.h.

Referenced by bookMEs().

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

Definition at line 49 of file SiPixelHLTSource.h.

Referenced by analyze().

int SiPixelHLTSource::eventNo
private

Definition at line 54 of file SiPixelHLTSource.h.

Referenced by analyze(), and dqmBeginRun().

bool SiPixelHLTSource::firstRun
private

Definition at line 58 of file SiPixelHLTSource.h.

Referenced by dqmBeginRun(), and SiPixelHLTSource().

MonitorElement* SiPixelHLTSource::meNCRCs_
private

Definition at line 56 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

MonitorElement* SiPixelHLTSource::meNErrors_
private

Definition at line 57 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

MonitorElement* SiPixelHLTSource::meRawWords_
private

Definition at line 55 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

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

Definition at line 48 of file SiPixelHLTSource.h.

Referenced by analyze().

bool SiPixelHLTSource::saveFile
private

Definition at line 51 of file SiPixelHLTSource.h.

bool SiPixelHLTSource::slowDown
private

Definition at line 52 of file SiPixelHLTSource.h.

Referenced by analyze().

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

Definition at line 50 of file SiPixelHLTSource.h.

Referenced by analyze().