17 #include "CLHEP/Random/RandFlat.h" 18 #include "CLHEP/Random/RandGauss.h" 36 : fp_(iConfig.getUntrackedParameter<
edm::FileInPath>(
37 "file",
edm::FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
38 printdebug_(iConfig.getUntrackedParameter<uint32_t>(
"printDebug", 1)),
43 edm::LogInfo(
"SiStripSummaryBuilder") <<
"... creating dummy SiStripSummary Data for Run " <<
run <<
"\n " 51 std::vector<std::string> userDBContent;
52 typedef std::vector<edm::ParameterSet> VParameters;
54 VParameters::iterator ithistoList =
histoList.begin();
55 VParameters::iterator ithistoListEnd =
histoList.end();
57 for (; ithistoList != ithistoListEnd; ++ithistoList) {
59 std::vector<std::string> Quantities =
60 ithistoList->getUntrackedParameter<std::vector<std::string> >(
"quantitiesToExtract");
61 for (
size_t i = 0;
i < Quantities.size(); ++
i) {
62 if (Quantities[
i] ==
"landau") {
67 }
else if (Quantities[
i] ==
"gauss") {
71 }
else if (Quantities[
i] ==
"stat") {
77 <<
"Quantity " << Quantities[
i] <<
" cannot be handled\nAllowed quantities are" 78 <<
"\n 'stat' that includes: entries, mean, rms" 79 <<
"\n 'landau' that includes: landauPeak, landauPeakErr, landauSFWHM, landauChi2NDF" 80 <<
"\n 'gauss' that includes: gaussMean, gaussSigma, gaussChi2NDF" << std::endl;
84 obj.setUserDBContent(userDBContent);
86 std::stringstream ss1;
87 ss1 <<
"QUANTITIES TO BE INSERTED IN DB :" 89 std::vector<std::string> userDBContentA =
obj.getUserDBContent();
90 for (
size_t i = 0;
i < userDBContentA.size(); ++
i)
91 ss1 << userDBContentA[
i] << std::endl;
96 std::stringstream ss2;
97 for (uint32_t detid = 0; detid < 430; detid++) {
99 for (
unsigned int i = 0;
i < userDBContent.size();
i++)
100 values.push_back((
float)CLHEP::RandGauss::shoot(50., 30.));
102 ss2 <<
"\n\tdetid " << detid;
103 for (
size_t j = 0;
j <
values.size(); ++
j)
104 ss2 <<
"\n\t\t " << userDBContent[
j] <<
" " <<
values[
j];
141 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_