CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiPixelQualityProbabilitiesTestReader Class Reference
Inheritance diagram for SiPixelQualityProbabilitiesTestReader:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 SiPixelQualityProbabilitiesTestReader (edm::ParameterSet const &p)
 
 ~SiPixelQualityProbabilitiesTestReader () 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 

Private Attributes

const std::string formatedOutput_
 
const bool printdebug_
 
const edm::ESGetToken< SiPixelQualityProbabilities, SiPixelStatusScenarioProbabilityRcdsiPixelQPToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

Definition at line 14 of file SiPixelQualityProbabilitiesTestReader.cc.

Constructor & Destructor Documentation

◆ SiPixelQualityProbabilitiesTestReader()

SiPixelQualityProbabilitiesTestReader::SiPixelQualityProbabilitiesTestReader ( edm::ParameterSet const &  p)
explicit

Definition at line 30 of file SiPixelQualityProbabilitiesTestReader.cc.

32  printdebug_(p.getUntrackedParameter<bool>("printDebug", true)),
33  formatedOutput_(p.getUntrackedParameter<std::string>("outputFile", "")) {
34  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << "SiPixelQualityProbabilitiesTestReader" << std::endl;
35 }
Log< level::Info, false > LogInfo
const edm::ESGetToken< SiPixelQualityProbabilities, SiPixelStatusScenarioProbabilityRcd > siPixelQPToken_

◆ ~SiPixelQualityProbabilitiesTestReader()

SiPixelQualityProbabilitiesTestReader::~SiPixelQualityProbabilitiesTestReader ( )
override

Definition at line 37 of file SiPixelQualityProbabilitiesTestReader.cc.

37  {
38  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << "~SiPixelQualityProbabilitiesTestReader " << std::endl;
39 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ analyze()

void SiPixelQualityProbabilitiesTestReader::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 41 of file SiPixelQualityProbabilitiesTestReader.cc.

References visDQMUpload::context, MillePedeFileConverter_cfg::e, mps_splice::entry, edm::eventsetup::heterocontainer::HCTypeTag::findType(), formatedOutput_, SiPixelQualityProbabilities::getProbability_Map(), SiPixelQualityProbabilities::printAll(), printdebug_, edm::ESHandle< T >::product(), siPixelQPToken_, SiPixelQualityProbabilities::size(), and edm::eventsetup::EventSetupRecordKey::type().

41  {
42  edm::LogInfo("SiPixelQualityProbabilitiesTestReader")
43  << "### SiPixelQualityProbabilitiesTestReader::analyze ###" << std::endl;
44  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
45  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << " ---EVENT NUMBER " << e.id().event() << std::endl;
46 
48  edm::eventsetup::EventSetupRecordKey::TypeTag::findType("SiPixelStatusScenarioProbabilityRcd"));
49 
50  if (recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
51  //record not found
52  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << "Record \"SiPixelStatusScenarioProbabilityRcd"
53  << "\" does not exist " << std::endl;
54  }
55 
56  //this part gets the handle of the event source and the record (i.e. the Database)
57  edm::ESHandle<SiPixelQualityProbabilities> scenarioProbabilityHandle = context.getHandle(siPixelQPToken_);
58  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << "got eshandle from context" << std::endl;
59 
60  const SiPixelQualityProbabilities* myProbabilities = scenarioProbabilityHandle.product();
61  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << "got SiPixelQualityProbabilities* " << std::endl;
62  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << "print pointer address : " << myProbabilities << std::endl;
63 
64  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << "Size " << myProbabilities->size() << std::endl;
65  edm::LogInfo("SiPixelQualityProbabilitiesTestReader") << "Content of my Probabilities " << std::endl;
66  // use built-in method in the CondFormat to print the content
67  if (printdebug_) {
68  myProbabilities->printAll();
69  }
70 
71  FILE* pFile = nullptr;
72  if (!formatedOutput_.empty())
73  pFile = fopen(formatedOutput_.c_str(), "w");
74  if (pFile) {
75  fprintf(pFile, "SiPixelQualityProbabilities::printAll() \n");
76  fprintf(pFile,
77  " ========================================================================================================="
78  "========== \n");
79 
80  SiPixelQualityProbabilities::probabilityMap m_probabilities = myProbabilities->getProbability_Map();
81 
82  for (auto it = m_probabilities.begin(); it != m_probabilities.end(); ++it) {
83  fprintf(pFile,
84  " ======================================================================================================="
85  "============ \n");
86  fprintf(pFile, "PU bin : %i \n ", (it->first));
87  for (const auto& entry : it->second) {
88  fprintf(pFile, "Quality snapshot %s, probability %f \n", (entry.first).c_str(), entry.second);
89  }
90  }
91  }
92 }
std::map< unsigned int, probabilityVec > probabilityMap
T const * product() const
Definition: ESHandle.h:86
Log< level::Info, false > LogInfo
const probabilityMap & getProbability_Map() const
heterocontainer::HCTypeTag TypeTag
const edm::ESGetToken< SiPixelQualityProbabilities, SiPixelStatusScenarioProbabilityRcd > siPixelQPToken_
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:121

◆ fillDescriptions()

void SiPixelQualityProbabilitiesTestReader::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 94 of file SiPixelQualityProbabilitiesTestReader.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

94  {
96  desc.setComment("Reads payloads of type SiPixelQualityProbabilities");
97  desc.addUntracked<bool>("printDebug", true);
98  desc.addUntracked<std::string>("outputFile", "");
99  descriptions.add("SiPixelQualityProbabilitiesTestReader", desc);
100 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ formatedOutput_

const std::string SiPixelQualityProbabilitiesTestReader::formatedOutput_
private

Definition at line 27 of file SiPixelQualityProbabilitiesTestReader.cc.

Referenced by analyze().

◆ printdebug_

const bool SiPixelQualityProbabilitiesTestReader::printdebug_
private

Definition at line 26 of file SiPixelQualityProbabilitiesTestReader.cc.

Referenced by analyze().

◆ siPixelQPToken_

const edm::ESGetToken<SiPixelQualityProbabilities, SiPixelStatusScenarioProbabilityRcd> SiPixelQualityProbabilitiesTestReader::siPixelQPToken_
private

Definition at line 25 of file SiPixelQualityProbabilitiesTestReader.cc.

Referenced by analyze().