Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DTag Class Reference

#include <DTag.h>

List of all members.

Public Member Functions

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

Private Member Functions

StatusCode clearEvtRecDTagCol (MsgStream &log)
StatusCode clearEvtRecDTagCol (MsgStream &log)
void registerEvtRecDTagCol (MsgStream &log)
void registerEvtRecDTagCol (MsgStream &log)
StatusCode registerParent (MsgStream &log)
StatusCode registerParent (MsgStream &log)

Private Attributes

Algorithm * m_ChargedDReconstruction
Algorithm * m_ChargedDReconstruction
Algorithm * m_DsReconstruction
Algorithm * m_DsReconstruction
Algorithm * m_NeutralDReconstruction
Algorithm * m_NeutralDReconstruction
bool m_rawdstonly
bool m_recD0
bool m_recDp
bool m_recDs


Constructor & Destructor Documentation

DTag::DTag const std::string &  name,
ISvcLocator *  pSvcLocator
 

00017                                                           :
00018   Algorithm(name, pSvcLocator) {
00019   //Declare the properties
00020   declareProperty("NeutralDReconstruction",  m_recD0 = true);
00021   declareProperty("ChargedDReconstruction",  m_recDp = true);
00022   declareProperty("DsReconstruction",        m_recDs = true);
00023   // declareProperty("RawDstOnly",              m_rawdstonly = true);
00024 }

DTag::DTag const std::string &  name,
ISvcLocator *  pSvcLocator
 


Member Function Documentation

StatusCode DTag::clearEvtRecDTagCol MsgStream &  log  )  [private]
 

StatusCode DTag::clearEvtRecDTagCol MsgStream &  log  )  [private]
 

00081                                                   {
00082   StatusCode sc = registerParent(log);
00083   if (sc != StatusCode::SUCCESS) {
00084     return sc;
00085   }
00086   
00087   DataObject* aEvtRecDTagCol;
00088   eventSvc()->findObject("/Event/EvtRec/EvtRecDTagCol",aEvtRecDTagCol);
00089   if (aEvtRecDTagCol != NULL) {
00090     IDataManagerSvc* dataManSvc = dynamic_cast<IDataManagerSvc*>(eventSvc());
00091     dataManSvc->clearSubTree("/Event/EvtRec/EvtRecDTagCol");
00092     eventSvc()->unregisterObject("/Event/EvtRec/EvtRecDTagCol");
00093   } 
00094   
00095   SmartDataPtr<EvtRecDTagCol> evtRecDTagCol(eventSvc(), EventModel::EvtRec::EvtRecDTagCol);
00096   if( evtRecDTagCol != NULL){
00097     IDataManagerSvc* dataManSvc = dynamic_cast<IDataManagerSvc*>(eventSvc());
00098     dataManSvc->clearSubTree("/Event/EvtRec/EvtRecDTagCol");
00099     eventSvc()->unregisterObject("/Event/EvtRec/EvtRecDTagCol");
00100   } 
00101   
00102   return StatusCode::SUCCESS;
00103 }

StatusCode DTag::execute  ) 
 

StatusCode DTag::execute  ) 
 

End of "evtRecDTagCol->size()>0" IF

End of "evtRecDTagCol != NULL" IF

00115                          {
00116   
00117   
00118   //check if DTagList exists
00119   //if true, will exit the program
00120   SmartDataPtr<EvtRecDTagCol> evtRecDTagCol(eventSvc(), EventModel::EvtRec::EvtRecDTagCol);
00121   if( evtRecDTagCol != NULL ){
00122     if ( evtRecDTagCol->size()>0 ) {
00123       cout << "************************************************"<<endl;
00124       cout << "EvtRecDTagCol already exists in this file!" << endl;
00125       cout << " Please run this program on a raw dst file!" << endl;
00126       cout << " *** This job is now being killed. ***" << endl;
00127       cout << "************************************************"<<endl;
00128       return StatusCode::FAILURE;
00129     }  
00130   }  
00131   
00132     
00133   MsgStream log(msgSvc(), name());
00134   StatusCode sc = clearEvtRecDTagCol(log);
00135   if (sc != StatusCode::SUCCESS) {
00136     return sc;
00137   }
00138 
00139   DataObject* aEvtRecDTagCol;
00140   eventSvc()->findObject("/Event/EvtRec/EvtRecDTagCol", aEvtRecDTagCol);
00141   if (aEvtRecDTagCol == NULL) {
00142     registerEvtRecDTagCol(log);
00143   }
00144   
00145   std::vector<Algorithm*>::const_iterator it  = subAlgorithms()->begin();
00146   std::vector<Algorithm*>::const_iterator end = subAlgorithms()->end();
00147   for(; it != end; it++) {
00148     sc = (*it)->execute();
00149     if(sc.isFailure()) {
00150       log << "Error executing selection "  << (*it)->name() << endreq;
00151     }
00152   }
00153 
00154 
00155   return StatusCode::SUCCESS;
00156 }

