/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
CalibFeeWriter Class Reference

#include <CalibFeeWriter.h>

Inheritance diagram for CalibFeeWriter:
Inheritance graph
[legend]
Collaboration diagram for CalibFeeWriter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CalibFeeWriter (const string &type, const string &name, const IInterface *parent)
virtual ~CalibFeeWriter ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
int setRunNo (int)
int setFileName (string)
int setTimeWindow (int)
int run ()
virtual void setSubsite (int subSite)
virtual void setIsSim (bool isSim)
virtual void setSiteMask (int siteMask)

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

int mainProcess ()

Protected Attributes

int runNumber
int timeWindow
string inputFileName
ContextRange range
Int_t aggNo
Dbi::SubSite subsite
Dbi::Task task
TimeStamp startTime
TimeStamp endTime
bool isSim
int siteMask

Private Member Functions

virtual int init ()
virtual int final ()
int fillRow ()

Private Attributes

DbiWriter< GCalibFeeSpec > * myWriter

Detailed Description

Definition at line 23 of file CalibFeeWriter.h.


Constructor & Destructor Documentation

CalibFeeWriter::CalibFeeWriter ( const string &  type,
const string &  name,
const IInterface *  parent 
)

Definition at line 22 of file CalibFeeWriter.cc.

              :GaudiTool(type, name, parent)
{
    declareInterface< ICalibWriter >(this);
    //aggNo = -1;
    //subsite = 0;
    //task = 0;
   // m_daqRunInfoSvcName = "DaqRunInfoSvc";
}
CalibFeeWriter::~CalibFeeWriter ( ) [virtual]

Definition at line 34 of file CalibFeeWriter.cc.

                               {
//    delete myWriter;
}

Member Function Documentation

StatusCode CalibFeeWriter::initialize ( ) [virtual]

Definition at line 38 of file CalibFeeWriter.cc.

                                     {
  cout<<"CalibFeeWriter initialzing--------------"<<endl;
  info()<< "initialize()"<< endreq;
  StatusCode sc = this->GaudiTool::initialize();
  if(sc != StatusCode::SUCCESS) return sc;

  //Get the DaqRunInfo Service
 // m_daqRunInfoSvc = svc<IDaqRunInfoSvc>("DaqRunInfoSvc", true);
 // if(!m_daqRunInfoSvc)
 // {
 //   error()<< "No DaqRunInfoSvc available."<< endreq;
 //   return StatusCode::FAILURE;
 // } 
  return StatusCode::SUCCESS;
}
StatusCode CalibFeeWriter::finalize ( ) [virtual]

Definition at line 54 of file CalibFeeWriter.cc.

                                   {
    cout<<"CalibFeeWriter finalizing--------------"<<endl;
    StatusCode sc = this->GaudiTool::finalize();
    if(sc != StatusCode::SUCCESS) return sc;
    return StatusCode::SUCCESS;
}
int CalibFeeWriter::setRunNo ( int  runNo) [virtual]

Reimplemented from ICalibWriter.

Definition at line 61 of file CalibFeeWriter.cc.

                                     { 
    runNumber = runNo;
    return 1;
} 
int CalibFeeWriter::setFileName ( string  fileName) [virtual]

Reimplemented from ICalibWriter.

Definition at line 66 of file CalibFeeWriter.cc.

                                              {
    inputFileName = fileName; 
    return 1;
} 
int CalibFeeWriter::setTimeWindow ( int  time) [virtual]

Reimplemented from ICalibWriter.

Definition at line 71 of file CalibFeeWriter.cc.

                                         {
    timeWindow = time; 
    return 1;
}
int CalibFeeWriter::run ( ) [virtual]

Reimplemented from ICalibWriter.

Definition at line 113 of file CalibFeeWriter.cc.

{
    mainProcess();
}
void CalibFeeWriter::setSubsite ( int  subSite) [virtual]

Reimplemented from CalibWriter.

Definition at line 76 of file CalibFeeWriter.cc.

{
    this->subsite = subSite;
}
void CalibFeeWriter::setIsSim ( bool  isSim) [virtual]

Reimplemented from CalibWriter.

Definition at line 81 of file CalibFeeWriter.cc.

{
    this->isSim = isSim;
}
virtual void CalibFeeWriter::setSiteMask ( int  siteMask) [inline, virtual]

Reimplemented from ICalibWriter.

Definition at line 39 of file CalibFeeWriter.h.

{}
int CalibFeeWriter::init ( ) [private, virtual]

Reimplemented from CalibWriter.

Definition at line 91 of file CalibFeeWriter.cc.

{

#ifdef I_LIKE_DUPLICITY
   myWriter = new DbiWriter<CalibFeeSpec>(range,aggNo,subsite,task);
#else
   TimeStamp versionDate(0,0) ;
   UInt_t dbNo(0) ;
   const std::string logComment = "" ;
   const std::string tableName = "CalibFeeSpec" ;
   myWriter = new DbiWriter<GCalibFeeSpec>(range,aggNo,subsite,task, versionDate, dbNo, logComment, tableName );
#endif
   return 1;
}
int CalibFeeWriter::final ( ) [private, virtual]

