14 #include "CLHEP/Random/RandFlat.h" 15 #include "CLHEP/Random/RandGauss.h" 33 : fp_(iConfig.getUntrackedParameter<
edm::FileInPath>(
34 "file",
edm::FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
35 printdebug_(iConfig.getUntrackedParameter<uint32_t>(
"printDebug", 1)),
40 edm::LogInfo(
"SiStripSummaryBuilder") <<
"... creating dummy SiStripSummary Data for Run " <<
run <<
"\n " 48 std::vector<std::string> userDBContent;
49 typedef std::vector<edm::ParameterSet> VParameters;
51 VParameters::iterator ithistoList =
histoList.begin();
52 VParameters::iterator ithistoListEnd =
histoList.end();
54 for (; ithistoList != ithistoListEnd; ++ithistoList) {
56 std::vector<std::string> Quantities =
57 ithistoList->getUntrackedParameter<std::vector<std::string> >(
"quantitiesToExtract");
58 for (
size_t i = 0;
i < Quantities.size(); ++
i) {
59 if (Quantities[
i] ==
"landau") {
64 }
else if (Quantities[
i] ==
"gauss") {
68 }
else if (Quantities[
i] ==
"stat") {
74 <<
"Quantity " << Quantities[
i] <<
" cannot be handled\nAllowed quantities are" 75 <<
"\n 'stat' that includes: entries, mean, rms" 76 <<
"\n 'landau' that includes: landauPeak, landauPeakErr, landauSFWHM, landauChi2NDF" 77 <<
"\n 'gauss' that includes: gaussMean, gaussSigma, gaussChi2NDF" << std::endl;
81 obj.setUserDBContent(userDBContent);
83 std::stringstream ss1;
84 ss1 <<
"QUANTITIES TO BE INSERTED IN DB :" 86 std::vector<std::string> userDBContentA =
obj.getUserDBContent();
87 for (
size_t i = 0;
i < userDBContentA.size(); ++
i)
88 ss1 << userDBContentA[
i] << std::endl;
93 std::stringstream ss2;
94 for (uint32_t detid = 0; detid < 430; detid++) {
96 for (
unsigned int i = 0;
i < userDBContent.size();
i++)
97 values.push_back((
float)CLHEP::RandGauss::shoot(50., 30.));
99 ss2 <<
"\n\tdetid " << detid;
100 for (
size_t j = 0;
j <
values.size(); ++
j)
101 ss2 <<
"\n\t\t " << userDBContent[
j] <<
" " <<
values[
j];
138 edm::LogError(
"SiStripSummaryBuilder") <<
"Service is unavailable" << std::endl;
T getParameter(std::string const &) const
cond::Time_t beginOfTime() const
Log< level::Error, false > LogError
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
~SiStripSummaryBuilder() override=default
bool isNewTagRequest(const std::string &recordName)
cond::Time_t currentTime() const
SiStripSummaryBuilder(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_MODULE(type)
std::vector< float > InputVector
Log< level::Info, false > LogInfo
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::ParameterSet iConfig_