VeeVertex Class Reference

#include <VeeVertex.h>

List of all members.

Public Member Functions

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

Private Member Functions

StatusCode registerParent (MsgStream &log)
StatusCode clearEvtRecVeeVertexCol (MsgStream &log)
void registerEvtRecVeeVertexCol (MsgStream &log)

Private Attributes

bool m_recKShort
bool m_recLambda
bool m_recGC
Algorithmm_KShortReconstruction
Algorithmm_LambdaReconstruction
Algorithmm_gcReconstruction


Detailed Description

Definition at line 8 of file VeeVertex.h.


Constructor & Destructor Documentation

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

Definition at line 15 of file VeeVertex.cxx.

References m_recGC, m_recKShort, and m_recLambda.

00015                                                                     :
00016   Algorithm(name, pSvcLocator) {
00017   //Declare the properties
00018   declareProperty("KShortReconstruction", m_recKShort = true);
00019   declareProperty("LambdaReconstruction", m_recLambda = true);
00020   declareProperty("GammaConversionReconstruction", m_recGC = true);
00021 }


Member Function Documentation

StatusCode VeeVertex::clearEvtRecVeeVertexCol ( MsgStream &  log  )  [private]

Definition at line 73 of file VeeVertex.cxx.

References registerParent().

Referenced by execute().

00073                                                             {
00074   StatusCode sc = registerParent(log);
00075   if (sc != StatusCode::SUCCESS) {
00076     return sc;
00077   }
00078   
00079   DataObject* aEvtRecVeeVertexCol;
00080   eventSvc()->findObject("/Event/EvtRec/EvtRecVeeVertexCol",aEvtRecVeeVertexCol);
00081   if (aEvtRecVeeVertexCol != NULL) {
00082     SmartIF<IDataManagerSvc> dataManSvc(eventSvc());
00083     dataManSvc->clearSubTree("/Event/EvtRec/EvtRecVeeVertexCol");
00084     eventSvc()->unregisterObject("/Event/EvtRec/EvtRecVeeVertexCol");
00085   } 
00086   return StatusCode::SUCCESS;
00087 }

StatusCode VeeVertex::execute (  ) 

Definition at line 99 of file VeeVertex.cxx.

References clearEvtRecVeeVertexCol(), deljobs::end, msgSvc(), and registerEvtRecVeeVertexCol().

00099                               {
00100   MsgStream log(msgSvc(), name());
00101 
00102   StatusCode sc = clearEvtRecVeeVertexCol(log);
00103   if (sc != StatusCode::SUCCESS) {
00104     return sc;
00105   }
00106   
00107   std::vector<Algorithm*>::const_iterator it  = subAlgorithms()->begin();
00108   std::vector<Algorithm*>::const_iterator end = subAlgorithms()->end();
00109   for(; it != end; it++) {
00110     sc = (*it)->execute();
00111     if(sc.isFailure()) {
00112       log << "Error executing selection "  << (*it)->name() << endreq;
00113     }
00114   }
00115 
00116   DataObject* aEvtRecVeeVertexCol;
00117   eventSvc()->findObject("/Event/EvtRec/EvtRecVeeVertexCol", aEvtRecVeeVertexCol);
00118   if (aEvtRecVeeVertexCol == NULL) {
00119     registerEvtRecVeeVertexCol(log);
00120   }
00121 
00122   return StatusCode::SUCCESS;
00123 }

StatusCode VeeVertex::finalize (  ) 

Definition at line 126 of file VeeVertex.cxx.

References Bes_Common::INFO, and msgSvc().

00126                                {
00127 
00128   MsgStream log(msgSvc(), name());
00129   log << MSG::INFO << "in finalize()" << endmsg;
00130   return StatusCode::SUCCESS;
00131 }

StatusCode VeeVertex::initialize (  ) 

Definition at line 24 of file VeeVertex.cxx.

References calibUtil::ERROR, Bes_Common::INFO, m_gcReconstruction, m_KShortReconstruction, m_LambdaReconstruction, m_recGC, m_recKShort, m_recLambda, and msgSvc().

