CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

virtual void endLuminosityBlockProduce (edm::LuminosityBlock &, const edm::EventSetup &) overridefinal
 
virtual 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
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 12 of file MillePedeFileConverter.cc.

References fileBlobLabel_.

13  : inputDir_(iConfig.getParameter<std::string>("fileDir")),
14  inputFileName_(iConfig.getParameter<std::string>("inputBinaryFile")),
15  fileBlobLabel_(iConfig.getParameter<std::string>("fileBlobLabel")) {
16  // We define what this producer produces: A FileBlobCollection
17  produces<FileBlobCollection, edm::InLumi>(fileBlobLabel_);
18 }
const std::string fileBlobLabel_
T getParameter(std::string const &) const
const std::string inputFileName_
MillePedeFileConverter::~MillePedeFileConverter ( )

Definition at line 20 of file MillePedeFileConverter.cc.

20 {}

Member Function Documentation

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

Definition at line 22 of file MillePedeFileConverter.cc.

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

23  {
24  edm::LogInfo("MillePedeFileActions")
25  << "Inserting all data from file " << inputDir_ + inputFileName_
26  << " as a FileBlob to the lumi, using label \"" << fileBlobLabel_
27  << "\".";
28  // Preparing the FileBlobCollection:
29  auto fileBlobCollection = std::make_unique<FileBlobCollection>();
30  FileBlob fileBlob;
31  try {
32  // Creating the FileBlob:
33  // (The FileBlob will signal problems with the file itself.)
34  fileBlob = FileBlob(inputDir_ + inputFileName_, true);
35  }
36  catch (...) {
37  // When creation of the FileBlob fails:
38  edm::LogError("MillePedeFileActions")
39  << "Error: No FileBlob could be created from the file \""
40  << inputDir_ + inputFileName_ << "\".";
41  throw;
42  }
43  if (fileBlob.size() > 0) {
44  // Adding the FileBlob to the lumi:
45  fileBlobCollection->addFileBlob(fileBlob);
46  }
47  iLumi.put(std::move(fileBlobCollection), fileBlobLabel_);
48 }
const std::string fileBlobLabel_
def move
Definition: eostools.py:510
const std::string inputFileName_
void put(std::auto_ptr< PROD > product)
Put a new product.
void MillePedeFileConverter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 52 of file MillePedeFileConverter.cc.

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

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

Implements edm::one::EDProducerBase.

Definition at line 36 of file MillePedeFileConverter.h.

Referenced by JSONExport.JsonExport::export().

36 {}

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