CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
MillePedeFileConverter Class Reference

#include <MillePedeFileConverter.h>

Inheritance diagram for MillePedeFileConverter:
edm::one::EDProducer< edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MillePedeFileConverter (const edm::ParameterSet &)
 
 ~MillePedeFileConverter () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void endLuminosityBlockProduce (edm::LuminosityBlock &, const edm::EventSetup &) final
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const std::string fileBlobLabel_
 
const std::string inputDir_
 
const std::string inputFileName_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- 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 28 of file MillePedeFileConverter.h.

Constructor & Destructor Documentation

◆ MillePedeFileConverter()

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

Definition at line 13 of file MillePedeFileConverter.cc.

References fileBlobLabel_.

14  : inputDir_(iConfig.getParameter<std::string>("fileDir")),
15  inputFileName_(iConfig.getParameter<std::string>("inputBinaryFile")),
16  fileBlobLabel_(iConfig.getParameter<std::string>("fileBlobLabel")) {
17  // We define what this producer produces: A FileBlobCollection
18  produces<FileBlobCollection, edm::Transition::EndLuminosityBlock>(fileBlobLabel_);
19 }
const std::string fileBlobLabel_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const std::string inputFileName_

◆ ~MillePedeFileConverter()

MillePedeFileConverter::~MillePedeFileConverter ( )
overridedefault

Member Function Documentation

◆ endLuminosityBlockProduce()

void MillePedeFileConverter::endLuminosityBlockProduce ( edm::LuminosityBlock iLumi,
const edm::EventSetup iSetup 
)
finalprivate

Definition at line 21 of file MillePedeFileConverter.cc.

References fileBlobLabel_, Hcal_Conditions_forGlobalTag_cff::iLumi, inputDir_, inputFileName_, edm::one::EDProducerBase::moduleDescription(), HerwigMaxPtPartonFilter_cfi::moduleLabel, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), and eostools::move().

21  {
22  auto const& moduleType = moduleDescription().moduleName();
23  auto const& moduleLabel = moduleDescription().moduleLabel();
24 
25  edm::LogInfo("MillePedeFileActions") << "Inserting all data from file " << inputDir_ + inputFileName_
26  << " as a FileBlob to the lumi, using label \"" << fileBlobLabel_ << "\".";
27  // Preparing the FileBlobCollection:
28  auto fileBlobCollection = std::make_unique<FileBlobCollection>();
29 
30  // Creating the FileBlob:
31  // (The FileBlob will signal problems with the file itself.)
32  FileBlob fileBlob{inputDir_ + inputFileName_, true};
33 
34  if (fileBlob.size() > 0) { // skip if no data or FileBlob file not found
35  // Adding the FileBlob to the lumi:
36  fileBlobCollection->addFileBlob(fileBlob);
37  edm::LogInfo(moduleType) << "[" << moduleLabel << "] fileBlob size was not empty, putting file blob with size "
38  << fileBlob.size() << std::endl;
39  }
40 
41  edm::LogInfo(moduleType) << "[" << moduleLabel << "]"
42  << " Root file contains " << fileBlobCollection->size() << " FileBlob(s).";
43  iLumi.put(std::move(fileBlobCollection), fileBlobLabel_);
44 }
const std::string fileBlobLabel_
ModuleDescription const & moduleDescription() const
std::string const & moduleName() const
const std::string inputFileName_
Log< level::Info, false > LogInfo
std::string const & moduleLabel() const
def move(src, dest)
Definition: eostools.py:511

◆ fillDescriptions()

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

Definition at line 48 of file MillePedeFileConverter.cc.

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

48  {
50 
51  desc.add<std::string>("fileDir", "")
52  ->setComment(
53  "Keep the fileDir empty if you want to write to the current "
54  "directory. If you use it, it should end with a slash.");
55 
56  desc.add<std::string>("inputBinaryFile", "milleBinary.dat")
57  ->setComment("Filename of the file created by Mille in the AlignmentProducer");
58 
59  desc.add<std::string>("fileBlobLabel", "milleBinary.dat")
60  ->setComment(
61  "It's probably a good idea to keep the label the same as the "
62  "original filename(s). See configuration of "
63  "MillePedeFileExtractor, it should be the same there.");
64 
65  descriptions.add("millePedeFileConverter", desc);
66  descriptions.setComment(
67  "This is the generic cfi file for the "
68  "MillePedeFileConverter");
69 }
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void MillePedeFileConverter::produce ( edm::Event ,
const edm::EventSetup  
)
inlineoverrideprivatevirtual

Implements edm::one::EDProducerBase.

Definition at line 35 of file MillePedeFileConverter.h.

35 {}

Member Data Documentation

◆ fileBlobLabel_

const std::string MillePedeFileConverter::fileBlobLabel_
private

Definition at line 40 of file MillePedeFileConverter.h.

Referenced by endLuminosityBlockProduce(), and MillePedeFileConverter().

◆ inputDir_

const std::string MillePedeFileConverter::inputDir_
private

Definition at line 38 of file MillePedeFileConverter.h.

Referenced by endLuminosityBlockProduce().

◆ inputFileName_

const std::string MillePedeFileConverter::inputFileName_
private

Definition at line 39 of file MillePedeFileConverter.h.

Referenced by endLuminosityBlockProduce().