CMS 3D CMS Logo

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
 QGLikelihoodSystematicsDBWriter (const edm::ParameterSet &)
 
 ~QGLikelihoodSystematicsDBWriter () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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)
 

Private Attributes

std::string fileName
 
std::string payloadTag
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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< B > consumes (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 () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
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 18 of file QGLikelihoodSystematicsDBWriter.cc.

Constructor & Destructor Documentation

QGLikelihoodSystematicsDBWriter::QGLikelihoodSystematicsDBWriter ( const edm::ParameterSet pSet)
QGLikelihoodSystematicsDBWriter::~QGLikelihoodSystematicsDBWriter ( )
inlineoverride

Definition at line 24 of file QGLikelihoodSystematicsDBWriter.cc.

24 {}

Member Function Documentation

void QGLikelihoodSystematicsDBWriter::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlineoverridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 22 of file QGLikelihoodSystematicsDBWriter.cc.

22 {}
void QGLikelihoodSystematicsDBWriter::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 38 of file QGLikelihoodSystematicsDBWriter.cc.

References QGLikelihoodSystematicsObject::Entry::a, QGLikelihoodSystematicsObject::Entry::b, cond::service::PoolDBOutputService::beginOfTime(), category, QGLikelihoodSystematicsObject::data, Puppi_cff::etaMax, Puppi_cff::etaMin, fileName, contentValuesFiles::fullPath, recoMuon::in, edm::Service< T >::isAvailable(), geometryCSVtoXML::line, QGLikelihoodSystematicsObject::Entry::lmax, QGLikelihoodSystematicsObject::Entry::lmin, jetCorrFactors_cfi::payload, payloadTag, HLT_FULL_cff::ptMax, ptMin, QGLikelihoodCategory::QGIndex, HLT_FULL_cff::rhoMax, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, QGLikelihoodSystematicsObject::Entry::systCategory, GlobalPosition_Frontier_DevDB_cff::tag, and cond::service::PoolDBOutputService::writeOneIOV().

38  {
40  payload.data.clear();
41 
42  std::ifstream database;
43  database.open(edm::FileInPath(fileName.c_str()).fullPath().c_str(), std::ios::in);
44  if (!database.is_open()) {
45  edm::LogError("FileNotFound") << "Could not open file " << fileName << std::endl;
46  return;
47  }
49  while (std::getline(database, line)) {
50  float ptMin, ptMax, etaMin, etaMax, rhoMin, rhoMax, a_q, b_q, a_g, b_g, lmin, lmax;
51  char tag[1023], leadchar;
52  sscanf(line.c_str(), "%c", &leadchar);
53  if ((leadchar == '#') || (leadchar == '!'))
54  continue; //Skip those lines
55  sscanf(line.c_str(),
56  "%s %f %f %f %f %f %f %f %f %f %f %f %f",
57  &tag[0],
58  &ptMin,
59  &ptMax,
60  &rhoMin,
61  &rhoMax,
62  &etaMin,
63  &etaMax,
64  &a_q,
65  &b_q,
66  &a_g,
67  &b_g,
68  &lmin,
69  &lmax);
70 
72  category.RhoMin = rhoMin;
73  category.RhoMax = rhoMax;
74  category.PtMin = ptMin;
75  category.PtMax = ptMax;
76  category.EtaMin = etaMin;
77  category.EtaMax = etaMax;
78  category.QGIndex = 0;
79  category.VarIndex = -1;
80 
81  //quark entry
83  quarkEntry.systCategory = category;
84  quarkEntry.a = a_q;
85  quarkEntry.b = b_q;
86  quarkEntry.lmin = lmin;
87  quarkEntry.lmax = lmax;
88 
89  //gluon entry
90  QGLikelihoodSystematicsObject::Entry gluonEntry = quarkEntry;
91  gluonEntry.systCategory.QGIndex = 1;
92  gluonEntry.a = a_g;
93  gluonEntry.b = b_g;
94 
95  payload.data.push_back(quarkEntry);
96  payload.data.push_back(gluonEntry);
97  }
98  database.close();
99 
100  // Now write it into the DB
101  edm::LogInfo("UserOutput") << "Opening PoolDBOutputService" << std::endl;
103  if (s.isAvailable()) {
104  edm::LogInfo("UserOutput") << "Setting up payload with " << payload.data.size() << " entries and tag " << payloadTag
105  << std::endl;
106  s->writeOneIOV(payload, s->beginOfTime(), payloadTag);
107  }
108  edm::LogInfo("UserOutput") << "Wrote in CondDB QGLikelihoodSystematic payload label: " << payloadTag << std::endl;
109 }
static const char category[]
constexpr float ptMin
tuple etaMin
Definition: Puppi_cff.py:45
Log< level::Error, false > LogError
bool isAvailable() const
Definition: Service.h:40
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
Category structure: ranges associated with QGLikelihood histograms.
Log< level::Info, false > LogInfo
QGLikelihoodSystematicsObject containing the parameters for the systematic smearing.
tuple etaMax
Definition: Puppi_cff.py:46
void QGLikelihoodSystematicsDBWriter::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 23 of file QGLikelihoodSystematicsDBWriter.cc.

23 {}

Member Data Documentation

std::string QGLikelihoodSystematicsDBWriter::fileName
private
std::string QGLikelihoodSystematicsDBWriter::payloadTag
private

Definition at line 28 of file QGLikelihoodSystematicsDBWriter.cc.

Referenced by beginJob(), and QGLikelihoodSystematicsDBWriter().