1 #ifndef SISTRIPPOPCON_UNITTEST_HANDLER_NOISE_H
2 #define SISTRIPPOPCON_UNITTEST_HANDLER_NOISE_H
25 #include "CLHEP/Random/RandFlat.h"
26 #include "CLHEP/Random/RandGauss.h"
44 m_name(pset.getUntrackedParameter<std::string>(
"name",
"SiStripPopPopConConfigDbObjHandler")),
45 m_since(pset.getUntrackedParameter<uint32_t>(
"since",5)),
55 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[getNewObjects] for PopCon application " <<
m_name;
59 ss <<
"\n\n------- " <<
m_name
60 <<
" - > getNewObjects\n";
63 ss <<
"got offlineInfo"<<
65 <<
" , last object valid since "
83 ss <<
" First object for this tag ";
85 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") << ss.str();
90 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[getNewObjects] for PopCon application " <<
m_name <<
" Done\n--------------\n";
104 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[getDataType] for PopCon application " <<
m_name <<
" " <<
typeid(
T).
name();
117 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[isTransferNeeded] checking for transfer" << std::endl;
118 std::stringstream ss_logdb, ss;
119 std::stringstream ss1;
127 ss <<
"@ " << clock() ;
129 if (!strcmp(ss.str().c_str(),ss_logdb.str().c_str())){
132 <<
"[isTransferNeeded] the selected conditions are already uploaded in the last iov ("
140 <<
"[isTransferNeeded] the selected conditions will be uploaded: " << ss.str()
141 <<
"\n A- "<< ss.str() <<
"\n B- " << ss_logdb.str() <<
"\n Fine";
150 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"[setForTransfer] " <<
m_name <<
" getting data to be transferred " << std::endl;
164 edm::LogInfo (
"SiStripPopPopConConfigDbObjHandler") <<
"setting since = "<<
m_since <<std::endl;
167 edm::LogError (
"SiStripPopPopConConfigDbObjHandler") <<
"[setForTransfer] " <<
m_name <<
" : NULL pointer of obj " <<
typeid(
T).
name() <<
" reported by SiStripCondObjBuilderFromDb\n Transfer aborted"<<std::endl;
187 edm::FileInPath fp_(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
190 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo > DetInfos = reader.
getAllData();
193 for(std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it = DetInfos.begin(); it != DetInfos.end(); it++){
202 float noise = CLHEP::RandGauss::shoot(MeanNoise,RmsNoise);
207 obj->setData(noise,theSiStripVector);
209 edm::LogInfo(
"SiStripNoisesBuilder") <<
"detid " << it->first <<
" \t"
210 <<
" strip " <<
strip <<
" \t"
212 << theSiStripVector.back()/10 <<
" \t"
216 if ( ! obj->put(it->first,theSiStripVector) )
217 edm::LogError(
"SiStripNoisesBuilder")<<
"[SiStripNoisesBuilder::analyze] detid already exists"<<std::endl;
228 #endif //SISTRIPPOPCON_UNITTEST_HANDLER_H
std::string m_userTextLog
std::string const & userTextLog() const
std::vector< uint16_t > InputVector
unsigned long long m_since
edm::Service< SiStripCondObjBuilderFromDb > condObjBuilder
std::string destinationDB
std::string lastPayloadToken
OldContainer m_to_transfer
cond::TagInfo const & tagInfo() const
cond::LogDBEntry const & logDBEntry() const
const std::map< uint32_t, DetInfo > & getAllData() const
tuple obj
Example code starts here #.
~SiStripPopConHandlerUnitTestNoise()
SiStripPopConHandlerUnitTestNoise(const edm::ParameterSet &pset)
std::string payloadContainer
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
cond::ValidityInterval lastInterval
std::string fullPath() const
tuple size
Write out results.