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
 
 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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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 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::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 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 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:303
const std::string inputFileName_

◆ ~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.

References fileBlobLabel_, inputDir_, inputFileName_, eostools::move(), and edm::LuminosityBlock::put().

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 }
const std::string fileBlobLabel_
void put(std::unique_ptr< PROD > product)
Put a new product.
const std::string inputFileName_
Log< level::Info, false > LogInfo
def move(src, dest)
Definition: eostools.py:511

◆ fillDescriptions()

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

Definition at line 42 of file MillePedeFileConverter.cc.

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

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