CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer Class Reference
Inheritance diagram for edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer:
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

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 
void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMReferenceHistogramRootFileEventSetupAnalyzer (const edm::ParameterSet &pset)
 
 DQMReferenceHistogramRootFileEventSetupAnalyzer (int i)
 
 ~DQMReferenceHistogramRootFileEventSetupAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Private Attributes

const edm::ESGetToken< FileBlob, DQMReferenceHistogramRootFileRcdfileBlobToken_
 
bool init_
 

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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 20 of file DQMReferenceHistogramRootFileEventSetupAnalyzer.cc.

Member Typedef Documentation

◆ DQMStore

◆ MonitorElement

Constructor & Destructor Documentation

◆ DQMReferenceHistogramRootFileEventSetupAnalyzer() [1/2]

edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::DQMReferenceHistogramRootFileEventSetupAnalyzer ( const edm::ParameterSet pset)
explicit

Definition at line 35 of file DQMReferenceHistogramRootFileEventSetupAnalyzer.cc.

37  : fileBlobToken_(esConsumes<edm::Transition::BeginRun>()) {
38  init_ = false;
39  edm::LogPrint("DQMReferenceHistogramRootFileEventSetupAnalyzer")
40  << "DQMReferenceHistogramRootFileEventSetupAnalyzer(const edm::ParameterSet &ps)" << std::endl;
41  }

References init_.

◆ DQMReferenceHistogramRootFileEventSetupAnalyzer() [2/2]

edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::DQMReferenceHistogramRootFileEventSetupAnalyzer ( int  i)
explicit

Definition at line 43 of file DQMReferenceHistogramRootFileEventSetupAnalyzer.cc.

44  : fileBlobToken_(esConsumes<edm::Transition::BeginRun>()) {
45  init_ = false;
46  edm::LogPrint("DQMReferenceHistogramRootFileEventSetupAnalyzer")
47  << "DQMReferenceHistogramRootFileEventSetupAnalyzer(int i) " << i << std::endl;
48  }

References mps_fire::i, and init_.

◆ ~DQMReferenceHistogramRootFileEventSetupAnalyzer()

edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::~DQMReferenceHistogramRootFileEventSetupAnalyzer ( )
override

Definition at line 50 of file DQMReferenceHistogramRootFileEventSetupAnalyzer.cc.

50  {
51  init_ = false;
52  edm::LogPrint("DQMReferenceHistogramRootFileEventSetupAnalyzer")
53  << "~DQMReferenceHistogramRootFileEventSetupAnalyzer" << std::endl;
54  }

References init_.

Member Function Documentation

◆ analyze()

void edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 56 of file DQMReferenceHistogramRootFileEventSetupAnalyzer.cc.

57  {
58  return;
59  }

◆ beginRun()

void edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::beginRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)

Definition at line 61 of file DQMReferenceHistogramRootFileEventSetupAnalyzer.cc.

61  {
62  edm::LogPrint("DQMReferenceHistogramRootFileEventSetupAnalyzer")
63  << "DQMReferenceHistogramRootFileEventSetupAnalyzer::beginRun()" << std::endl;
64  if (!init_) {
65  init_ = true;
67  edm::eventsetup::EventSetupRecordKey::TypeTag::findType("DQMReferenceHistogramRootFileRcd"));
68  if (recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
69  throw cms::Exception("Record not found") << "Record \"DQMReferenceHistogramRootFileRcd"
70  << "\" does not exist!" << std::endl;
71  }
72  const auto& rootgeo = &iSetup.getData(fileBlobToken_);
73  edm::LogPrint("DQMReferenceHistogramRootFileEventSetupAnalyzer") << "ROOT FILE IN MEMORY" << std::endl;
74  std::unique_ptr<std::vector<unsigned char> > tb((*rootgeo).getUncompressedBlob());
75  // char filename[128];
76  // sprintf(filename, "mem:%p,%ul", &(*tb)[0], (unsigned long) tb->size());
77  // edm::Service<DQMStore>()->open(filename, false, "", "Reference");
78 
79  //here you can implement the stream for putting the TFile on disk...
80  std::string outfile("dqmreference.root");
81  std::ofstream output(outfile.c_str());
82  output.write((const char*)&(*tb)[0], tb->size());
83  output.close();
84 
86  dqm->open(outfile, false, "", "Reference");
87  remove(outfile.c_str());
88 
89  std::vector<MonitorElement*> mes = dqm->getAllContents("");
90  for (std::vector<MonitorElement*>::iterator i = mes.begin(), e = mes.end(); i != e; ++i)
91  edm::LogPrint("DQMReferenceHistogramRootFileEventSetupAnalyzer") << "ME '" << (*i)->getFullname() << "'\n";
92 
93  edm::LogPrint("DQMReferenceHistogramRootFileEventSetupAnalyzer") << "SIZE FILE = " << tb->size() << std::endl;
94  }
95  }

References MillePedeFileConverter_cfg::e, Exception, fileBlobToken_, edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::getData(), mps_fire::i, init_, timingPdfMaker::outfile, convertSQLitetoXML_cfg::output, MatrixUtil::remove(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::eventsetup::EventSetupRecordKey::type().

Member Data Documentation

◆ fileBlobToken_

const edm::ESGetToken<FileBlob, DQMReferenceHistogramRootFileRcd> edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::fileBlobToken_
private

Definition at line 31 of file DQMReferenceHistogramRootFileEventSetupAnalyzer.cc.

Referenced by beginRun().

◆ init_

bool edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::init_
private
edm::eventsetup::heterocontainer::HCTypeTag::findType
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
mps_fire.i
i
Definition: mps_fire.py:428
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::fileBlobToken_
const edm::ESGetToken< FileBlob, DQMReferenceHistogramRootFileRcd > fileBlobToken_
Definition: DQMReferenceHistogramRootFileEventSetupAnalyzer.cc:31
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
dqm::legacy::DQMStore
Definition: DQMStore.h:727
edm::eventsetup::EventSetupRecordKey::TypeTag
heterocontainer::HCTypeTag TypeTag
Definition: EventSetupRecordKey.h:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Service
Definition: Service.h:30
Exception
Definition: hltDiff.cc:245
edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::init_
bool init_
Definition: DQMReferenceHistogramRootFileEventSetupAnalyzer.cc:32
MatrixUtil.remove
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:219
timingPdfMaker.outfile
outfile
Definition: timingPdfMaker.py:351
dqm
Definition: DQMStore.h:18
edm::Log
Definition: MessageLogger.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37