Reimplemented from CalibWriter.

Definition at line 106 of file CalibFeeWriter.cc.

{     
    cout<<"close DB"<<endl;
    myWriter->Close();
    return 1;
}
int CalibFeeWriter::fillRow ( ) [private, virtual]

Reimplemented from CalibWriter.

Definition at line 118 of file CalibFeeWriter.cc.

                           { 
#ifdef I_LIKE_DUPLICITY
    CalibFeeSpec row;
#else
#endif
    ifstream input;
    input.open(inputFileName.c_str());
    if(!input){
      cout<<"can not open file : "<<inputFileName<<endl;
    }else{
      int channalId = 0;
      string channalIdDescribe;
      int status = 0;
      double pedestalHigh = 0;
      double sigmaPedestalHigh = 0;
      double pedestalLow = 0;
      double sigmapedestalLow = 0;
      double threshordHigh = 0;
      double threshordLow = 0;
      double fitChi2 = 0;
      double uselessData = 0;
      double ndf = 0;
      char buffer[500];
      input.getline(buffer, sizeof(buffer));
      input.getline(buffer, sizeof(buffer));
      while(input.peek()!=EOF)
      {
        input.getline(buffer, sizeof(buffer));
        istringstream(buffer)>>channalId
            >>channalIdDescribe
            //>>status
            //>>pedestalHigh
            //>>sigmaPedestalHigh
            >>pedestalLow
            >>uselessData
            >>sigmapedestalLow
            >>uselessData 
            //>>threshordHigh
            //>>threshordLow
            >>fitChi2
            >>ndf;
        cout<<channalId<<"   "
           <<channalIdDescribe<<"   "
           <<status<<"   "
           <<pedestalHigh<<"   "
           <<sigmaPedestalHigh<<"   "
           <<pedestalLow<<"   "
           <<sigmapedestalLow<<"   "
           <<threshordHigh<<"   "
           <<threshordLow<<endl;


#ifdef I_LIKE_DUPLICITY
         row.SetCalibFeeSpec(
#else
         GCalibFeeSpec row(
#endif
                               channalId,
                               status,
                               pedestalHigh,
                               sigmaPedestalHigh,                               
                               pedestalLow,
                               sigmapedestalLow,
                               threshordHigh,
                               threshordLow);


         *myWriter << row;
        // writeToDB();
      }
    }
    return 1;
} 
static const InterfaceID& ICalibWriter::interfaceID ( ) [inline, static, inherited]

Definition at line 24 of file ICalibWriter.h.

{ return IID_ICalibWriter; }
int CalibWriter::mainProcess ( ) [protected, inherited]

Definition at line 88 of file CalibWriter.cc.

{ 
   cout<<"CalibWriter runing--------------"<<endl;
   if( 0 == setContextRange() ) 
   {
     cout<<"can not set ContextRange"<<endl;
     return 0;
   }
   if( 0 == init() ) 
   {
     cout<<"can not initial"<<endl;
      return 0;
   }
   if( 0 == fillRow() )
   {
     cout<<"can not fill row"<<endl;
    return 0;
   }
   if( 0 == final() )
   {
     cout<<"can not finalize"<<endl;
     return 0;
   }
   return 1;

}

Member Data Documentation

DbiWriter<GCalibFeeSpec>* CalibFeeWriter::myWriter [private]

Definition at line 57 of file CalibFeeWriter.h.

int CalibWriter::runNumber [protected, inherited]

Definition at line 32 of file CalibWriter.h.

int CalibWriter::timeWindow [protected, inherited]

Definition at line 33 of file CalibWriter.h.

string CalibWriter::inputFileName [protected, inherited]

Definition at line 34 of file CalibWriter.h.

ContextRange CalibWriter::range [protected, inherited]

Definition at line 35 of file CalibWriter.h.

Int_t CalibWriter::aggNo [protected, inherited]

Definition at line 36 of file CalibWriter.h.

Dbi::SubSite CalibWriter::subsite [protected, inherited]

Definition at line 37 of file CalibWriter.h.

Dbi::Task CalibWriter::task [protected, inherited]

Definition at line 38 of file CalibWriter.h.

TimeStamp CalibWriter::startTime [protected, inherited]

Definition at line 39 of file CalibWriter.h.

TimeStamp CalibWriter::endTime [protected, inherited]

Definition at line 40 of file CalibWriter.h.

bool CalibWriter::isSim [protected, inherited]

Definition at line 41 of file CalibWriter.h.

int CalibWriter::siteMask [protected, inherited]

Definition at line 42 of file CalibWriter.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:02:34 for DBWriter by doxygen 1.7.4