CMS 3D CMS Logo

List of all members | Public Types | 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 Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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 () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Attributes

edm::ESHandle< TrackerGeometrygeom_
 

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 49 of file SiPixelErrorsDigisToCalibDigis.h.

Member Typedef Documentation

Definition at line 52 of file SiPixelErrorsDigisToCalibDigis.h.

Definition at line 51 of file SiPixelErrorsDigisToCalibDigis.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file SiPixelErrorsDigisToCalibDigis.cc.

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

46 {
47  siPixelProducerLabel_ = iConfig.getParameter<edm::InputTag>("SiPixelProducerLabelTag");
48  createOutputFile_ = iConfig.getUntrackedParameter<bool>("saveFile", false);
49  outputFilename_ = iConfig.getParameter<std::string>("outputFilename");
52 
53  tPixelCalibDigiError = consumes<edm::DetSetVector<SiPixelCalibDigiError> >(siPixelProducerLabel_);
54 
55  // std::cout<<"siPixelProducerLabel_ = "<<siPixelProducerLabel_<<std::endl;
56  // std::cout<<"createOutputFile_= "<< createOutputFile_<<std::endl;
57  // std::cout<<"outpuFilename_= "<< outputFilename_<< std::endl;
58 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< SiPixelCalibDigiError > > tPixelCalibDigiError
SiPixelErrorsDigisToCalibDigis::~SiPixelErrorsDigisToCalibDigis ( )
override

Definition at line 60 of file SiPixelErrorsDigisToCalibDigis.cc.

60  {
61  // do anything here that needs to be done at desctruction time
62  // (e.g. close files, deallocate resources etc.)
63 }

Member Function Documentation

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

Definition at line 70 of file SiPixelErrorsDigisToCalibDigis.cc.

References edm::DetSetVector< T >::begin(), bookDQMHistoPlaquetteSummary2D(), edm::DetSetVector< T >::end(), dqm::impl::MonitorElement::Fill(), dqmdumpme::first, geom_, edm::EventSetup::get(), edm::Event::getByToken(), edm::InputTag::label(), setDQMDirectory(), SiPixelErrorsDigisToCalibDigis_2DErrorInformation_, siPixelProducerLabel_, theHistogramIdWorker_, and tPixelCalibDigiError.

70  {
71  using namespace edm;
72 
73  static int first(1);
74  if (1 == first) {
75  first = 0;
76  iSetup.get<TrackerDigiGeometryRecord>().get(geom_);
78  }
79 
81  iEvent.getByToken(tPixelCalibDigiError, thePlaquettes);
82  // iEvent.getByLabel("siPixelCalibDigis", thePlaquettes);
83 
85 
86  for (digiIter = thePlaquettes->begin(); digiIter != thePlaquettes->end(); digiIter++) {
87  uint32_t detId = digiIter->id;
88 
90  //loop over pixel errors pulsed in the current plaquette
91 
92  MonitorElement* temp_;
93 
94  std::map<uint32_t, MonitorElement*>::iterator mapIterator =
96 
97  if (digiIter->begin() != digiIter->end()) {
98  if (mapIterator == SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.end()) {
99  // std::cout << "This is the beginning of an error 2d histo booking: "<<std::endl;
100  setDQMDirectory(detId);
101  temp_ = bookDQMHistoPlaquetteSummary2D(detId, "SiPixelErrorsCalibDigis", "SiPixelErrorsDigisToCalibDigis");
102  SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.insert(std::make_pair(detId, temp_));
103  } else {
104  // std::cout << "This one was already booked."<<std::endl;
105  temp_ = (*mapIterator).second;
106  }
107 
108  for (ipix = digiIter->begin(); ipix != digiIter->end(); ++ipix) {
109  temp_->Fill(ipix->getCol(), ipix->getRow());
110  // std::cout << "detId: " << detId << " " << ipix->getRow() << " " << ipix->getCol() << std::endl;
111  }
112 
113  } // end of the if statement asking if the plaquette in question has any errors in it
114 
115  } // end of the for loop that goes through all plaquettes
116 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void Fill(long long x)
MonitorElement * bookDQMHistoPlaquetteSummary2D(uint32_t detid, std::string name, std::string title)
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
std::map< uint32_t, MonitorElement * > SiPixelErrorsDigisToCalibDigis_2DErrorInformation_
edm::EDGetTokenT< edm::DetSetVector< SiPixelCalibDigiError > > tPixelCalibDigiError
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
T get() const
Definition: EventSetup.h:73
edm::ESHandle< TrackerGeometry > geom_
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
void SiPixelErrorsDigisToCalibDigis::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file SiPixelErrorsDigisToCalibDigis.cc.

119 {}
SiPixelErrorsDigisToCalibDigis::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 132 of file SiPixelErrorsDigisToCalibDigis.cc.

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

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

Definition at line 145 of file SiPixelErrorsDigisToCalibDigis.cc.

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

Referenced by analyze().

146  {
147  DetId detId(detid);
148  const TrackerGeometry& theTracker(*geom_);
149  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(theTracker.idToDet(detId));
150  int maxcol = theGeomDet->specificTopology().ncolumns();
151  int maxrow = theGeomDet->specificTopology().nrows();
152 
154  return daqBE_->book2D(hid, title, maxcol, 0, maxcol, maxrow, 0, maxrow);
155 }
virtual int nrows() const =0
MonitorElement * book2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1178
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
Definition: DetId.h:17
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
virtual int ncolumns() const =0
edm::ESHandle< TrackerGeometry > geom_
void SiPixelErrorsDigisToCalibDigis::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 122 of file SiPixelErrorsDigisToCalibDigis.cc.

References createOutputFile_, outputFilename_, and cuy::save.

Referenced by o2olib.O2ORunMgr::executeJob().

122  {
123  if (!outputFilename_.empty() && createOutputFile_) {
124  edm::LogInfo("SiPixelErrorCalibDigis") << "Writing ROOT file to: " << outputFilename_ << std::endl;
125  if (edm::Service<DQMStore>().isAvailable())
127  }
128 }
save
Definition: cuy.py:1165
bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory ( std::string  dirName)

Definition at line 157 of file SiPixelErrorsDigisToCalibDigis.cc.

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

Referenced by analyze().

157  {
159  return daqBE_->dirExists(dirName);
160 }
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:639
bool dirExists(std::string const &path) const
true if directory exists
Definition: DQMStore.cc:698
bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory ( uint32_t  detID)

Definition at line 162 of file SiPixelErrorsDigisToCalibDigis.cc.

References DEFINE_FWK_MODULE, folderMaker_, and SiPixelFolderOrganizer::setModuleFolder().

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

Member Data Documentation

bool SiPixelErrorsDigisToCalibDigis::createOutputFile_
private

Definition at line 92 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 74 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze(), and bookDQMHistoPlaquetteSummary2D().

std::string SiPixelErrorsDigisToCalibDigis::outputFilename_
private

Definition at line 91 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by endJob(), and SiPixelErrorsDigisToCalibDigis().

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

Definition at line 95 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze().

edm::InputTag SiPixelErrorsDigisToCalibDigis::siPixelProducerLabel_
private

Definition at line 86 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze(), and SiPixelErrorsDigisToCalibDigis().

MonitorElement* SiPixelErrorsDigisToCalibDigis::temp
private

Definition at line 97 of file SiPixelErrorsDigisToCalibDigis.h.

SiPixelHistogramId* SiPixelErrorsDigisToCalibDigis::theHistogramIdWorker_
private
edm::EDGetTokenT<edm::DetSetVector<SiPixelCalibDigiError> > SiPixelErrorsDigisToCalibDigis::tPixelCalibDigiError
private

Definition at line 87 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze(), and SiPixelErrorsDigisToCalibDigis().