00024                                  {
00025 
00026   MsgStream log(msgSvc(), name());
00027   
00028   log << MSG::INFO << "creating VeeVertex sub Algorithm" << endreq;
00029 
00030   StatusCode sc;
00031   
00032   if(m_recKShort) { 
00033     sc = createSubAlgorithm("KShortReconstruction", "KShortReconstruction", m_KShortReconstruction);
00034     if(sc.isFailure()) {
00035       log << MSG::ERROR << "Error while creating KShortReconstruction" << endreq;
00036       return StatusCode::FAILURE;
00037     }
00038   }
00039   if(m_recLambda) { 
00040     sc = createSubAlgorithm("LambdaReconstruction", "LambdaReconstruction", m_LambdaReconstruction);
00041     if(sc.isFailure()) {
00042       log << MSG::ERROR << "Error while creating LambdaReconstruction" << endreq;
00043       return StatusCode::FAILURE;
00044     }
00045   }
00046   if(m_recGC) { 
00047     sc = createSubAlgorithm("GammaConversionReconstruction", "GammaConversionReconstruction", m_gcReconstruction);
00048     if(sc.isFailure()) {
00049       log << MSG::ERROR << "Error while creating GammaConversionReconstruction" << endreq;
00050       return StatusCode::FAILURE;
00051     }
00052   }
00053 
00054   log << MSG::INFO << "successfully return from initialize()" <<endmsg;
00055   return StatusCode::SUCCESS;
00056 
00057 }

void VeeVertex::registerEvtRecVeeVertexCol ( MsgStream &  log  )  [private]

Definition at line 89 of file VeeVertex.cxx.

References EventModel::EvtRec::EvtRecVeeVertexCol, and Bes_Common::FATAL.

Referenced by execute().

00089                                                          {
00090   EvtRecVeeVertexCol* aNewEvtRecVeeVertexCol = new EvtRecVeeVertexCol;
00091   StatusCode sc = eventSvc()->registerObject("/Event/EvtRec/EvtRecVeeVertexCol",
00092                                              aNewEvtRecVeeVertexCol);
00093   if (sc != StatusCode::SUCCESS) {
00094     log << MSG::FATAL << "Could not register EvtRecVeeVertexCol in TDS!" << endreq;
00095   }
00096 }

StatusCode VeeVertex::registerParent ( MsgStream &  log  )  [private]

Definition at line 59 of file VeeVertex.cxx.

References EventModel::EvtRec::EvtRecEvent, and Bes_Common::FATAL.

Referenced by clearEvtRecVeeVertexCol().

00059                                                    {
00060   DataObject *aEvtRecEvent;
00061   eventSvc()->findObject("/Event/EvtRec",aEvtRecEvent);
00062   if (aEvtRecEvent == NULL) {
00063     aEvtRecEvent = new EvtRecEvent();
00064     StatusCode sc = eventSvc()->registerObject("/Event/EvtRec",aEvtRecEvent);
00065     if (sc != StatusCode::SUCCESS) {
00066       log << MSG::FATAL << "Could not register EvtRecEvent" <<endreq;
00067       return StatusCode::FAILURE;
00068     }
00069   }
00070   return StatusCode::SUCCESS;
00071 }


Member Data Documentation

Algorithm* VeeVertex::m_gcReconstruction [private]

Definition at line 27 of file VeeVertex.h.

Referenced by initialize().

Algorithm* VeeVertex::m_KShortReconstruction [private]

Definition at line 25 of file VeeVertex.h.

Referenced by initialize().

Algorithm* VeeVertex::m_LambdaReconstruction [private]

Definition at line 26 of file VeeVertex.h.

Referenced by initialize().

bool VeeVertex::m_recGC [private]

Definition at line 24 of file VeeVertex.h.

Referenced by initialize(), and VeeVertex().

bool VeeVertex::m_recKShort [private]

Definition at line 22 of file VeeVertex.h.

Referenced by initialize(), and VeeVertex().

bool VeeVertex::m_recLambda [private]

Definition at line 23 of file VeeVertex.h.

Referenced by initialize(), and VeeVertex().


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