CMS 3D CMS Logo

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

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 
void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMXMLFileEventSetupAnalyzer (const edm::ParameterSet &pset)
 
 DQMXMLFileEventSetupAnalyzer (int i)
 
 ~DQMXMLFileEventSetupAnalyzer () 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)
 

Private Attributes

const edm::ESGetToken< FileBlob, DQMXMLFileRcdfileBlobToken_
 
bool init_
 
std::string labelToGet_
 

Additional Inherited Members

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

Definition at line 20 of file DQMXMLFileEventSetupAnalyzer.cc.

Constructor & Destructor Documentation

◆ DQMXMLFileEventSetupAnalyzer() [1/2]

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

Definition at line 34 of file DQMXMLFileEventSetupAnalyzer.cc.

References init_.

36  esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", ps.getParameter<std::string>("labelToGet")))),
37  labelToGet_(ps.getParameter<std::string>("labelToGet")) {
38  init_ = false;
39  edm::LogPrint("DQMXMLFileEventSetupAnalyzer")
40  << "DQMXMLFileEventSetupAnalyzer(const edm::ParameterSet &ps)" << std::endl;
41  }
Log< level::Warning, true > LogPrint
const edm::ESGetToken< FileBlob, DQMXMLFileRcd > fileBlobToken_

◆ DQMXMLFileEventSetupAnalyzer() [2/2]

edmtest::DQMXMLFileEventSetupAnalyzer::DQMXMLFileEventSetupAnalyzer ( int  i)
explicit

Definition at line 43 of file DQMXMLFileEventSetupAnalyzer.cc.

References mps_fire::i, and init_.

43  {
44  init_ = false;
45  edm::LogPrint("DQMXMLFileEventSetupAnalyzer") << "DQMXMLFileEventSetupAnalyzer(int i) " << i << std::endl;
46  }
Log< level::Warning, true > LogPrint

◆ ~DQMXMLFileEventSetupAnalyzer()

edmtest::DQMXMLFileEventSetupAnalyzer::~DQMXMLFileEventSetupAnalyzer ( )
override

Definition at line 48 of file DQMXMLFileEventSetupAnalyzer.cc.

References init_.

48  {
49  init_ = false;
50  edm::LogPrint("DQMXMLFileEventSetupAnalyzer") << "~DQMXMLFileEventSetupAnalyzer" << std::endl;
51  }
Log< level::Warning, true > LogPrint

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 53 of file DQMXMLFileEventSetupAnalyzer.cc.

53 { return; }

◆ beginRun()

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

Definition at line 55 of file DQMXMLFileEventSetupAnalyzer.cc.

References Exception, fileBlobToken_, edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::getData(), init_, labelToGet_, skim900GeV_StreamA_MinBiasPD_cfg::output1, AlCaHLTBitMon_QueryRunRegistry::string, and edm::eventsetup::EventSetupRecordKey::type().

55  {
56  edm::LogPrint("DQMXMLFileEventSetupAnalyzer") << "DQMXMLFileEventSetupAnalyzer::beginRun()" << std::endl;
57  if (!init_) {
58  init_ = true;
61  if (recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
62  throw cms::Exception("Record not found") << "Record \"DQMXMLFileRcd"
63  << "\" does not exist!" << std::endl;
64  }
65 
66  const auto& rootgeo = &iSetup.getData(fileBlobToken_);
67  edm::LogPrint("DQMXMLFileEventSetupAnalyzer") << "XML FILE IN MEMORY 1 with label " << labelToGet_ << std::endl;
68  std::unique_ptr<std::vector<unsigned char> > tb1((*rootgeo).getUncompressedBlob());
69  //here you can implement the stream for putting the TFile on disk...
70  std::string outfile1("XML1_retrieved.xml");
71  std::ofstream output1(outfile1.c_str());
72  output1.write((const char*)&(*tb1)[0], tb1->size());
73  output1.close();
74 
75  // iSetup.get<DQMXMLFileRcd>().get("XML2_mio",rootgeo);
76  // std::cout<<"ROOT FILE IN MEMORY 2"<<std::endl;
77  // std::unique_ptr<std::vector<unsigned char> > tb2( (*rootgeo).getUncompressedBlob() );
78  // //here you can implement the stream for putting the TFile on disk...
79  // std::string outfile2("XML2_retrieved.xml") ;
80  // std::ofstream output2(outfile2.c_str()) ;
81  // output2.write((const char *)&(*tb2)[0], tb2->size());
82  // output2.close() ;
83  // std::unique_ptr<std::vector<unsigned char> > tb( (*rootgeo).getUncompressedBlob() );
84  }
85  }
Log< level::Warning, true > LogPrint
heterocontainer::HCTypeTag TypeTag
const edm::ESGetToken< FileBlob, DQMXMLFileRcd > fileBlobToken_
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

Member Data Documentation

◆ fileBlobToken_

const edm::ESGetToken<FileBlob, DQMXMLFileRcd> edmtest::DQMXMLFileEventSetupAnalyzer::fileBlobToken_
private

Definition at line 29 of file DQMXMLFileEventSetupAnalyzer.cc.

Referenced by beginRun().

◆ init_

bool edmtest::DQMXMLFileEventSetupAnalyzer::init_
private

◆ labelToGet_

std::string edmtest::DQMXMLFileEventSetupAnalyzer::labelToGet_
private

Definition at line 31 of file DQMXMLFileEventSetupAnalyzer.cc.

Referenced by beginRun().