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::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase 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::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Attributes

edm::ESHandle< TrackerGeometrygeom_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeomToken_
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) 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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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 44 of file SiPixelErrorsDigisToCalibDigis.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 47 of file SiPixelErrorsDigisToCalibDigis.h.

◆ MonitorElement

Definition at line 46 of file SiPixelErrorsDigisToCalibDigis.h.

Constructor & Destructor Documentation

◆ SiPixelErrorsDigisToCalibDigis()

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

Definition at line 38 of file SiPixelErrorsDigisToCalibDigis.cc.

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

40 {
41  siPixelProducerLabel_ = iConfig.getParameter<edm::InputTag>("SiPixelProducerLabelTag");
42  createOutputFile_ = iConfig.getUntrackedParameter<bool>("saveFile", false);
43  outputFilename_ = iConfig.getParameter<std::string>("outputFilename");
46 
47  tPixelCalibDigiError = consumes<edm::DetSetVector<SiPixelCalibDigiError> >(siPixelProducerLabel_);
48 
49  trackerGeomToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
50 
51  // std::cout<<"siPixelProducerLabel_ = "<<siPixelProducerLabel_<<std::endl;
52  // std::cout<<"createOutputFile_= "<< createOutputFile_<<std::endl;
53  // std::cout<<"outpuFilename_= "<< outputFilename_<< std::endl;
54 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
edm::EDGetTokenT< edm::DetSetVector< SiPixelCalibDigiError > > tPixelCalibDigiError

◆ ~SiPixelErrorsDigisToCalibDigis()

SiPixelErrorsDigisToCalibDigis::~SiPixelErrorsDigisToCalibDigis ( )
override

Definition at line 56 of file SiPixelErrorsDigisToCalibDigis.cc.

56  {
57  // do anything here that needs to be done at desctruction time
58  // (e.g. close files, deallocate resources etc.)
59 }

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 66 of file SiPixelErrorsDigisToCalibDigis.cc.

References edm::DetSetVector< T >::begin(), bookDQMHistoPlaquetteSummary2D(), hcalRecHitTable_cff::detId, edm::DetSetVector< T >::end(), dqm::impl::MonitorElement::Fill(), dqmdumpme::first, geom_, edm::EventSetup::getHandle(), iEvent, edm::InputTag::label(), setDQMDirectory(), SiPixelErrorsDigisToCalibDigis_2DErrorInformation_, siPixelProducerLabel_, theHistogramIdWorker_, tPixelCalibDigiError, and trackerGeomToken_.

66  {
67  using namespace edm;
68 
69  static int first(1);
70  if (1 == first) {
71  first = 0;
74  }
75 
77  iEvent.getByToken(tPixelCalibDigiError, thePlaquettes);
78  // iEvent.getByLabel("siPixelCalibDigis", thePlaquettes);
79 
81 
82  for (digiIter = thePlaquettes->begin(); digiIter != thePlaquettes->end(); digiIter++) {
83  uint32_t detId = digiIter->id;
84 
86  //loop over pixel errors pulsed in the current plaquette
87 
88  MonitorElement* temp_;
89 
90  std::map<uint32_t, MonitorElement*>::iterator mapIterator =
92 
93  if (digiIter->begin() != digiIter->end()) {
94  if (mapIterator == SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.end()) {
95  // std::cout << "This is the beginning of an error 2d histo booking: "<<std::endl;
97  temp_ = bookDQMHistoPlaquetteSummary2D(detId, "SiPixelErrorsCalibDigis", "SiPixelErrorsDigisToCalibDigis");
98  SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.insert(std::make_pair(detId, temp_));
99  } else {
100  // std::cout << "This one was already booked."<<std::endl;
101  temp_ = (*mapIterator).second;
102  }
103 
104  for (ipix = digiIter->begin(); ipix != digiIter->end(); ++ipix) {
105  temp_->Fill(ipix->getCol(), ipix->getRow());
106  // std::cout << "detId: " << detId << " " << ipix->getRow() << " " << ipix->getCol() << std::endl;
107  }
108 
109  } // end of the if statement asking if the plaquette in question has any errors in it
110 
111  } // end of the for loop that goes through all plaquettes
112 }
std::string const & label() const
Definition: InputTag.h:36
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
MonitorElement * bookDQMHistoPlaquetteSummary2D(uint32_t detid, std::string name, std::string title)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
std::map< uint32_t, MonitorElement * > SiPixelErrorsDigisToCalibDigis_2DErrorInformation_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
edm::EDGetTokenT< edm::DetSetVector< SiPixelCalibDigiError > > tPixelCalibDigiError
HLT enums.
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:31
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102

◆ bookDQMHistogram2D()

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 125 of file SiPixelErrorsDigisToCalibDigis.cc.

References dqm::implementation::IBooker::book2D(), daqBE_, Skims_PA_cff::name, SiPixelHistogramId::setHistoId(), AlCaHLTBitMon_QueryRunRegistry::string, theHistogramIdWorker_, and runGCPTkAlMap::title.

133  {
135  return daqBE_->book2D(hid, title, nchX, lowX, highX, nchY, lowY, highY);
136 }
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212

◆ bookDQMHistoPlaquetteSummary2D()

SiPixelErrorsDigisToCalibDigis::MonitorElement * SiPixelErrorsDigisToCalibDigis::bookDQMHistoPlaquetteSummary2D ( uint32_t  detid,
std::string  name,
std::string  title 
)

Definition at line 138 of file SiPixelErrorsDigisToCalibDigis.cc.

References dqm::implementation::IBooker::book2D(), daqBE_, hcalRecHitTable_cff::detId, geom_, TrackerGeometry::idToDet(), Skims_PA_cff::name, PixelTopology::ncolumns(), PixelTopology::nrows(), SiPixelHistogramId::setHistoId(), PixelGeomDetUnit::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, theHistogramIdWorker_, and runGCPTkAlMap::title.

Referenced by analyze().

139  {
140  DetId detId(detid);
141  const TrackerGeometry& theTracker(*geom_);
142  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(theTracker.idToDet(detId));
143  int maxcol = theGeomDet->specificTopology().ncolumns();
144  int maxrow = theGeomDet->specificTopology().nrows();
145 
147  return daqBE_->book2D(hid, title, maxcol, 0, maxcol, maxrow, 0, maxrow);
148 }
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:17
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
edm::ESHandle< TrackerGeometry > geom_

◆ endJob()

void SiPixelErrorsDigisToCalibDigis::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 115 of file SiPixelErrorsDigisToCalibDigis.cc.

References createOutputFile_, outputFilename_, and cuy::save.

Referenced by o2olib.O2ORunMgr::executeJob().

115  {
116  if (!outputFilename_.empty() && createOutputFile_) {
117  edm::LogInfo("SiPixelErrorCalibDigis") << "Writing ROOT file to: " << outputFilename_ << std::endl;
118  if (edm::Service<DQMStore>().isAvailable())
120  }
121 }
Log< level::Info, false > LogInfo
save
Definition: cuy.py:1164

◆ setDQMDirectory() [1/2]

bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory ( std::string  dirName)

◆ setDQMDirectory() [2/2]

bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory ( uint32_t  detID)

Definition at line 155 of file SiPixelErrorsDigisToCalibDigis.cc.

References folderMaker_, and SiPixelFolderOrganizer::setModuleFolder().

155 { 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

◆ createOutputFile_

bool SiPixelErrorsDigisToCalibDigis::createOutputFile_
private

Definition at line 88 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by endJob(), and SiPixelErrorsDigisToCalibDigis().

◆ daqBE_

DQMStore* SiPixelErrorsDigisToCalibDigis::daqBE_
private

◆ folderMaker_

SiPixelFolderOrganizer* SiPixelErrorsDigisToCalibDigis::folderMaker_
private

◆ geom_

edm::ESHandle<TrackerGeometry> SiPixelErrorsDigisToCalibDigis::geom_
protected

Definition at line 69 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze(), and bookDQMHistoPlaquetteSummary2D().

◆ outputFilename_

std::string SiPixelErrorsDigisToCalibDigis::outputFilename_
private

Definition at line 87 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by endJob(), and SiPixelErrorsDigisToCalibDigis().

◆ SiPixelErrorsDigisToCalibDigis_2DErrorInformation_

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

Definition at line 91 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze().

◆ siPixelProducerLabel_

edm::InputTag SiPixelErrorsDigisToCalibDigis::siPixelProducerLabel_
private

Definition at line 82 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze(), and SiPixelErrorsDigisToCalibDigis().

◆ temp

MonitorElement* SiPixelErrorsDigisToCalibDigis::temp
private

Definition at line 93 of file SiPixelErrorsDigisToCalibDigis.h.

◆ theHistogramIdWorker_

SiPixelHistogramId* SiPixelErrorsDigisToCalibDigis::theHistogramIdWorker_
private

◆ tPixelCalibDigiError

edm::EDGetTokenT<edm::DetSetVector<SiPixelCalibDigiError> > SiPixelErrorsDigisToCalibDigis::tPixelCalibDigiError
private

Definition at line 83 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze(), and SiPixelErrorsDigisToCalibDigis().

◆ trackerGeomToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelErrorsDigisToCalibDigis::trackerGeomToken_
protected

Definition at line 71 of file SiPixelErrorsDigisToCalibDigis.h.

Referenced by analyze(), and SiPixelErrorsDigisToCalibDigis().