BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DTag Class Reference

#include <DTag.h>

Inheritance diagram for DTag:

Public Member Functions

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

Detailed Description

Definition at line 6 of file DTag.h.

Constructor & Destructor Documentation

◆ DTag()

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

Definition at line 17 of file DTag.cxx.

18 : Gaudi::Sequence( name, pSvcLocator ) {
19 // Declare the properties
20 declareProperty( "NeutralDReconstruction", m_recD0 = true );
21 declareProperty( "ChargedDReconstruction", m_recDp = true );
22 declareProperty( "DsReconstruction", m_recDs = true );
23 declareProperty( "LambdaCReconstruction", m_recLc = true );
24 // declareProperty("RawDstOnly", m_rawdstonly = true);
25}

Referenced by DTag().

Member Function Documentation

◆ execute()

StatusCode DTag::execute ( const EventContext & ctx) const

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

End of "evtRecDTagCol != NULL" IF

Definition at line 134 of file DTag.cxx.

134 {
135
136 // check if DTagList exists
137 // if true, will exit the program
138 SmartDataPtr<EvtRecDTagCol> evtRecDTagCol( eventSvc(), EventModel::EvtRec::EvtRecDTagCol );
139 if ( evtRecDTagCol )
140 {
141 if ( evtRecDTagCol->size() > 0 )
142 {
143 cout << "************************************************" << endl;
144 cout << "EvtRecDTagCol already exists in this file!" << endl;
145 cout << " Please run this program on a raw dst file!" << endl;
146 cout << " *** This job is now being killed. ***" << endl;
147 cout << "************************************************" << endl;
148 return StatusCode::FAILURE;
149 } /// End of "evtRecDTagCol->size()>0" IF
150 } /// End of "evtRecDTagCol != NULL" IF
151
152 MsgStream log( msgSvc(), name() );
153 StatusCode sc = clearEvtRecDTagCol( log );
154 if ( sc != StatusCode::SUCCESS ) { return sc; }
155
156 DataObject* aEvtRecDTagCol;
157 eventSvc()->findObject( "/Event/EvtRec/EvtRecDTagCol", aEvtRecDTagCol ).ignore();
158 if ( aEvtRecDTagCol == NULL ) { registerEvtRecDTagCol( log ); }
159
160 std::vector<Algorithm*>::const_iterator it = subAlgorithms()->begin();
161 std::vector<Algorithm*>::const_iterator end = subAlgorithms()->end();
162 for ( ; it != end; it++ )
163 {
164 sc = ( *it )->execute( ctx );
165 if ( sc.isFailure() ) { log << "Error executing selection " << ( *it )->name() << endmsg; }
166 }
167
168 return StatusCode::SUCCESS;
169}
IMessageSvc * msgSvc()

◆ finalize()

StatusCode DTag::finalize ( )

Definition at line 172 of file DTag.cxx.

172 {
173
174 MsgStream log( msgSvc(), name() );
175 log << MSG::INFO << "in finalize()" << endmsg;
176 return Gaudi::Sequence::finalize();
177}

◆ initialize()

StatusCode DTag::initialize ( )

Definition at line 28 of file DTag.cxx.

28 {
29
30 MsgStream log( msgSvc(), name() );
31
32 log << MSG::INFO << "creating DTag sub Algorithm" << endmsg;
33
34 StatusCode sc;
35
36 if ( m_recD0 )
37 {
38 sc = createSubAlgorithm( "NeutralDReconstruction", "NeutralDReconstruction",
39 m_NeutralDReconstruction );
40 if ( sc.isFailure() )
41 {
42 log << MSG::ERROR << "Error while creating D0Reconstruction" << endmsg;
43 return StatusCode::FAILURE;
44 }
45 }
46
47 if ( m_recDp )
48 {
49 sc = createSubAlgorithm( "ChargedDReconstruction", "ChargedDReconstruction",
50 m_ChargedDReconstruction );
51 if ( sc.isFailure() )
52 {
53 log << MSG::ERROR << "Error while creating D+Reconstruction" << endmsg;
54 return StatusCode::FAILURE;
55 }
56 }
57
58 if ( m_recDs )
59 {
60 sc = createSubAlgorithm( "DsReconstruction", "DsReconstruction", m_DsReconstruction );
61 if ( sc.isFailure() )
62 {
63 log << MSG::ERROR << "Error while creating DsReconstruction" << endmsg;
64 return StatusCode::FAILURE;
65 }
66 }
67
68 if ( m_recLc )
69 {
70 sc = createSubAlgorithm( "LambdaCReconstruction", "LambdaCReconstruction",
71 m_LambdaCReconstruction );
72 if ( sc.isFailure() )
73 {
74 log << MSG::ERROR << "Error while creating LcReconstruction" << endmsg;
75 return StatusCode::FAILURE;
76 }
77 }
78
79 log << MSG::INFO << "Calling Sequence::initialize()" << endmsg;
80 return Gaudi::Sequence::initialize();
81}

The documentation for this class was generated from the following files: