CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SiPixelHLTSource Class Reference

#include <SiPixelHLTSource.h>

Inheritance diagram for SiPixelHLTSource:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, edm::EventSetup const &)
 
virtual void bookMEs ()
 
virtual void endJob ()
 
 SiPixelHLTSource (const edm::ParameterSet &conf)
 
 ~SiPixelHLTSource ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::ParameterSet conf_
 
std::string dirName_
 
edm::InputTag errin_
 
int eventNo
 
bool firstRun
 
MonitorElementmeNCRCs_
 
MonitorElementmeNErrors_
 
MonitorElementmeRawWords_
 
edm::ESHandle< TrackerGeometrypDD
 
edm::InputTag rawin_
 
bool saveFile
 
bool slowDown
 
DQMStoretheDMBE
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 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)
 

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

Constructor & Destructor Documentation

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

Definition at line 48 of file SiPixelHLTSource.cc.

References cppFunctionSkipper::operator, and theDMBE.

48  :
49  conf_(iConfig),
50  rawin_( conf_.getParameter<edm::InputTag>( "RawInput" ) ),
51  errin_( conf_.getParameter<edm::InputTag>( "ErrorInput" ) ),
52  saveFile( conf_.getUntrackedParameter<bool>("saveFile",false) ),
53  slowDown( conf_.getUntrackedParameter<bool>("slowDown",false) ),
54  dirName_( conf_.getUntrackedParameter<std::string>("DirName","Pixel/FEDIntegrity/") )
55 {
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_
std::string dirName_
edm::InputTag rawin_
edm::InputTag errin_
SiPixelHLTSource::~SiPixelHLTSource ( )

Definition at line 61 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

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

Implements edm::EDAnalyzer.

Definition at line 99 of file SiPixelHLTSource.cc.

References edm::DetSetVector< T >::begin(), edm::DetSetVector< T >::end(), errin_, eventNo, HcalObjRepresent::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), meNCRCs_, meNErrors_, meRawWords_, pDD, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, rawin_, FEDRawData::size(), and slowDown.

100 {
101  eventNo++;
102  // get raw input data
104  iEvent.getByLabel( rawin_, rawinput );
105  // get error input data
107  iEvent.getByLabel( errin_, errorinput );
108  if (!errorinput.isValid()) return;
109 
110  int fedId;
111 
112  for(fedId = 0; fedId <= 39; fedId++) {
113  //get event data for this fed
114  const FEDRawData& fedRawData = rawinput->FEDData( fedId );
115  if (fedRawData.size() != 0) (meRawWords_)->Fill(fedId);
116  } // end for
117 
119 
120  for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
121  if( ((*it)->subDetector()==GeomDetEnumerators::PixelBarrel) || ((*it)->subDetector()==GeomDetEnumerators::PixelEndcap) ){
122  uint32_t detId = (*it)->geographicalId();
123  edm::DetSetVector<SiPixelRawDataError>::const_iterator isearch = errorinput->find(detId);
124  if( isearch != errorinput->end() ) {
125  for(di = isearch->data.begin(); di != isearch->data.end(); di++) {
126  fedId = di->getFedId(); // FED the error came from
127  int errorType = di->getType(); // type of error
128  switch(errorType) {
129  case(35) : (meNErrors_)->Fill(fedId); break;
130  case(36) : (meNErrors_)->Fill(fedId); break;
131  case(37) : (meNErrors_)->Fill(fedId); break;
132  case(38) : (meNErrors_)->Fill(fedId); break;
133  default : break;
134  }; // end switch
135  } // end for(di
136  } // end if( isearch
137  } // end if( ((*it)->subDetector()
138  } // for(TrackerGeometry
139 
140  edm::DetSetVector<SiPixelRawDataError>::const_iterator isearch = errorinput->find(0xffffffff);
141 
142  if( isearch != errorinput->end() ) { // Not at empty iterator
143  for(di = isearch->data.begin(); di != isearch->data.end(); di++) {
144  fedId = di->getFedId(); // FED the error came from
145  int errorType = di->getType(); // type of error
146  switch(errorType) {
147  case(35) : (meNErrors_)->Fill(fedId); break;
148  case(36) : (meNErrors_)->Fill(fedId); break;
149  case(37) : (meNErrors_)->Fill(fedId); break;
150  case(38) : (meNErrors_)->Fill(fedId); break;
151  case(39) : (meNCRCs_)->Fill(fedId); break;
152  default : break;
153  }; // end switch
154  } // end for(di
155  } // end if( isearch
156  // slow down...
157  if(slowDown) usleep(100000);
158 
159 }
MonitorElement * meNErrors_
MonitorElement * meNCRCs_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
MonitorElement * meRawWords_
edm::InputTag rawin_
edm::InputTag errin_
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:341
collection_type::const_iterator const_iterator
Definition: DetSet.h:34
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106
edm::ESHandle< TrackerGeometry > pDD
void SiPixelHLTSource::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file SiPixelHLTSource.cc.