StatusCode DTag::finalize  ) 
 

StatusCode DTag::finalize  ) 
 

00159                           {
00160 
00161   MsgStream log(msgSvc(), name());
00162   log << MSG::INFO << "in finalize()" << endmsg;
00163   return StatusCode::SUCCESS;
00164 }

StatusCode DTag::initialize  ) 
 

StatusCode DTag::initialize  ) 
 

00027                             {
00028 
00029   MsgStream log(msgSvc(), name());
00030   
00031   log << MSG::INFO << "creating DTag sub Algorithm" << endreq;
00032 
00033   StatusCode sc;
00034 
00035 
00036 
00037 
00038   if(m_recD0) { 
00039     sc = createSubAlgorithm("NeutralDReconstruction", "NeutralDReconstruction", m_NeutralDReconstruction);
00040     if(sc.isFailure()) {
00041       log << MSG::ERROR << "Error while creating D0Reconstruction" << endreq;
00042       return StatusCode::FAILURE;
00043     }
00044   }
00045 
00046   if(m_recDp) { 
00047     sc = createSubAlgorithm("ChargedDReconstruction", "ChargedDReconstruction", m_ChargedDReconstruction);
00048     if(sc.isFailure()) {
00049       log << MSG::ERROR << "Error while creating D+Reconstruction" << endreq;
00050       return StatusCode::FAILURE;
00051     }
00052   }
00053 
00054   if(m_recDs) { 
00055     sc = createSubAlgorithm("DsReconstruction", "DsReconstruction", m_DsReconstruction);
00056     if(sc.isFailure()) {
00057       log << MSG::ERROR << "Error while creating DsReconstruction" << endreq;
00058       return StatusCode::FAILURE;
00059     }
00060   }
00061 
00062   log << MSG::INFO << "successfully return from initialize()" <<endmsg;
00063   return StatusCode::SUCCESS;
00064 
00065 }

void DTag::registerEvtRecDTagCol MsgStream &  log  )  [private]
 

void DTag::registerEvtRecDTagCol MsgStream &  log  )  [private]
 

00105                                                {
00106   EvtRecDTagCol* aNewEvtRecDTagCol = new EvtRecDTagCol;
00107   StatusCode sc = eventSvc()->registerObject("/Event/EvtRec/EvtRecDTagCol",
00108                                              aNewEvtRecDTagCol);
00109   if (sc != StatusCode::SUCCESS) {
00110     log << MSG::FATAL << "Could not register EvtRecDTagCol in TDS!" << endreq;
00111   }
00112 }

StatusCode DTag::registerParent MsgStream &  log  )  [private]
 

StatusCode DTag::registerParent MsgStream &  log  )  [private]
 

00067                                               {
00068   DataObject *aEvtRecEvent;
00069   eventSvc()->findObject("/Event/EvtRec",aEvtRecEvent);
00070   if (aEvtRecEvent == NULL) {
00071     aEvtRecEvent = new EvtRecEvent();
00072     StatusCode sc = eventSvc()->registerObject("/Event/EvtRec",aEvtRecEvent);
00073     if (sc != StatusCode::SUCCESS) {
00074       log << MSG::FATAL << "Could not register EvtRecEvent" <<endreq;
00075       return StatusCode::FAILURE;
00076     }
00077   }
00078   return StatusCode::SUCCESS;
00079 }


Member Data Documentation

Algorithm* DTag::m_ChargedDReconstruction [private]
 

Algorithm* DTag::m_ChargedDReconstruction [private]
 

Algorithm* DTag::m_DsReconstruction [private]
 

Algorithm* DTag::m_DsReconstruction [private]
 

Algorithm* DTag::m_NeutralDReconstruction [private]
 

Algorithm* DTag::m_NeutralDReconstruction [private]
 

bool DTag::m_rawdstonly [private]
 

bool DTag::m_recD0 [private]
 

bool DTag::m_recDp [private]
 

bool DTag::m_recDs [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:00:43 2011 for BOSS6.5.5 by  doxygen 1.3.9.1