CMS 3D CMS Logo

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

#include <SiPixelErrors/SiPixelErrorsDigisToCalibDigis/src/SiPixelErrorsDigisToCalibDigis.cc>

Inheritance diagram for SiPixelErrorsDigisToCalibDigis:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

MonitorElementbookDQMHistogram2D (uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 
MonitorElementbookDQMHistoPlaquetteSummary2D (uint32_t detid, std::string name, std::string title)
 
bool setDQMDirectory (std::string dirName)
 
bool setDQMDirectory (uint32_t detID)
 
 SiPixelErrorsDigisToCalibDigis (const edm::ParameterSet &)
 
 ~SiPixelErrorsDigisToCalibDigis ()
 
- 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 ()
 

Protected Attributes

edm::ESHandle< TrackerGeometrygeom_
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

bool createOutputFile_
 
DQMStoredaqBE_
 
SiPixelFolderOrganizerfolderMaker_
 
std::string outputFilename_
 
std::map< uint32_t,
MonitorElement * > 
SiPixelErrorsDigisToCalibDigis_2DErrorInformation_
 
edm::InputTag siPixelProducerLabel_
 
MonitorElementtemp
 
SiPixelHistogramIdtheHistogramIdWorker_
 

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

 class SiPixelErrorsDigisToCalibDigis

Description: Create monitorElements for the Errors in created in the reduction of digis to calibDigis

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 51 of file SiPixelErrorsDigisToCalibDigis.h.

Constructor & Destructor Documentation

SiPixelErrorsDigisToCalibDigis::SiPixelErrorsDigisToCalibDigis ( const edm::ParameterSet iConfig)
explicit

Definition at line 46 of file SiPixelErrorsDigisToCalibDigis.cc.

References createOutputFile_, daqBE_, folderMaker_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputFilename_, siPixelProducerLabel_, and AlCaHLTBitMon_QueryRunRegistry::string.

48 {
49 
50  siPixelProducerLabel_ = iConfig.getParameter<edm::InputTag>("SiPixelProducerLabelTag");
51  createOutputFile_ = iConfig.getUntrackedParameter<bool>("saveFile",false);
52  outputFilename_ = iConfig.getParameter<std::string>("outputFilename");
55 
56 // std::cout<<"siPixelProducerLabel_ = "<<siPixelProducerLabel_<<std::endl;
57 // std::cout<<"createOutputFile_= "<< createOutputFile_<<std::endl;
58 // std::cout<<"outpuFilename_= "<< outputFilename_<< std::endl;
59 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
SiPixelErrorsDigisToCalibDigis::~SiPixelErrorsDigisToCalibDigis ( )

Definition at line 62 of file SiPixelErrorsDigisToCalibDigis.cc.

63 {
64 
65  // do anything here that needs to be done at desctruction time
66  // (e.g. close files, deallocate resources etc.)
67 
68 }

Member Function Documentation

void SiPixelErrorsDigisToCalibDigis::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 77 of file SiPixelErrorsDigisToCalibDigis.cc.

References edm::DetSet< T >::begin(), bookDQMHistoPlaquetteSummary2D(), edm::DetSet< T >::end(), MonitorElement::Fill(), first, geom_, edm::EventSetup::get(), edm::Event::getByLabel(), edm::InputTag::label(), setDQMDirectory(), SiPixelErrorsDigisToCalibDigis_2DErrorInformation_, siPixelProducerLabel_, and theHistogramIdWorker_.

78 {
79  using namespace edm;
80 
81  static int first(1);
82  if (1 == first) {
83  first = 0;
84  iSetup.get<TrackerDigiGeometryRecord>().get( geom_ );
86  }
87 
89  iEvent.getByLabel(siPixelProducerLabel_, thePlaquettes);
90  // iEvent.getByLabel("siPixelCalibDigis", thePlaquettes);
91 
92 
94 
95 
96  for (digiIter=thePlaquettes->begin(); digiIter!=thePlaquettes->end(); digiIter++)
97  {
98  uint32_t detId = digiIter->id;
99 
101  //loop over pixel errors pulsed in the current plaquette
102 
103  MonitorElement* temp_;
104 
105  std::map<uint32_t, MonitorElement*>::iterator mapIterator = SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.find(detId);
106 
107  if (digiIter->begin() != digiIter->end()) {
108  if ( mapIterator == SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.end() )
109  {
110 // std::cout << "This is the beginning of an error 2d histo booking: "<<std::endl;
111  setDQMDirectory(detId);
112  temp_ = bookDQMHistoPlaquetteSummary2D(detId, "SiPixelErrorsCalibDigis", "SiPixelErrorsDigisToCalibDigis");
113  SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.insert( std::make_pair(detId,temp_));
114  }
115  else
116  {
117 // std::cout << "This one was already booked."<<std::endl;
118  temp_ = (*mapIterator).second;
119  }
120 
121  for(ipix=digiIter->begin(); ipix!=digiIter->end(); ++ipix)
122  {
123  temp_->Fill(ipix->getCol(), ipix->getRow());
124 // std::cout << "detId: " << detId << " " << ipix->getRow() << " " << ipix->getCol() << std::endl;
125  }
126 
127  } // end of the if statement asking if the plaquette in question has any errors in it
128 
129  }// end of the for loop that goes through all plaquettes
130 
131 }
iterator end()
Definition: DetSet.h:61
void Fill(long long x)
bool first
Definition: L1TdeRCT.cc:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::map< uint32_t, MonitorElement * > SiPixelErrorsDigisToCalibDigis_2DErrorInformation_
iterator begin()
Definition: DetSet.h:60
const T & get() const
Definition: EventSetup.h:55
std::string const & label() const
Definition: InputTag.h:42
edm::ESHandle< TrackerGeometry > geom_
MonitorElement * bookDQMHistoPlaquetteSummary2D(uint32_t detid, std::string name, std::string title)
collection_type::const_iterator const_iterator
Definition: DetSet.h:34
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106
void SiPixelErrorsDigisToCalibDigis::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 136 of file SiPixelErrorsDigisToCalibDigis.cc.

137 {
138 
139 }
MonitorElement * SiPixelErrorsDigisToCalibDigis::bookDQMHistogram2D ( uint32_t  detid,
std::string  name,
std::string  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)

Definition at line 154 of file SiPixelErrorsDigisToCalibDigis.cc.

References DQMStore::book2D(), daqBE_, SiPixelHistogramId::setHistoId(), AlCaHLTBitMon_QueryRunRegistry::string, and theHistogramIdWorker_.

155 {
157  return daqBE_->book2D(hid, title, nchX, lowX, highX, nchY, lowY, highY);
158 }
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:850
MonitorElement * SiPixelErrorsDigisToCalibDigis::bookDQMHistoPlaquetteSummary2D ( uint32_t  detid,
std::string  name,
std::string  title 
)

Definition at line 160 of file SiPixelErrorsDigisToCalibDigis.cc.

References DQMStore::book2D(), daqBE_, geom_, TrackerGeometry::idToDet(), PixelTopology::ncolumns(), PixelTopology::nrows(), SiPixelHistogramId::setHistoId(), PixelGeomDetUnit::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, and theHistogramIdWorker_.

Referenced by analyze().

160  {
161 
162  DetId detId(detid);
163  const TrackerGeometry &theTracker(*geom_);
164  const PixelGeomDetUnit *theGeomDet = dynamic_cast<const PixelGeomDetUnit*> ( theTracker.idToDet(detId) );
165  int maxcol = theGeomDet->specificTopology().ncolumns();
166  int maxrow = theGeomDet->specificTopology().nrows();
167 
169  return daqBE_->book2D(hid,title,maxcol,0,maxcol,maxrow,0,maxrow);
170 }
virtual int ncolumns() const =0
virtual int nrows() const =0
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
Definition: DetId.h:20
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
edm::ESHandle< TrackerGeometry > geom_
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:850
void SiPixelErrorsDigisToCalibDigis::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 143 of file SiPixelErrorsDigisToCalibDigis.cc.

References createOutputFile_, outputFilename_, and cuy::save.

143  {
144 
145  if (!outputFilename_.empty() && createOutputFile_)
146  {
147  edm::LogInfo("SiPixelErrorCalibDigis") << "Writing ROOT file to: " << outputFilename_ << std::endl;
149  }
150 }
list save
Definition: cuy.py:1163
bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory ( std::string  dirName)

Definition at line 172 of file SiPixelErrorsDigisToCalibDigis.cc.

References daqBE_, DQMStore::dirExists(), and DQMStore::setCurrentFolder().

Referenced by analyze().

173 {
175  return daqBE_->dirExists(dirName);
176 }
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:498
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory ( uint32_t  detID)

Definition at line 178 of file SiPixelErrorsDigisToCalibDigis.cc.

References folderMaker_, and SiPixelFolderOrganizer::setModuleFolder().

179 {
180  return folderMaker_->setModuleFolder(detID,0);
181 }
bool setModuleFolder(const uint32_t &rawdetid=0, int type=0)
Set folder name for a module or plaquette.

Member Data Documentation

bool SiPixelErrorsDigisToCalibDigis::createOutputFile_
private

Definition at line 80 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by endJob(), and SiPixelErrorsDigisToCalibDigis().

DQMStore* SiPixelErrorsDigisToCalibDigis::daqBE_
private
SiPixelFolderOrganizer* SiPixelErrorsDigisToCalibDigis::folderMaker_
private
edm::ESHandle<TrackerGeometry> SiPixelErrorsDigisToCalibDigis::geom_
protected

Definition at line 63 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze(), and bookDQMHistoPlaquetteSummary2D().

std::string SiPixelErrorsDigisToCalibDigis::outputFilename_
private

Definition at line 79 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by endJob(), and SiPixelErrorsDigisToCalibDigis().

std::map<uint32_t, MonitorElement*> SiPixelErrorsDigisToCalibDigis::SiPixelErrorsDigisToCalibDigis_2DErrorInformation_
private

Definition at line 83 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze().

edm::InputTag SiPixelErrorsDigisToCalibDigis::siPixelProducerLabel_
private

Definition at line 75 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze(), and SiPixelErrorsDigisToCalibDigis().

MonitorElement* SiPixelErrorsDigisToCalibDigis::temp
private

Definition at line 85 of file SiPixelErrorsDigisToCalibDigis.h.

SiPixelHistogramId* SiPixelErrorsDigisToCalibDigis::theHistogramIdWorker_
private