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
 
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
 
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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 28 of file MillePedeFileConverter.h.

Constructor & Destructor Documentation

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
const std::string inputFileName_
MillePedeFileConverter::~MillePedeFileConverter ( )
override

Definition at line 21 of file MillePedeFileConverter.cc.

21 {}

Member Function Documentation

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

Referenced by produce().

24  {
25  edm::LogInfo("MillePedeFileActions")
26  << "Inserting all data from file " << inputDir_ + inputFileName_
27  << " as a FileBlob to the lumi, using label \"" << fileBlobLabel_
28  << "\".";
29  // Preparing the FileBlobCollection:
30  auto fileBlobCollection = std::make_unique<FileBlobCollection>();
31 
32  // Creating the FileBlob:
33  // (The FileBlob will signal problems with the file itself.)
34  FileBlob fileBlob{inputDir_ + inputFileName_, true};
35 
36  if (fileBlob.size() > 0) { // skip if no data or FileBlob file not found
37  // Adding the FileBlob to the lumi:
38  fileBlobCollection->addFileBlob(fileBlob);
39  }
40  iLumi.put(std::move(fileBlobCollection), fileBlobLabel_);
41 }
const std::string fileBlobLabel_
void put(std::unique_ptr< PROD > product)
Put a new product.
const std::string inputFileName_
def move(src, dest)
Definition: eostools.py:510
void MillePedeFileConverter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 45 of file MillePedeFileConverter.cc.

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

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

Member Data Documentation

const std::string MillePedeFileConverter::fileBlobLabel_
private

Definition at line 42 of file MillePedeFileConverter.h.

Referenced by endLuminosityBlockProduce(), and MillePedeFileConverter().

const std::string MillePedeFileConverter::inputDir_
private

Definition at line 40 of file MillePedeFileConverter.h.

Referenced by endLuminosityBlockProduce().

const std::string MillePedeFileConverter::inputFileName_
private

Definition at line 41 of file MillePedeFileConverter.h.

Referenced by endLuminosityBlockProduce().