References firstRun.

69  {
70  firstRun = true;
71 }
void SiPixelHLTSource::beginRun ( const edm::Run r,
edm::EventSetup const &  iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 73 of file SiPixelHLTSource.cc.

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

73  {
74  LogInfo ("PixelDQM") << " SiPixelHLTSource::beginJob - Initialisation ... " << std::endl;
75  iSetup.get<TrackerDigiGeometryRecord>().get( pDD );
76  if(firstRun){
77  eventNo = 0;
78  // Build map
79  // Book Monitoring Elements
80  bookMEs();
81  firstRun = false;
82  }
83 }
edm::ESHandle< TrackerGeometry > pDD
virtual void bookMEs()
void SiPixelHLTSource::bookMEs ( )
virtual

Definition at line 164 of file SiPixelHLTSource.cc.

References DQMStore::cd(), conf_, dirName_, edm::ParameterSet::getParameter(), edm::InputTag::label(), meNCRCs_, meNErrors_, meRawWords_, cppFunctionSkipper::operator, MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and theDMBE.

Referenced by beginRun().

164  {
165 
166  theDMBE->cd();
168 
169  std::string rawhid;
170  std::string errhid;
171  // Get collection name and instantiate Histo Id builder
172  edm::InputTag rawin = conf_.getParameter<edm::InputTag>( "RawInput" );
173  SiPixelHistogramId* RawHistogramId = new SiPixelHistogramId( rawin.label() );
174  edm::InputTag errin = conf_.getParameter<edm::InputTag>( "ErrorInput" );
175  SiPixelHistogramId* ErrorHistogramId = new SiPixelHistogramId( errin.label() );
176  // Get DQM interface
178 
179  // Is a FED sending raw data
180  meRawWords_ = theDMBE->book1D("FEDEntries","Number of raw words",40,-0.5,39.5);
181  meRawWords_->setAxisTitle("Number of raw words",1);
182 
183  // Number of CRC errors
184  meNCRCs_ = theDMBE->book1D("FEDFatal","Number of fatal errors",40,-0.5,39.5);
185  meNCRCs_->setAxisTitle("Number of fatal errors",1);
186 
187  // Number of translation error words
188  meNErrors_ = theDMBE->book1D("FEDNonFatal","Number of non-fatal errors",40,-0.5,39.5);
189  meNErrors_->setAxisTitle("Number of non-fatal errors",1);
190 
191  delete RawHistogramId;
192  delete ErrorHistogramId;
193 
194 }
T getParameter(std::string const &) const
edm::ParameterSet conf_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:411
MonitorElement * meNErrors_
MonitorElement * meNCRCs_
std::string dirName_
MonitorElement * meRawWords_
std::string const & label() const
Definition: InputTag.h:42
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void SiPixelHLTSource::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 86 of file SiPixelHLTSource.cc.

References conf_, edm::ParameterSet::getParameter(), download_sqlite_cfg::outputFile, DQMStore::save(), saveFile, AlCaHLTBitMon_QueryRunRegistry::string, and theDMBE.

86  {
87 
88  if(saveFile) {
89  LogInfo ("PixelDQM") << " SiPixelHLTSource::endJob - Saving Root File " << std::endl;
91  theDMBE->save( outputFile.c_str() );
92  }
93 
94 }
T getParameter(std::string const &) const
edm::ParameterSet conf_
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118

Member Data Documentation

edm::ParameterSet SiPixelHLTSource::conf_
private

Definition at line 60 of file SiPixelHLTSource.h.

Referenced by bookMEs(), and endJob().

std::string SiPixelHLTSource::dirName_
private

Definition at line 66 of file SiPixelHLTSource.h.

Referenced by bookMEs().

edm::InputTag 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 beginRun().

bool SiPixelHLTSource::firstRun
private

Definition at line 72 of file SiPixelHLTSource.h.

Referenced by beginJob(), and beginRun().

MonitorElement* SiPixelHLTSource::meNCRCs_
private

Definition at line 70 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

MonitorElement* SiPixelHLTSource::meNErrors_
private

Definition at line 71 of file SiPixelHLTSource.h.

Referenced by analyze(), and bookMEs().

MonitorElement* SiPixelHLTSource::meRawWords_
private

Definition at line 69 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 beginRun().

edm::InputTag 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.

Referenced by endJob().

bool SiPixelHLTSource::slowDown
private

Definition at line 65 of file SiPixelHLTSource.h.

Referenced by analyze().

DQMStore* SiPixelHLTSource::theDMBE
private

Definition at line 68 of file SiPixelHLTSource.h.

Referenced by bookMEs(), endJob(), and SiPixelHLTSource().