1 #ifndef SISTRIPPOPCON_UNITTEST_HANDLER_GAIN_H 2 #define SISTRIPPOPCON_UNITTEST_HANDLER_GAIN_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";
74 <<
"\n\n-- user text " 77 ss <<
" First object for this tag ";
79 edm::LogInfo(
"SiStripPopPopConConfigDbObjHandler") << ss.str();
85 <<
"[getNewObjects] for PopCon application " <<
m_name <<
" Done\n--------------\n";
98 <<
"[getDataType] for PopCon application " <<
m_name <<
" " <<
typeid(
T).
name();
107 edm::LogInfo(
"SiStripPopPopConConfigDbObjHandler") <<
"[isTransferNeeded] checking for transfer" << std::endl;
108 std::stringstream ss_logdb,
ss;
109 std::stringstream ss1;
117 ss <<
"@ " << clock();
119 if (!strcmp(ss.str().c_str(), ss_logdb.str().c_str())) {
122 <<
"[isTransferNeeded] the selected conditions are already uploaded in the last iov (" 125 <<
"\n NO TRANSFER NEEDED";
130 <<
"[isTransferNeeded] the selected conditions will be uploaded: " << ss.str() <<
"\n A- " << ss.str()
131 <<
"\n B- " << ss_logdb.str() <<
"\n Fine";
140 <<
"[setForTransfer] " <<
m_name <<
" getting data to be transferred " << std::endl;
151 if (obj !=
nullptr) {
152 edm::LogInfo(
"SiStripPopPopConConfigDbObjHandler") <<
"setting since = " <<
m_since << std::endl;
156 <<
"[setForTransfer] " <<
m_name <<
" : NULL pointer of obj " <<
typeid(
T).
name()
157 <<
" reported by SiStripCondObjBuilderFromDb\n Transfer aborted" << std::endl;
176 edm::FileInPath fp_(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
179 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>& DetInfos =
reader.getAllData();
182 for (std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator it = DetInfos.begin();
183 it != DetInfos.end();
188 for (
int apv = 0; apv < it->second.nApvs; ++(++apv)) {
189 float MeanTick = 555.;
192 float tick = CLHEP::RandGauss::shoot(MeanTick, RmsTick);
195 edm::LogInfo(
"SiStripGainBuilder") <<
"detid " << it->first <<
" \t" 196 <<
" APV " << apv <<
" \t" << tick <<
" \t" << std::endl;
197 inputApvGain.push_back(tick);
198 inputApvGain.push_back(tick);
202 if (!obj->put(it->first, gain_range))
203 edm::LogError(
"SiStripGainBuilder") <<
"[SiStripGainBuilder::analyze] detid already exists" << std::endl;
211 #endif //SISTRIPPOPCON_UNITTEST_HANDLER_H ~SiStripPopConHandlerUnitTestGain() override
edm::Service< SiStripCondObjBuilderFromDb > condObjBuilder
std::string m_userTextLog
std::string const & userTextLog() const
unsigned long long m_since
OldContainer m_to_transfer
cond::ValidityInterval lastInterval
cond::LogDBEntry_t const & logDBEntry() const
std::pair< ContainerIterator, ContainerIterator > Range
SiStripPopConHandlerUnitTestGain(const edm::ParameterSet &pset)
std::string destinationDB
std::string lastPayloadToken
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void getNewObjects() override
std::vector< float > InputVector
std::string fullPath() const
std::string id() const override
cond::TagInfo_t const & tagInfo() const