CMS 3D CMS Logo

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

#include <SiPixelHLTSource.h>

Inheritance diagram for SiPixelHLTSource:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

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 one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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
 

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 49 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_
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(), l1t::stage2::layer2::fedId, 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:517
MonitorElement * meNErrors_
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > errin_
MonitorElement * meNCRCs_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
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:74
edm::EDGetTokenT< FEDRawDataCollection > rawin_
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:361
MonitorElement * meRawWords_
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:346
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104
edm::ESHandle< TrackerGeometry > pDD
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
void SiPixelHLTSource::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
override

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 DQMStore::IBooker::book1D(), DQMStore::IBooker::cd(), conf_, DEFINE_FWK_MODULE, dirName_, edm::ParameterSet::getParameter(), edm::InputTag::label(), meNCRCs_, meNErrors_, meRawWords_, MonitorElement::setAxisTitle(), 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_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * meRawWords_
std::string const & label() const
Definition: InputTag.h:36
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 60 of file SiPixelHLTSource.h.

Referenced by bookMEs().

std::string SiPixelHLTSource::dirName_
private

Definition at line 66 of file SiPixelHLTSource.h.

Referenced by bookMEs().

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

Definition at line 62 of file SiPixelHLTSource.h.

Referenced by analyze().

int SiPixelHLTSource::eventNo
private

Definition at line 67 of file SiPixelHLTSource.h.

Referenced by analyze(), and dqmBeginRun().

bool SiPixelHLTSource::firstRun
private

Definition at line 71 of file SiPixelHLTSource.h.

Referenced by dqmBeginRun(), and SiPixelHLTSource().

MonitorElement* SiPixelHLTSource::meNCRCs_
private

Definition at line 69 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

MonitorElement* SiPixelHLTSource::meNErrors_
private

Definition at line 70 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

MonitorElement* SiPixelHLTSource::meRawWords_
private

Definition at line 68 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

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

Definition at line 63 of file SiPixelHLTSource.h.

Referenced by analyze(), and dqmBeginRun().

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

Definition at line 61 of file SiPixelHLTSource.h.

Referenced by analyze().

bool SiPixelHLTSource::saveFile
private

Definition at line 64 of file SiPixelHLTSource.h.

bool SiPixelHLTSource::slowDown
private

Definition at line 65 of file SiPixelHLTSource.h.

Referenced by analyze().