CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
QGLikelihoodSystematicsDBWriter Class Reference
Inheritance diagram for QGLikelihoodSystematicsDBWriter:
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
 
 QGLikelihoodSystematicsDBWriter (const edm::ParameterSet &)
 
 ~QGLikelihoodSystematicsDBWriter ()
 
- 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
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::string fileName
 
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 18 of file QGLikelihoodSystematicsDBWriter.cc.

Constructor & Destructor Documentation

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

Definition at line 24 of file QGLikelihoodSystematicsDBWriter.cc.

24 {}

Member Function Documentation

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

Definition at line 22 of file QGLikelihoodSystematicsDBWriter.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 38 of file QGLikelihoodSystematicsDBWriter.cc.

References QGLikelihoodSystematicsObject::Entry::a, cond::service::PoolDBOutputService::appendSinceTime(), QGLikelihoodSystematicsObject::Entry::b, cond::service::PoolDBOutputService::beginOfTime(), python.rootplot.argparse::category, cond::service::PoolDBOutputService::createNewIOV(), QGLikelihoodSystematicsObject::data, DEFINE_FWK_MODULE, cond::service::PoolDBOutputService::endOfTime(), ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, fileName, recoMuon::in, edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), geometryCSVtoXML::line, QGLikelihoodSystematicsObject::Entry::lmax, QGLikelihoodSystematicsObject::Entry::lmin, jetCorrFactors_cfi::payload, payloadTag, AlignmentTrackSelector_cfi::ptMax, ALCARECOTkAlBeamHalo_cff::ptMin, QGLikelihoodCategory::QGIndex, electronConversionRejectionValidator::rhoMax, electronConversionRejectionValidator::rhoMin, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, QGLikelihoodSystematicsObject::Entry::systCategory, and GlobalPosition_Frontier_DevDB_cff::tag.

38  {
39 
41  payload->data.clear();
42 
43  std::ifstream database;
44  database.open(edm::FileInPath(fileName.c_str()).fullPath().c_str(),std::ios::in);
45  if(!database.is_open()){ edm::LogError("FileNotFound") << "Could not open file "<< fileName << std::endl; return;}
47  while(std::getline(database,line)){
48  float ptMin, ptMax, etaMin, etaMax, rhoMin, rhoMax, a_q, b_q, a_g, b_g, lmin, lmax;
49  char tag[1023],leadchar;
50  sscanf(line.c_str(),"%c",&leadchar);
51  if((leadchar=='#') || (leadchar=='!')) continue; //Skip those lines
52  sscanf(line.c_str(),"%s %f %f %f %f %f %f %f %f %f %f %f %f", &tag[0], &ptMin, &ptMax, &rhoMin, &rhoMax, &etaMin, &etaMax, &a_q, &b_q, &a_g, &b_g, &lmin, &lmax);
53 
55  category.RhoMin = rhoMin;
56  category.RhoMax = rhoMax;
57  category.PtMin = ptMin;
58  category.PtMax = ptMax;
59  category.EtaMin = etaMin;
60  category.EtaMax = etaMax;
61  category.QGIndex = 0;
62  category.VarIndex = -1;
63 
64  //quark entry
66  quarkEntry.systCategory = category;
67  quarkEntry.a = a_q;
68  quarkEntry.b = b_q;
69  quarkEntry.lmin = lmin;
70  quarkEntry.lmax = lmax;
71 
72  //gluon entry
73  QGLikelihoodSystematicsObject::Entry gluonEntry = quarkEntry;
74  gluonEntry.systCategory.QGIndex = 1;
75  gluonEntry.a = a_g;
76  gluonEntry.b = b_g;
77 
78  payload->data.push_back(quarkEntry);
79  payload->data.push_back(gluonEntry);
80  }
81  database.close();
82 
83  // Now write it into the DB
84  edm::LogInfo("UserOutput") << "Opening PoolDBOutputService" << std::endl;
86  if(s.isAvailable()){
87  edm::LogInfo("UserOutput") << "Setting up payload with " << payload->data.size() << " entries and tag " << payloadTag << std::endl;
90  }
91  edm::LogInfo("UserOutput") << "Wrote in CondDB QGLikelihoodSystematic payload label: " << payloadTag << std::endl;
92 }
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
payload
payload postfix for testing
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:46
Category structure: ranges associated with QGLikelihood histograms.
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
QGLikelihoodSystematicsObject containing the parameters for the systematic smearing.
virtual void QGLikelihoodSystematicsDBWriter::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 23 of file QGLikelihoodSystematicsDBWriter.cc.

23 {}

Member Data Documentation

std::string QGLikelihoodSystematicsDBWriter::fileName
private

Definition at line 27 of file QGLikelihoodSystematicsDBWriter.cc.

Referenced by beginJob(), and QGLikelihoodSystematicsDBWriter().

std::string QGLikelihoodSystematicsDBWriter::payloadTag
private

Definition at line 28 of file QGLikelihoodSystematicsDBWriter.cc.

Referenced by beginJob(), and QGLikelihoodSystematicsDBWriter().