1 #ifndef SISTRIPPOPCON_UNITTEST_HANDLER_H
2 #define SISTRIPPOPCON_UNITTEST_HANDLER_H
24 #include "CLHEP/Random/RandFlat.h"
25 #include "CLHEP/Random/RandGauss.h"
42 m_name(pset.getUntrackedParameter<std::
string>(
"name",
"SiStripPopPopConConfigDbObjHandler")),
43 m_since(pset.getUntrackedParameter<uint32_t>(
"since",5)),
53 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[getNewObjects] for PopCon application " <<
m_name;
57 ss <<
"\n\n------- " <<
m_name
58 <<
" - > getNewObjects\n";
61 ss <<
"got offlineInfo"<<
63 <<
" , last object valid since "
81 ss <<
" First object for this tag ";
83 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") << ss.str();
88 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[getNewObjects] for PopCon application " <<
m_name <<
" Done\n--------------\n";
102 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[getDataType] for PopCon application " <<
m_name <<
" " <<
typeid(
T).
name();
115 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[isTransferNeeded] checking for transfer" << std::endl;
116 std::stringstream ss_logdb,
ss;
117 std::stringstream ss1;
125 ss <<
"@ " << clock() ;
127 if (!strcmp(ss.str().c_str(),ss_logdb.str().c_str())){
130 <<
"[isTransferNeeded] the selected conditions are already uploaded in the last iov ("
132 << this->
logDBEntry().payloadName <<
" in the db "
138 <<
"[isTransferNeeded] the selected conditions will be uploaded: " << ss.str()
139 <<
"\n A- "<< ss.str() <<
"\n B- " << ss_logdb.str() <<
"\n Fine";
148 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[setForTransfer] " <<
m_name <<
" getting data to be transferred " << std::endl;
162 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"setting since = "<<
m_since <<std::endl;
165 edm::LogError (
"SiStripPopPopConConfigDbObjHandler") <<
"[setForTransfer] " <<
m_name <<
" : NULL pointer of obj " <<
typeid(
T).
name() <<
" reported by SiStripCondObjBuilderFromDb\n Transfer aborted"<<std::endl;
185 edm::FileInPath fp_(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
188 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo > DetInfos =
reader.getAllData();
191 for(std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it = DetInfos.begin(); it != DetInfos.end(); it++){
195 for(
int strip=0; strip<128*it->second.nApvs; ++strip){
200 float noise = CLHEP::RandGauss::shoot(MeanNoise,RmsNoise);
205 obj->setData(noise,theSiStripVector);
207 edm::LogInfo(
"SiStripNoisesBuilder") <<
"detid " << it->first <<
" \t"
208 <<
" strip " << strip <<
" \t"
210 << theSiStripVector.back()/10 <<
" \t"
214 if ( ! obj->put(it->first,theSiStripVector) )
215 edm::LogError(
"SiStripNoisesBuilder")<<
"[SiStripNoisesBuilder::analyze] detid already exists"<<std::endl;
226 #endif //SISTRIPPOPCON_UNITTEST_HANDLER_H
std::string m_userTextLog
std::string const & userTextLog() const
edm::Service< SiStripCondObjBuilderFromDb > condObjBuilder
std::vector< uint16_t > InputVector
OldContainer m_to_transfer
SiStripPopConHandlerUnitTest(const edm::ParameterSet &pset)
cond::ValidityInterval lastInterval
cond::LogDBEntry_t const & logDBEntry() const
unsigned long long m_since
std::string destinationDB
std::string lastPayloadToken
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
volatile std::atomic< bool > shutdown_flag false
std::string fullPath() const
tuple size
Write out results.
cond::TagInfo_t const & tagInfo() const
~SiStripPopConHandlerUnitTest()