WriteRawData Class Reference

#include <WriteRawData.h>

List of all members.

Public Member Functions

 WriteRawData (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Member Functions

StatusCode writeMdcDigiData ()
StatusCode writeEmcDigiData ()
StatusCode writeTofDigiData ()
StatusCode writeMucDigiData ()

Private Attributes

int m_count


Detailed Description

Definition at line 3 of file WriteRawData.h.


Constructor & Destructor Documentation

WriteRawData::WriteRawData ( const std::string name,
ISvcLocator *  pSvcLocator 
)


Member Function Documentation

StatusCode WriteRawData::execute (  ) 

Definition at line 42 of file WriteRawData.cxx.

References DigiEvent::clID(), calibUtil::ERROR, EventModel::Digi::Event, EventModel::EventHeader, Bes_Common::INFO, m_count, msgSvc(), Event::EventHeader::setEventNumber(), Event::EventHeader::setRunNumber(), writeEmcDigiData(), writeMdcDigiData(), writeMucDigiData(), and writeTofDigiData().

00043 {
00044     StatusCode sc;   
00045     MsgStream log( msgSvc(), name() );
00046 
00047     log << MSG::INFO << "================================================" << endreq;
00048     log << MSG::INFO << "In execute()" << endreq;
00049     log << MSG::INFO << "++++++++++++++++++++++++++++++++++++++++++++++++" << endreq;
00050  
00051     static int evtnum = 0;
00052     static int runnum = 999;
00053  
00054     // Create the Event header and set it as "root" of the event store
00055     Event::EventHeader* event = new Event::EventHeader;
00056     event->setEventNumber(evtnum++);
00057     event->setRunNumber(runnum);
00058  
00059     IDataManagerSvc* evtmgr = dynamic_cast<IDataManagerSvc*>(eventSvc());
00060     sc = evtmgr->setRoot(EventModel::EventHeader , event);
00061     if( sc.isFailure() ) {
00062        log << MSG::ERROR << "Unable to register /Event object" << endreq;
00063        return sc;
00064     }
00065     
00066     DigiEvent* digi = new DigiEvent;
00067     log << MSG::INFO << " DigiEvent clID :: " << digi->clID() << endreq;
00068     sc = eventSvc()->registerObject(EventModel::Digi::Event, digi);
00069     if( sc.isFailure() ) {
00070        log << MSG::ERROR << "Unable to register /Event/Digi object" << endreq;
00071        return sc;
00072     }
00073   
00074     sc = writeMdcDigiData();
00075     if( sc.isFailure() ) {
00076        log << MSG::ERROR << "Unable to register /Event/Digi/MdcDigiCol object" << endreq;
00077        return sc;
00078     }
00079 
00080     sc = writeEmcDigiData();
00081     if( sc.isFailure() ) {
00082        log << MSG::ERROR << "Unable to register /Event/Digi/EmcDigiCol object" << endreq;
00083        return sc;
00084     }
00085 
00086     sc = writeTofDigiData();
00087     if( sc.isFailure() ) {
00088        log << MSG::ERROR << "Unable to register /Event/Digi/EmcDigiCol object" << endreq;
00089        return sc;
00090     }
00091 
00092     sc = writeMucDigiData();
00093     if( sc.isFailure() ) {
00094        log << MSG::ERROR << "Unable to register /Event/Digi/EmcDigiCol object" << endreq;
00095        return sc;
00096     }
00097     
00098     m_count++;
00099 
00100    return StatusCode::SUCCESS;
00101 }

StatusCode WriteRawData::finalize (  ) 

Definition at line 178 of file WriteRawData.cxx.

References Bes_Common::INFO, and msgSvc().

00179 {
00180 
00181    MsgStream log(msgSvc(), name());
00182 
00183    log << MSG::INFO << "In finalize()" << endreq;
00184 
00185    return StatusCode::SUCCESS;
00186 }

StatusCode WriteRawData::initialize (  ) 

Definition at line 30 of file WriteRawData.cxx.

References Bes_Common::INFO, m_count, and msgSvc().

00031 {
00032 
00033    MsgStream log(msgSvc(), name());
00034    m_count = 0; 
00035 
00036    log << MSG::INFO << "in initialize()" << endreq;
00037 
00038    return StatusCode::SUCCESS;
00039 }

StatusCode WriteRawData::writeEmcDigiData (  )  [private]

Definition at line 122 of file WriteRawData.cxx.

References EventModel::Digi::EmcDigiCol, genRecEmupikp::i, and m_count.

Referenced by execute().

00123 {
00124     int n = 10;
00125     EmcDigiCol* emcCol = new EmcDigiCol;
00126     for (int i=0; i < n; i++) {
00127         // Create new EmcDigi
00128         EmcDigi* emcDigi = new EmcDigi(m_count);
00129         emcDigi->setTimeChannel(9);
00130         emcDigi->setChargeChannel(9);
00131         emcDigi->setMeasure(0);
00132         // And add the stuff to the container
00133         emcCol->push_back ( emcDigi );
00134     }
00135  
00136     StatusCode sc = StatusCode::SUCCESS;
00137     sc = eventSvc()->registerObject(EventModel::Digi::EmcDigiCol, emcCol);
00138     return sc;
00139 }

StatusCode WriteRawData::writeMdcDigiData (  )  [private]

Definition at line 103 of file WriteRawData.cxx.

References genRecEmupikp::i, m_count, and EventModel::Digi::MdcDigiCol.

Referenced by execute().

00104 {
00105     int n = 10;
00106     MdcDigiCol* mdcCol = new MdcDigiCol;
00107     for (int i=0; i < n; i++) {
00108         // Create new MdcDigi
00109         MdcDigi* mdcDigi = new MdcDigi(m_count);
00110         mdcDigi->setTimeChannel(8);
00111         mdcDigi->setChargeChannel(10);
00112         mdcDigi->setOverflow(0);
00113         // And add the stuff to the container
00114         mdcCol->push_back ( mdcDigi );
00115     }
00116  
00117     StatusCode sc = StatusCode::SUCCESS;
00118     sc = eventSvc()->registerObject(EventModel::Digi::MdcDigiCol, mdcCol);
00119     return sc;
00120 } 

StatusCode WriteRawData::writeMucDigiData (  )  [private]

Definition at line 160 of file WriteRawData.cxx.

References genRecEmupikp::i, m_count, and EventModel::Digi::MucDigiCol.

Referenced by execute().

00161 {
00162     int n = 10;
00163     MucDigiCol* mucCol = new MucDigiCol;
00164     for (int i=0; i < n; i++) {
00165         // Create new MucDigi
00166         MucDigi* mucDigi = new MucDigi(m_count);
00167         // And add the stuff to the container
00168         mucCol->push_back ( mucDigi );
00169     }
00170  
00171     StatusCode sc = StatusCode::SUCCESS; 
00172     sc = eventSvc()->registerObject(EventModel::Digi::MucDigiCol, mucCol);
00173 
00174     return sc;
00175 }

StatusCode WriteRawData::writeTofDigiData (  )  [private]

Definition at line 141 of file WriteRawData.cxx.

References genRecEmupikp::i, m_count, and EventModel::Digi::TofDigiCol.

Referenced by execute().

00142 {
00143     int n = 10;
00144     TofDigiCol* tofCol = new TofDigiCol;
00145     for (int i=0; i < n; i++) {
00146         // Create new TofDigi
00147         TofDigi* tofDigi = new TofDigi(m_count);
00148         tofDigi->setTimeChannel(10);
00149         tofDigi->setChargeChannel(8);
00150         tofDigi->setOverflow(0);
00151         // And add the stuff to the container
00152         tofCol->push_back ( tofDigi );
00153     }
00154  
00155     StatusCode sc = StatusCode::SUCCESS; 
00156     sc = eventSvc()->registerObject(EventModel::Digi::TofDigiCol, tofCol);
00157     return sc;
00158 }


Member Data Documentation

int WriteRawData::m_count [private]

Definition at line 17 of file WriteRawData.h.

Referenced by execute(), initialize(), writeEmcDigiData(), writeMdcDigiData(), writeMucDigiData(), and writeTofDigiData().


Generated on Tue Nov 29 23:36:21 2016 for BOSS_7.0.2 by  doxygen 1.4.7