CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiPixelFEDChannelContainerTestReader Class Reference
Inheritance diagram for SiPixelFEDChannelContainerTestReader:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 SiPixelFEDChannelContainerTestReader (edm::ParameterSet const &p)
 
 ~SiPixelFEDChannelContainerTestReader () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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
< SiPixelFEDChannelContainer,
SiPixelStatusScenariosRcd
siPixelBadFEDChToken_
 

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 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<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 16 of file SiPixelFEDChannelContainerTestReader.cc.

Constructor & Destructor Documentation

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

Definition at line 32 of file SiPixelFEDChannelContainerTestReader.cc.

34  printdebug_(p.getUntrackedParameter<bool>("printDebug", true)),
35  formatedOutput_(p.getUntrackedParameter<std::string>("outputFile", "")) {
36  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << "SiPixelFEDChannelContainerTestReader" << std::endl;
37 }
Log< level::Info, false > LogInfo
const edm::ESGetToken< SiPixelFEDChannelContainer, SiPixelStatusScenariosRcd > siPixelBadFEDChToken_
SiPixelFEDChannelContainerTestReader::~SiPixelFEDChannelContainerTestReader ( )
override

Definition at line 39 of file SiPixelFEDChannelContainerTestReader.cc.

39  {
40  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << "~SiPixelFEDChannelContainerTestReader " << std::endl;
41 }
Log< level::Info, false > LogInfo

Member Function Documentation

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

Implements edm::one::EDAnalyzerBase.

Definition at line 43 of file SiPixelFEDChannelContainerTestReader.cc.

References mps_splice::entry, edm::EventID::event(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), formatedOutput_, edm::EventSetup::getHandle(), SiPixelFEDChannelContainer::getScenarioMap(), edm::EventBase::id(), SiPixelFEDChannelContainer::printAll(), printdebug_, edm::ESHandle< class >::product(), DetId::rawId(), edm::EventID::run(), siPixelBadFEDChToken_, SiPixelFEDChannelContainer::size(), and edm::eventsetup::EventSetupRecordKey::type().

43  {
44  edm::LogInfo("SiPixelFEDChannelContainerTestReader")
45  << "### SiPixelFEDChannelContainerTestReader::analyze ###" << std::endl;
46  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
47  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << " ---EVENT NUMBER " << e.id().event() << std::endl;
48 
50  edm::eventsetup::EventSetupRecordKey::TypeTag::findType("SiPixelStatusScenariosRcd"));
51 
52  if (recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
53  //record not found
54  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << "Record \"SiPixelStatusScenariosRcd"
55  << "\" does not exist " << std::endl;
56  }
57 
58  //this part gets the handle of the event source and the record (i.e. the Database)
59  edm::ESHandle<SiPixelFEDChannelContainer> qualityCollectionHandle = context.getHandle(siPixelBadFEDChToken_);
60  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << "got eshandle from context" << std::endl;
61 
62  const SiPixelFEDChannelContainer* quality_map = qualityCollectionHandle.product();
63  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << "got SiPixelFEDChannelContainer* " << std::endl;
64  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << "print pointer address : " << quality_map << std::endl;
65  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << "Size " << quality_map->size() << std::endl;
66  edm::LogInfo("SiPixelFEDChannelContainerTestReader") << "Content of myQuality_Map " << std::endl;
67  // use built-in method in the CondFormat to print the content
68  if (printdebug_) {
69  quality_map->printAll();
70  }
71 
72  FILE* pFile = nullptr;
73  if (!formatedOutput_.empty())
74  pFile = fopen(formatedOutput_.c_str(), "w");
75  if (pFile) {
76  fprintf(pFile, "SiPixelFEDChannelContainer::printAll() \n");
77  fprintf(pFile,
78  " ========================================================================================================="
79  "========== \n");
80 
82 
83  for (auto it = m_qualities.begin(); it != m_qualities.end(); ++it) {
84  fprintf(pFile,
85  " ======================================================================================================="
86  "============ \n");
87  fprintf(pFile, "run : %s \n ", (it->first).c_str());
88  for (const auto& thePixelFEDChannel : it->second) {
89  DetId detId = thePixelFEDChannel.first;
90  fprintf(pFile, "DetId : %i \n", detId.rawId());
91  for (const auto& entry : thePixelFEDChannel.second) {
92  //unsigned int fed, link, roc_first, roc_last;
93  fprintf(pFile,
94  "fed : %i | link : %2i | roc_first : %2i | roc_last: %2i \n",
95  entry.fed,
96  entry.link,
97  entry.roc_first,
98  entry.roc_last);
99  }
100  }
101  }
102  }
103 }
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const SiPixelBadFEDChannelsScenarioMap & getScenarioMap() const
Log< level::Info, false > LogInfo
Definition: DetId.h:17
T const * product() const
Definition: ESHandle.h:86
heterocontainer::HCTypeTag TypeTag
edm::EventID id() const
Definition: EventBase.h:59
list entry
Definition: mps_splice.py:68
std::unordered_map< std::string, SiPixelFEDChannelCollection > SiPixelBadFEDChannelsScenarioMap
const edm::ESGetToken< SiPixelFEDChannelContainer, SiPixelStatusScenariosRcd > siPixelBadFEDChToken_
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
void SiPixelFEDChannelContainerTestReader::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 105 of file SiPixelFEDChannelContainerTestReader.cc.

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

105  {
107  desc.setComment("Reads payloads of type SiPixelFEDChannelContainer");
108  desc.addUntracked<bool>("printDebug", true);
109  desc.addUntracked<std::string>("outputFile", "");
110  descriptions.add("SiPixelFEDChannelContainerTestReader", desc);
111 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

const std::string SiPixelFEDChannelContainerTestReader::formatedOutput_
private

Definition at line 29 of file SiPixelFEDChannelContainerTestReader.cc.

Referenced by analyze().

const bool SiPixelFEDChannelContainerTestReader::printdebug_
private

Definition at line 28 of file SiPixelFEDChannelContainerTestReader.cc.

Referenced by analyze().

const edm::ESGetToken<SiPixelFEDChannelContainer, SiPixelStatusScenariosRcd> SiPixelFEDChannelContainerTestReader::siPixelBadFEDChToken_
private

Definition at line 27 of file SiPixelFEDChannelContainerTestReader.cc.

Referenced by analyze().