#include <SiStripPopConHandlerUnitTestNoise.h>
Public Types | |
enum | DataType { UNDEFINED = 0, _Cabling = 1, _Pedestal = 2, _Noise = 3, _Threshold = 4, _BadStrip = 5, _Gain = 6 } |
Public Member Functions | |
void | getNewObjects () |
std::string | id () const |
SiStripPopConHandlerUnitTestNoise (const edm::ParameterSet &pset) | |
~SiStripPopConHandlerUnitTestNoise () | |
Private Member Functions | |
void | fillObject (T *&obj) |
DataType | getDataType () |
bool | isTransferNeeded () |
void | setForTransfer () |
Private Attributes | |
edm::Service < SiStripCondObjBuilderFromDb > | condObjBuilder |
bool | m_debugMode |
std::string | m_name |
unsigned long long | m_since |
Definition at line 36 of file SiStripPopConHandlerUnitTestNoise.h.
enum popcon::SiStripPopConHandlerUnitTestNoise::DataType |
Definition at line 39 of file SiStripPopConHandlerUnitTestNoise.h.
popcon::SiStripPopConHandlerUnitTestNoise< T >::SiStripPopConHandlerUnitTestNoise | ( | const edm::ParameterSet & | pset | ) | [inline] |
Definition at line 43 of file SiStripPopConHandlerUnitTestNoise.h.
: m_name(pset.getUntrackedParameter<std::string>("name","SiStripPopPopConConfigDbObjHandler")), m_since(pset.getUntrackedParameter<uint32_t>("since",5)), m_debugMode(pset.getUntrackedParameter<bool>("debug",false)){};
popcon::SiStripPopConHandlerUnitTestNoise< T >::~SiStripPopConHandlerUnitTestNoise | ( | ) | [inline] |
Definition at line 50 of file SiStripPopConHandlerUnitTestNoise.h.
{};
void popcon::SiStripPopConHandlerUnitTestNoise< T >::fillObject | ( | T *& | obj | ) | [inline, private] |
Definition at line 178 of file SiStripPopConHandlerUnitTestNoise.h.
References prof2calltree::count, edm::FileInPath::fullPath(), SiStripDetInfoFileReader::getAllData(), and strip().
Referenced by popcon::SiStripPopConHandlerUnitTestNoise< T >::setForTransfer().
{ if(typeid(T)==typeid(SiStripNoises)){ obj = new SiStripNoises(); edm::FileInPath fp_("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"); SiStripDetInfoFileReader reader(fp_.fullPath()); const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo > DetInfos = reader.getAllData(); int count=-1; for(std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it = DetInfos.begin(); it != DetInfos.end(); it++){ count++; //Generate Noise for det detid SiStripNoises::InputVector theSiStripVector; for(int strip=0; strip<128*it->second.nApvs; ++strip){ float MeanNoise = 5; float RmsNoise = 1; float noise = CLHEP::RandGauss::shoot(MeanNoise,RmsNoise); //double badStripProb = .5; //bool disable = (CLHEP::RandFlat::shoot(1.) < badStripProb ? true:false); obj->setData(noise,theSiStripVector); if (count<6) edm::LogInfo("SiStripNoisesBuilder") << "detid " << it->first << " \t" << " strip " << strip << " \t" << noise << " \t" << theSiStripVector.back()/10 << " \t" << std::endl; } if ( ! obj->put(it->first,theSiStripVector) ) edm::LogError("SiStripNoisesBuilder")<<"[SiStripNoisesBuilder::analyze] detid already exists"<<std::endl; } } }
DataType popcon::SiStripPopConHandlerUnitTestNoise< T >::getDataType | ( | ) | [inline, private] |
Definition at line 100 of file SiStripPopConHandlerUnitTestNoise.h.
References popcon::SiStripPopConHandlerUnitTestNoise< T >::_Cabling, popcon::SiStripPopConHandlerUnitTestNoise< T >::m_name, mergeVDriftHistosByStation::name, and popcon::SiStripPopConHandlerUnitTestNoise< T >::UNDEFINED.
{ if(typeid(T)==typeid(SiStripFedCabling)){ edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[getDataType] for PopCon application " << m_name << " " << typeid(T).name(); return _Cabling; } return UNDEFINED; }
void popcon::SiStripPopConHandlerUnitTestNoise< T >::getNewObjects | ( | ) | [inline, virtual] |
Implements popcon::PopConSourceHandler< T >.
Definition at line 54 of file SiStripPopConHandlerUnitTestNoise.h.
References cond::LogDBEntry::destinationDB, cond::LogDBEntry::execmessage, cond::LogDBEntry::exectime, cond::LogDBEntry::iovtag, cond::LogDBEntry::iovtimetype, popcon::SiStripPopConHandlerUnitTestNoise< T >::isTransferNeeded(), cond::TagInfo::lastInterval, cond::TagInfo::lastPayloadToken, popcon::PopConSourceHandler< T >::logDBEntry(), cond::LogDBEntry::logId, popcon::SiStripPopConHandlerUnitTestNoise< T >::m_debugMode, popcon::SiStripPopConHandlerUnitTestNoise< T >::m_name, cond::TagInfo::name, cond::LogDBEntry::payloadClass, cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadToken, cond::LogDBEntry::provenance, popcon::SiStripPopConHandlerUnitTestNoise< T >::setForTransfer(), findQualityFiles::size, cond::TagInfo::size, popcon::PopConSourceHandler< T >::tagInfo(), cond::TagInfo::token, cond::LogDBEntry::usertext, and popcon::PopConSourceHandler< T >::userTextLog().
{ edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[getNewObjects] for PopCon application " << m_name; if (m_debugMode){ std::stringstream ss; ss << "\n\n------- " << m_name << " - > getNewObjects\n"; if (this->tagInfo().size){ //check whats already inside of database ss << "got offlineInfo"<< this->tagInfo().name << ", size " << this->tagInfo().size << " " << this->tagInfo().token << " , last object valid since " << this->tagInfo().lastInterval.first << " token " << this->tagInfo().lastPayloadToken << "\n\n UserText " << this->userTextLog() << "\n LogDBEntry \n" << this->logDBEntry().logId<< "\n" << this->logDBEntry().destinationDB<< "\n" << this->logDBEntry().provenance<< "\n" << this->logDBEntry().usertext<< "\n" << this->logDBEntry().iovtag<< "\n" << this->logDBEntry().iovtimetype<< "\n" << this->logDBEntry().payloadIdx<< "\n" << this->logDBEntry().payloadClass<< "\n" << this->logDBEntry().payloadToken<< "\n" << this->logDBEntry().exectime<< "\n" << this->logDBEntry().execmessage<< "\n" << "\n\n-- user text " << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@")) ; } else { ss << " First object for this tag "; } edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << ss.str(); } if (isTransferNeeded()) setForTransfer(); edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[getNewObjects] for PopCon application " << m_name << " Done\n--------------\n"; }
std::string popcon::SiStripPopConHandlerUnitTestNoise< T >::id | ( | void | ) | const [inline, virtual] |
Implements popcon::PopConSourceHandler< T >.
Definition at line 95 of file SiStripPopConHandlerUnitTestNoise.h.
References popcon::SiStripPopConHandlerUnitTestNoise< T >::m_name.
{ return m_name;}
bool popcon::SiStripPopConHandlerUnitTestNoise< T >::isTransferNeeded | ( | ) | [inline, private] |
Definition at line 113 of file SiStripPopConHandlerUnitTestNoise.h.
References cond::LogDBEntry::destinationDB, cond::TagInfo::lastInterval, popcon::PopConSourceHandler< T >::logDBEntry(), popcon::PopConSourceHandler< T >::m_userTextLog, cond::LogDBEntry::payloadClass, findQualityFiles::size, popcon::PopConSourceHandler< T >::tagInfo(), and cond::LogDBEntry::usertext.
Referenced by popcon::SiStripPopConHandlerUnitTestNoise< T >::getNewObjects().
{ edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[isTransferNeeded] checking for transfer" << std::endl; std::stringstream ss_logdb, ss; std::stringstream ss1; //get log information from previous upload if (this->tagInfo().size) ss_logdb << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@")); else ss_logdb << ""; ss << "@ " << clock() ; if (!strcmp(ss.str().c_str(),ss_logdb.str().c_str())){ //string are equal, no need to do transfer edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[isTransferNeeded] the selected conditions are already uploaded in the last iov (" << this->tagInfo().lastInterval.first << ") open for the object " << this->logDBEntry().payloadClass << " in the db " << this->logDBEntry().destinationDB << " parameters: " << ss.str() << "\n NO TRANSFER NEEDED"; return false; } this->m_userTextLog = ss.str(); edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[isTransferNeeded] the selected conditions will be uploaded: " << ss.str() << "\n A- "<< ss.str() << "\n B- " << ss_logdb.str() << "\n Fine"; return true; }
void popcon::SiStripPopConHandlerUnitTestNoise< T >::setForTransfer | ( | ) | [inline, private] |
Definition at line 148 of file SiStripPopConHandlerUnitTestNoise.h.
References popcon::SiStripPopConHandlerUnitTestNoise< T >::fillObject(), cond::TagInfo::lastInterval, popcon::SiStripPopConHandlerUnitTestNoise< T >::m_debugMode, popcon::SiStripPopConHandlerUnitTestNoise< T >::m_name, popcon::SiStripPopConHandlerUnitTestNoise< T >::m_since, popcon::PopConSourceHandler< T >::m_to_transfer, mergeVDriftHistosByStation::name, VarParsing::obj, findQualityFiles::size, and popcon::PopConSourceHandler< T >::tagInfo().
Referenced by popcon::SiStripPopConHandlerUnitTestNoise< T >::getNewObjects().
{ edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[setForTransfer] " << m_name << " getting data to be transferred " << std::endl; T *obj=0; fillObject(obj); if(!this->tagInfo().size) m_since=1; else if (m_debugMode) m_since=this->tagInfo().lastInterval.first+1; if (obj!=0){ edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") <<"setting since = "<< m_since <<std::endl; this->m_to_transfer.push_back(std::make_pair(obj,m_since)); }else{ edm::LogError ("SiStripPopPopConConfigDbObjHandler") <<"[setForTransfer] " << m_name << " : NULL pointer of obj " << typeid(T).name() << " reported by SiStripCondObjBuilderFromDb\n Transfer aborted"<<std::endl; } }
edm::Service<SiStripCondObjBuilderFromDb> popcon::SiStripPopConHandlerUnitTestNoise< T >::condObjBuilder [private] |
Definition at line 175 of file SiStripPopConHandlerUnitTestNoise.h.
bool popcon::SiStripPopConHandlerUnitTestNoise< T >::m_debugMode [private] |
Definition at line 174 of file SiStripPopConHandlerUnitTestNoise.h.
Referenced by popcon::SiStripPopConHandlerUnitTestNoise< T >::getNewObjects(), and popcon::SiStripPopConHandlerUnitTestNoise< T >::setForTransfer().
std::string popcon::SiStripPopConHandlerUnitTestNoise< T >::m_name [private] |
Definition at line 172 of file SiStripPopConHandlerUnitTestNoise.h.
Referenced by popcon::SiStripPopConHandlerUnitTestNoise< T >::getDataType(), popcon::SiStripPopConHandlerUnitTestNoise< T >::getNewObjects(), popcon::SiStripPopConHandlerUnitTestNoise< T >::id(), and popcon::SiStripPopConHandlerUnitTestNoise< T >::setForTransfer().
unsigned long long popcon::SiStripPopConHandlerUnitTestNoise< T >::m_since [private] |
Definition at line 173 of file SiStripPopConHandlerUnitTestNoise.h.
Referenced by popcon::SiStripPopConHandlerUnitTestNoise< T >::setForTransfer().