CMS 3D CMS Logo

SiStripRunSummaryWrite Class Reference

#include <CalibTracker/SiStripRunSummary/interface/SiStripRunSummaryWrite.h>

Inheritance diagram for SiStripRunSummaryWrite:

ConditionDBWriter< SiStripRunSummary > edm::EDAnalyzer

List of all members.

Public Member Functions

 SiStripRunSummaryWrite (const edm::ParameterSet &roCONFIG)
virtual ~SiStripRunSummaryWrite ()

Protected Member Functions

void algoEndJob ()

Private Member Functions

virtual SiStripRunSummarygetNewObject ()
SiStripRunSummaryWriteoperator= (const SiStripRunSummaryWrite &)
 SiStripRunSummaryWrite (const SiStripRunSummaryWrite &)

Private Attributes

std::string oFileXMLIn_
std::string oFlagTreeTxt_


Detailed Description

Definition at line 17 of file SiStripRunSummaryWrite.h.


Constructor & Destructor Documentation

SiStripRunSummaryWrite::SiStripRunSummaryWrite ( const edm::ParameterSet roCONFIG  ) 

Definition at line 17 of file SiStripRunSummaryWrite.cc.

References Exception, and oFileXMLIn_.

00019   : ConditionDBWriter<SiStripRunSummary>( roCONFIG),
00020     oFileXMLIn_( roCONFIG.getUntrackedParameter<std::string>( 
00021       "oFileXMLIn",
00022       "") ),
00023     oFlagTreeTxt_( "") 
00024 {
00025 
00026   if( oFileXMLIn_.empty()) {
00027     throw cms::Exception( "Wrong Input parameters", 
00028                           "Input XML File is not specified: can not proceed.");
00029   }
00030 
00031   // [ToDo: Add file check for existance]
00032 }

virtual SiStripRunSummaryWrite::~SiStripRunSummaryWrite (  )  [inline, virtual]

Definition at line 20 of file SiStripRunSummaryWrite.h.

00020 {}

SiStripRunSummaryWrite::SiStripRunSummaryWrite ( const SiStripRunSummaryWrite  )  [private]


Member Function Documentation

void SiStripRunSummaryWrite::algoEndJob (  )  [protected, virtual]

Reimplemented from ConditionDBWriter< SiStripRunSummary >.

Definition at line 34 of file SiStripRunSummaryWrite.cc.

References Exception, oFileXMLIn_, oFlagTreeTxt_, and SerializeBase::write().

00034                                         {
00035   std::ifstream oFileIn( oFileXMLIn_.c_str());
00036 
00037   // Read Run Summary Flags XML file
00038   SerializeXML oSerializeXML;
00039   if( GlobalFlagXML *poFlagXML = oSerializeXML.read<GlobalFlagXML>( oFileIn)) {
00040     // Convert XML to Txt Tree
00041     GlobalFlagTxt oGlobalFlagTxt( poFlagXML);
00042 
00043     // Get Txt Tree state string
00044     std::ostringstream oOut;
00045 
00046     SerializeTxt oSerializeTxt;
00047     if( !oSerializeTxt.write( oOut, oGlobalFlagTxt)) {
00048       // Failed to serialize tree
00049       throw cms::Exception( "Run Summary Flags", 
00050                             "Failed to serialize Run Summary Flags Tree in \
00051 string");
00052     }
00053 
00054     oFlagTreeTxt_ = oOut.str();
00055   } else {
00056     // Failed to read Flags Tree from file
00057     throw cms::Exception( "Run Summary Flags", 
00058                           "Failed to read Run Summary Flags Tree from XML \
00059 File");
00060   }
00061 }

SiStripRunSummary * SiStripRunSummaryWrite::getNewObject (  )  [private, virtual]

Implements ConditionDBWriter< SiStripRunSummary >.

Definition at line 63 of file SiStripRunSummaryWrite.cc.

References oFlagTreeTxt_, and SiStripRunSummary::put().

00063                                                         {
00064   SiStripRunSummary *poRunSummary = new SiStripRunSummary;
00065   poRunSummary->put( oFlagTreeTxt_);
00066 
00067   return poRunSummary;
00068 }

SiStripRunSummaryWrite& SiStripRunSummaryWrite::operator= ( const SiStripRunSummaryWrite  )  [private]


Member Data Documentation

std::string SiStripRunSummaryWrite::oFileXMLIn_ [private]

Definition at line 33 of file SiStripRunSummaryWrite.h.

Referenced by algoEndJob(), and SiStripRunSummaryWrite().

std::string SiStripRunSummaryWrite::oFlagTreeTxt_ [private]

Definition at line 34 of file SiStripRunSummaryWrite.h.

Referenced by algoEndJob(), and getNewObject().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:34 2009 for CMSSW by  doxygen 1.5.4