CMS 3D CMS Logo

Public Member Functions | Private Attributes

popcon::DQMXMLFileSourceHandler Class Reference

#include <DQMXMLFileSourceHandler.h>

Inheritance diagram for popcon::DQMXMLFileSourceHandler:
popcon::PopConSourceHandler< FileBlob >

List of all members.

Public Member Functions

 DQMXMLFileSourceHandler (const edm::ParameterSet &pset)
void getNewObjects ()
std::string id () const
 ~DQMXMLFileSourceHandler ()

Private Attributes

bool m_debugMode
std::string m_file
std::string m_name
unsigned long long m_since
bool m_zip

Detailed Description

Definition at line 11 of file DQMXMLFileSourceHandler.h.


Constructor & Destructor Documentation

popcon::DQMXMLFileSourceHandler::DQMXMLFileSourceHandler ( const edm::ParameterSet pset)

Definition at line 10 of file DQMXMLFileSourceHandler.cc.

                                                                              :
    m_name(pset.getUntrackedParameter<std::string>("name","DQMXMLFileSourceHandler")),
    m_file(pset.getUntrackedParameter<std::string>("XMLFile","./file.xml")),
    m_zip(pset.getUntrackedParameter<bool>("zip",false)),
    m_since(pset.getUntrackedParameter<unsigned long long>("firstSince",1)),
    m_debugMode(pset.getUntrackedParameter<bool>("debug",false)) {
  }
popcon::DQMXMLFileSourceHandler::~DQMXMLFileSourceHandler ( )

Definition at line 18 of file DQMXMLFileSourceHandler.cc.

{}

Member Function Documentation

void popcon::DQMXMLFileSourceHandler::getNewObjects ( ) [virtual]

Implements popcon::PopConSourceHandler< FileBlob >.

Definition at line 20 of file DQMXMLFileSourceHandler.cc.

References cond::LogDBEntry::destinationDB, cond::LogDBEntry::execmessage, cond::LogDBEntry::exectime, cond::LogDBEntry::iovtag, cond::LogDBEntry::iovtimetype, cond::TagInfo::lastInterval, popcon::PopConSourceHandler< FileBlob >::lastPayload(), cond::TagInfo::lastPayloadToken, popcon::PopConSourceHandler< FileBlob >::logDBEntry(), cond::LogDBEntry::logId, m_debugMode, m_file, m_name, m_since, popcon::PopConSourceHandler< FileBlob >::m_to_transfer, m_zip, cond::TagInfo::name, cond::LogDBEntry::payloadContainer, cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadName, cond::LogDBEntry::payloadToken, cond::LogDBEntry::provenance, findQualityFiles::size, cond::TagInfo::size, FileBlob::size(), popcon::PopConSourceHandler< FileBlob >::tagInfo(), cond::TagInfo::token, cond::LogDBEntry::usertext, and popcon::PopConSourceHandler< FileBlob >::userTextLog().

                                              {
    edm::LogInfo("DQMXMLFileSourceHandler") << "[DQMXMLFileSourceHandler::getNewObjects] for PopCon application " << m_name;
    if(m_debugMode){
        std::stringstream ss;
        ss << "\n------- " << m_name 
           << " - > getNewObjects\n";
        if (this->tagInfo().size > 0){
          //check what is already inside of the database
          ss << "\ngot offlineInfo "<< this->tagInfo().name 
             << ",\n size " << this->tagInfo().size 
             << ",\n" << this->tagInfo().token 
             << ",\n last object valid since " << this->tagInfo().lastInterval.first 
             << ",\n token " << this->tagInfo().lastPayloadToken 
             << ",\n UserText " << this->userTextLog()
             << ";\n last entry info regarding the payload (if existing):" 
             << ",\n logId"<<this->logDBEntry().logId 
             << ",\n last record with the correct tag (if existing) has been written in the db " << this->logDBEntry().destinationDB
             << ",\n provenance " << this->logDBEntry().provenance
             << ",\n usertext " << this->logDBEntry().usertext
             << ",\n iovtag " << this->logDBEntry().iovtag
             << ",\n timetype " << this->logDBEntry().iovtimetype
             << ",\n payload index " << this->logDBEntry().payloadIdx
             << ",\n payload name " << this->logDBEntry().payloadName 
             << ",\n payload token " << this->logDBEntry().payloadToken
             << ",\n payload container " << this->logDBEntry().payloadContainer 
             << ",\n execution time " << this->logDBEntry().exectime
             << ",\n execution message " << this->logDBEntry().execmessage
             << std::endl;
          Ref payload = this->lastPayload();
          ss << "size of last payload " << payload->size() << std::endl;
        } else {
          ss << " First object for this tag " << std::endl;
        }
        edm::LogInfo("DQMXMLFileSourceHandler") << ss.str();
    }
    edm::LogInfo("DQMXMLFileSourceHandler") << "runnumber/first since = " << m_since << std::endl;
    if(m_since<=this->tagInfo().lastInterval.first){
      edm::LogInfo("DQMXMLFileSourceHandler") 
        << "[DQMXMLFileSourceHandler::getNewObjects] \nthe current starting iov " << m_since
        << "\nis not compatible with the last iov ("  
        << this->tagInfo().lastInterval.first << ") open for the object " 
        << this->logDBEntry().payloadName << " \nin the db " 
        << this->logDBEntry().destinationDB << " \n NO TRANSFER NEEDED"
        << std::endl;
      return;
      }
    edm::LogInfo("DQMXMLFileSourceHandler") 
      << "[DQMXMLFileSourceHandler::getNewObjects] " << m_name << " getting data to be transferred "  << std::endl;
    FileBlob* XMLFile = new FileBlob(m_file,m_zip);
    /*if(!this->tagInfo().size)
      m_since=1;
    else
      if (m_debugMode)
      m_since=this->tagInfo().lastInterval.first+1; */
    if(XMLFile->size() != 0){
      edm::LogInfo("DQMXMLFileSourceHandler") << "setting runnumber/first since = " << m_since << std::endl;
      this->m_to_transfer.push_back(std::make_pair(XMLFile,m_since));
    } else {
      edm::LogError("DQMSummarySourceHandler") << "XML file " << m_file << " does not exist" << std::endl;
    }
    edm::LogInfo("DQMSummarySourceHandler") << "------- " 
                                            << m_name << " - > getNewObjects" 
                                            << std::endl;
  }
std::string popcon::DQMXMLFileSourceHandler::id ( void  ) const [virtual]

Implements popcon::PopConSourceHandler< FileBlob >.

Definition at line 85 of file DQMXMLFileSourceHandler.cc.

References m_name.

{return m_name;}

Member Data Documentation

Definition at line 23 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects().

Definition at line 19 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects().

Definition at line 18 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects(), and id().

unsigned long long popcon::DQMXMLFileSourceHandler::m_since [private]

Definition at line 22 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects().

Definition at line 20 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects().