1 #ifndef SISTRIPPOPCON_UNITTEST_HANDLER_NOISE_H
2 #define SISTRIPPOPCON_UNITTEST_HANDLER_NOISE_H
24 #include "CLHEP/Random/RandFlat.h"
25 #include "CLHEP/Random/RandGauss.h"
41 :
m_name(pset.getUntrackedParameter<std::
string>(
"name",
"SiStripPopPopConConfigDbObjHandler")),
42 m_since(pset.getUntrackedParameter<uint32_t>(
"since", 5)),
52 edm::LogInfo(
"SiStripPopPopConConfigDbObjHandler") <<
"[getNewObjects] for PopCon application " <<
m_name;
56 ss <<
"\n\n------- " <<
m_name <<
" - > getNewObjects\n";
73 <<
"\n\n-- user text "
76 ss <<
" First object for this tag ";
78 edm::LogInfo(
"SiStripPopPopConConfigDbObjHandler") << ss.str();
84 <<
"[getNewObjects] for PopCon application " <<
m_name <<
" Done\n--------------\n";
97 <<
"[getDataType] for PopCon application " <<
m_name <<
" " <<
typeid(
T).
name();
106 edm::LogInfo(
"SiStripPopPopConConfigDbObjHandler") <<
"[isTransferNeeded] checking for transfer" << std::endl;
107 std::stringstream ss_logdb,
ss;
108 std::stringstream ss1;
116 ss <<
"@ " << clock();
118 if (!strcmp(ss.str().c_str(), ss_logdb.str().c_str())) {
121 <<
"[isTransferNeeded] the selected conditions are already uploaded in the last iov ("
124 <<
"\n NO TRANSFER NEEDED";
129 <<
"[isTransferNeeded] the selected conditions will be uploaded: " << ss.str() <<
"\n A- " << ss.str()
130 <<
"\n B- " << ss_logdb.str() <<
"\n Fine";
139 <<
"[setForTransfer] " <<
m_name <<
" getting data to be transferred " << std::endl;
150 if (obj !=
nullptr) {
151 edm::LogInfo(
"SiStripPopPopConConfigDbObjHandler") <<
"setting since = " <<
m_since << std::endl;
155 <<
"[setForTransfer] " <<
m_name <<
" : NULL pointer of obj " <<
typeid(
T).
name()
156 <<
" reported by SiStripCondObjBuilderFromDb\n Transfer aborted" << std::endl;
175 for (
const auto& it : detInfo.getAllData()) {
183 float noise = CLHEP::RandGauss::shoot(MeanNoise, RmsNoise);
188 obj->setData(noise, theSiStripVector);
190 edm::LogInfo(
"SiStripNoisesBuilder") <<
"detid " << it.first <<
" \t"
191 <<
" strip " <<
strip <<
" \t" << noise <<
" \t"
192 << theSiStripVector.back() / 10 <<
" \t" << std::endl;
195 if (!obj->put(it.first, theSiStripVector))
197 <<
"[SiStripNoisesBuilder::analyze] detid already exists" << std::endl;
205 #endif //SISTRIPPOPCON_UNITTEST_HANDLER_H
std::string m_userTextLog
std::string const & userTextLog() const
~SiStripPopConHandlerUnitTestNoise() override
std::vector< uint16_t > InputVector
unsigned long long m_since
edm::Service< SiStripCondObjBuilderFromDb > condObjBuilder
Log< level::Error, false > LogError
std::vector< std::pair< T *, Time_t > > m_to_transfer
cond::LogDBEntry_t const & logDBEntry() const
SiStripDetInfo read(std::string filePath)
SiStripPopConHandlerUnitTestNoise(const edm::ParameterSet &pset)
std::string destinationDB
Log< level::Info, false > LogInfo
std::string id() const override
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void getNewObjects() override
static constexpr char const *const kDefaultFile
tuple size
Write out results.
cond::TagInfo_t const & tagInfo() const