CMS 3D CMS Logo

DBReader.cc
Go to the documentation of this file.
1 // #include "CondFormats/PhysicsToolsObjects/interface/Histogram2D.h"
4 
5 #include "DBReader.h"
6 
7 #include <iostream>
8 #include <cstdio>
9 #include <sys/time.h>
10 #include <string>
11 
12 DBReader::DBReader(const edm::ParameterSet& iConfig) : type_(iConfig.getUntrackedParameter<std::string>("Type")) {}
13 
16  iSetup.get<MuScleFitDBobjectRcd>().get(dbObject);
17  edm::LogInfo("DBReader") << "[DBReader::analyze] End Reading MuScleFitDBobjectRcd" << std::endl;
18 
19  std::cout << "identifiers size from dbObject = " << dbObject->identifiers.size() << std::endl;
20  std::cout << "parameters size from dbObject = " << dbObject->parameters.size() << std::endl;
21  ;
22 
23  // This string is one of: scale, resolution, background.
24  // Create the corrector and set the parameters
25  if (type_ == "scale")
26  corrector_.reset(new MomentumScaleCorrector(dbObject.product()));
27  else if (type_ == "resolution")
28  resolution_.reset(new ResolutionFunction(dbObject.product()));
29  else if (type_ == "background")
30  background_.reset(new BackgroundFunction(dbObject.product()));
31  else {
32  std::cout << "Error: unrecognized type. Use one of those: 'scale', 'resolution', 'background'" << std::endl;
33  exit(1);
34  }
35 
36  // cout << "pointer = " << corrector_.get() << endl;
37 }
38 
39 //: printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug",1)){}
40 
42 
43 void DBReader::analyze(const edm::Event& e, const edm::EventSetup& iSetup) {
44  initialize(iSetup);
45  if (type_ == "scale")
47  else if (type_ == "resolution")
49  else if (type_ == "background")
51 }
52 
55 
MuScleFitDBobjectRcd.h
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
DBReader::background_
std::shared_ptr< BackgroundFunction > background_
Definition: DBReader.h:60
MomentumScaleCorrector
Definition: MomentumScaleCorrector.h:25
DBReader::~DBReader
~DBReader() override
Definition: DBReader.cc:41
BackgroundFunction
Definition: BackgroundFunction.h:15
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DBReader::resolution_
std::shared_ptr< ResolutionFunction > resolution_
Definition: DBReader.h:59
MuScleFitDBobjectRcd
Definition: MuScleFitDBobjectRcd.h:6
DBReader::printParameters
void printParameters(const T &functionPtr)
Definition: DBReader.h:35
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
DBReader.h
MuScleFitDBobject::identifiers
std::vector< int > identifiers
Definition: MuScleFitDBobject.h:9
MakerMacros.h
DBReader::type_
std::string type_
Definition: DBReader.h:56
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MuScleFitDBobject::parameters
std::vector< double > parameters
Definition: MuScleFitDBobject.h:10
MuScleFitDBobject.h
edm::ESHandle< MuScleFitDBobject >
edm::ParameterSet
Definition: ParameterSet.h:47
ResolutionFunction
Definition: ResolutionFunction.h:15
DBReader::initialize
void initialize(const edm::EventSetup &iSetup)
Definition: DBReader.cc:14
ModuleDef.h
DBReader
Definition: DBReader.h:24
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
std
Definition: JetResolutionObject.h:76
DBReader::DBReader
DBReader(const edm::ParameterSet &)
Definition: DBReader.cc:12
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:52
DBReader::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: DBReader.cc:43
edm::Event
Definition: Event.h:73
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
DBReader::corrector_
std::shared_ptr< MomentumScaleCorrector > corrector_
Definition: DBReader.h:58