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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
< FEDRawDataCollection
rawin_
 
bool saveFile
 
bool slowDown
 
DQMStoretheDMBE
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::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 47 of file SiPixelHLTSource.cc.

References cppFunctionSkipper::operator, and theDMBE.

47  :
48  conf_(iConfig),
49  rawin_( consumes<FEDRawDataCollection>( conf_.getParameter<edm::InputTag>( "RawInput" ) ) ),
51  saveFile( conf_.getUntrackedParameter<bool>("saveFile",false) ),
52  slowDown( conf_.getUntrackedParameter<bool>("slowDown",false) ),
53  dirName_( conf_.getUntrackedParameter<std::string>("DirName","Pixel/FEDIntegrity/") )
54 {
56  LogInfo ("PixelDQM") << "SiPixelHLTSource::SiPixelHLTSource: Got DQM BackEnd interface"<<endl;
57 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet conf_
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > errin_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::string dirName_
edm::EDGetTokenT< FEDRawDataCollection > rawin_
SiPixelHLTSource::~SiPixelHLTSource ( )

Definition at line 60 of file SiPixelHLTSource.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 98 of file SiPixelHLTSource.cc.

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

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

References firstRun.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file SiPixelHLTSource.cc.

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

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

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

163  {
164 
165  theDMBE->cd();
167 
168  std::string rawhid;
169  std::string errhid;
170  // Get collection name and instantiate Histo Id builder
171  edm::InputTag rawin = conf_.getParameter<edm::InputTag>( "RawInput" );
172  SiPixelHistogramId* RawHistogramId = new SiPixelHistogramId( rawin.label() );
173  edm::InputTag errin = conf_.getParameter<edm::InputTag>( "ErrorInput" );
174  SiPixelHistogramId* ErrorHistogramId = new SiPixelHistogramId( errin.label() );
175  // Get DQM interface
177 
178  // Is a FED sending raw data
179  meRawWords_ = theDMBE->book1D("FEDEntries","Number of raw words",40,-0.5,39.5);
180  meRawWords_->setAxisTitle("Number of raw words",1);
181 
182  // Number of CRC errors
183  meNCRCs_ = theDMBE->book1D("FEDFatal","Number of fatal errors",40,-0.5,39.5);
184  meNCRCs_->setAxisTitle("Number of fatal errors",1);
185 
186  // Number of translation error words
187  meNErrors_ = theDMBE->book1D("FEDNonFatal","Number of non-fatal errors",40,-0.5,39.5);
188  meNErrors_->setAxisTitle("Number of non-fatal errors",1);
189 
190  delete RawHistogramId;
191  delete ErrorHistogramId;
192 
193 }
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:872
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:561
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:584
void SiPixelHLTSource::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 85 of file SiPixelHLTSource.cc.

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

85  {
86 
87  if(saveFile) {
88  LogInfo ("PixelDQM") << " SiPixelHLTSource::endJob - Saving Root File " << std::endl;
90  theDMBE->save( outputFile.c_str() );
91  }
92 
93 }
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="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2296

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

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