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
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, 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)
 

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
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<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- 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>
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)
 
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 28 of file MillePedeFileConverter.h.

Constructor & Destructor Documentation

◆ MillePedeFileConverter()

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

Definition at line 13 of file MillePedeFileConverter.cc.

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 }

References fileBlobLabel_.

◆ ~MillePedeFileConverter()

MillePedeFileConverter::~MillePedeFileConverter ( )
override

Definition at line 21 of file MillePedeFileConverter.cc.

21 {}

Member Function Documentation

◆ endLuminosityBlockProduce()

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

Definition at line 23 of file MillePedeFileConverter.cc.

23  {
24  edm::LogInfo("MillePedeFileActions") << "Inserting all data from file " << inputDir_ + inputFileName_
25  << " as a FileBlob to the lumi, using label \"" << fileBlobLabel_ << "\".";
26  // Preparing the FileBlobCollection:
27  auto fileBlobCollection = std::make_unique<FileBlobCollection>();
28 
29  // Creating the FileBlob:
30  // (The FileBlob will signal problems with the file itself.)
31  FileBlob fileBlob{inputDir_ + inputFileName_, true};
32 
33  if (fileBlob.size() > 0) { // skip if no data or FileBlob file not found
34  // Adding the FileBlob to the lumi:
35  fileBlobCollection->addFileBlob(fileBlob);
36  }
37  iLumi.put(std::move(fileBlobCollection), fileBlobLabel_);
38 }

References fileBlobLabel_, es_hardcode_cfi::iLumi, inputDir_, inputFileName_, and eostools::move().

◆ fillDescriptions()

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

Definition at line 42 of file MillePedeFileConverter.cc.

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

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

◆ 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().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MillePedeFileConverter::inputDir_
const std::string inputDir_
Definition: MillePedeFileConverter.h:38
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
es_hardcode_cfi.iLumi
iLumi
Definition: es_hardcode_cfi.py:206
MillePedeFileConverter::fileBlobLabel_
const std::string fileBlobLabel_
Definition: MillePedeFileConverter.h:40
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition: ConfigurationDescriptions.cc:48
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
FileBlob
Definition: FileBlob.h:10
MillePedeFileConverter::inputFileName_
const std::string inputFileName_
Definition: MillePedeFileConverter.h:39