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::EndRunProducer > 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::EndRunProducer >
 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 (const std::string &iProcessName, std::vector< const char * > &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 endRunProduce (edm::Run &run, const edm::EventSetup &iSetup) overridefinal
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::string theFileBlobLabel
 
std::string theInputDir
 
std::string theInputFileName
 

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 theFileBlobLabel.

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

Definition at line 20 of file MillePedeFileConverter.cc.

20 {}

Member Function Documentation

void MillePedeFileConverter::endRunProduce ( edm::Run run,
const edm::EventSetup iSetup 
)
finaloverrideprivatevirtual

Definition at line 22 of file MillePedeFileConverter.cc.

References eostools::move(), edm::Run::put(), FileBlob::size(), theFileBlobLabel, theInputDir, and theInputFileName.

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

Definition at line 53 of file MillePedeFileConverter.cc.

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

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

Member Data Documentation

std::string MillePedeFileConverter::theFileBlobLabel
private

Definition at line 42 of file MillePedeFileConverter.h.

Referenced by endRunProduce(), and MillePedeFileConverter().

std::string MillePedeFileConverter::theInputDir
private

Definition at line 40 of file MillePedeFileConverter.h.

Referenced by endRunProduce().

std::string MillePedeFileConverter::theInputFileName
private

Definition at line 41 of file MillePedeFileConverter.h.

Referenced by endRunProduce().