CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
METCorrectorDBWriter Class Reference
Inheritance diagram for METCorrectorDBWriter:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void endJob () override
 
 METCorrectorDBWriter (const edm::ParameterSet &)
 
 ~METCorrectorDBWriter ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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 ()
 

Private Attributes

std::string algo
 
std::string era
 
std::string inputTxtFile
 
std::string payloadTag
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 15 of file METCorrectorDBWriter.cc.

Constructor & Destructor Documentation

METCorrectorDBWriter::METCorrectorDBWriter ( const edm::ParameterSet pSet)
METCorrectorDBWriter::~METCorrectorDBWriter ( )
inline

Definition at line 22 of file METCorrectorDBWriter.cc.

22 {}

Member Function Documentation

virtual void METCorrectorDBWriter::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlineoverridevirtual

Implements edm::EDAnalyzer.

Definition at line 20 of file METCorrectorDBWriter.cc.

20 {}
void METCorrectorDBWriter::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 38 of file METCorrectorDBWriter.cc.

References algo, python.multivaluedict::append(), cond::service::PoolDBOutputService::appendSinceTime(), cond::service::PoolDBOutputService::beginOfTime(), gather_cfg::cout, cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::endOfTime(), era, METCorrectorParametersCollection::findLabel(), edm::FileInPath::fullPath(), METCorrectorParametersCollection::getSections(), i, input, inputTxtFile, edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), METCorrectorParametersCollection::N_LEVELS, fed_dqm_sourceclient-live_cfg::path, payloadTag, METCorrectorParametersCollection::push_back(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

39 {
40  std::string path("CondFormats/JetMETObjects/data/");
41 
43  std::cout << "Starting to import payload " << payloadTag << " from text files." << std::endl;
45  {
46  std::string append("_");
47  std::string ilev = METCorrectorParametersCollection::findLabel( static_cast<METCorrectorParametersCollection::Level_t>(i) );
48  append += ilev;
49  append += "_";
50  append += algo;
51  append += ".txt";
53  std::ifstream input( ("../../../"+inputTxtFile).c_str() );
54  if ( input.good() ) {
56  std::cout << "Opened file " << inputTxtFile << std::endl;
57  std::vector<std::string> sections;
59  if(sections.size() == 0){
60  payload->push_back(i, METCorrectorParameters(fip.fullPath(),"") );
61  }else{
62  for ( std::vector<std::string>::const_iterator isectbegin = sections.begin(), isectend = sections.end(), isect = isectbegin;
63  isect != isectend; ++isect ) {
64  payload->push_back( i, METCorrectorParameters(fip.fullPath(),*isect), ilev + "_" + *isect );
65  std::cout << "Added " << ilev + "_" + *isect << " to record " << i << std::endl;
66  }
67  }
68  std::cout << "Added record " << i << std::endl;
69  }else{
70  std::cout<<"Have not found METC file: "<<inputTxtFile<<std::endl;
71  }
72  }
73 
74  std::cout << "Opening PoolDBOutputService" << std::endl;
75 
77  if (s.isAvailable())
78  {
79  std::cout << "Setting up payload tag " << payloadTag << std::endl;
81  {
82  std::cout<<"NewTagRequested"<<std::endl;
84  }else{
86  }
87  }
88  std::cout << "Wrote in CondDB payload label: " << payloadTag << std::endl;
89 }
int i
Definition: DBlmapReader.cc:9
static void getSections(std::string inputFile, std::vector< std::string > &outputs)
static std::string const input
Definition: EdmProvDump.cc:43
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
static std::string findLabel(key_type k)
void push_back(key_type i, value_type const &j, label_type const &source="")
bool isAvailable() const
Definition: Service.h:46
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
tuple cout
Definition: gather_cfg.py:121
virtual void METCorrectorDBWriter::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file METCorrectorDBWriter.cc.

21 {}

Member Data Documentation

std::string METCorrectorDBWriter::algo
private

Definition at line 26 of file METCorrectorDBWriter.cc.

Referenced by beginJob(), and METCorrectorDBWriter().

std::string METCorrectorDBWriter::era
private

Definition at line 25 of file METCorrectorDBWriter.cc.

Referenced by beginJob(), and METCorrectorDBWriter().

std::string METCorrectorDBWriter::inputTxtFile
private

Definition at line 27 of file METCorrectorDBWriter.cc.

Referenced by beginJob().

std::string METCorrectorDBWriter::payloadTag
private

Definition at line 28 of file METCorrectorDBWriter.cc.

Referenced by beginJob(), and METCorrectorDBWriter().