CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
MrpcRecTDS Class Reference

#include <MrpcRecTDS.h>

Public Member Functions

StatusCode InitializeTDS ()
 
StatusCode RegisterNullRecTofTrackCol ()
 
StatusCode RegisterTDS (int runNumber, int eventNumber, std::vector< MrpcTrack * > *&tofTrackVec)
 
StatusCode RegisterReconEvent ()
 
StatusCode RegisterRecTofTrackCol (std::vector< MrpcTrack * > *&tofTrackVec)
 
StatusCode InitializeTDS ()
 
StatusCode RegisterNullRecTofTrackCol ()
 
StatusCode RegisterTDS (int runNumber, int eventNumber, std::vector< MrpcTrack * > *&tofTrackVec)
 
StatusCode RegisterReconEvent ()
 
StatusCode RegisterRecTofTrackCol (std::vector< MrpcTrack * > *&tofTrackVec)
 

Detailed Description

Member Function Documentation

◆ InitializeTDS() [1/2]

StatusCode MrpcRecTDS::InitializeTDS ( )

Definition at line 13 of file MrpcRecTDS.cxx.

13 {
14 if( RegisterReconEvent() == StatusCode::FAILURE ) return StatusCode::FAILURE;
15 if( RegisterNullRecTofTrackCol() == StatusCode::FAILURE ) return StatusCode::FAILURE;
16 return StatusCode::SUCCESS;
17}
StatusCode RegisterNullRecTofTrackCol()
Definition: MrpcRecTDS.cxx:20
StatusCode RegisterReconEvent()
Definition: MrpcRecTDS.cxx:64

◆ InitializeTDS() [2/2]

StatusCode MrpcRecTDS::InitializeTDS ( )

◆ RegisterNullRecTofTrackCol() [1/2]

StatusCode MrpcRecTDS::RegisterNullRecTofTrackCol ( )

Definition at line 20 of file MrpcRecTDS.cxx.

20 {
21 IMessageSvc* msgSvc;
22 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
23 MsgStream log(msgSvc, "MrpcRecTDS");
24 log << MSG::INFO << "Initialize: MrpcRecTDS::RegisterNullRecTofTrack()" << endreq;
25
26 IDataProviderSvc* eventSvc;
27 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
28
29 RecTofTrackCol* recTofTrackCol = new RecTofTrackCol;
30
31// Check whether the RecTofTrackCol has been registered.
32 StatusCode sc;
33 DataObject *aRecTofTrackCol;
34 eventSvc->findObject( "/Event/Recon/RecTofTrackCol", aRecTofTrackCol );
35 if( aRecTofTrackCol != NULL ) {
36 sc = eventSvc->unregisterObject( "/Event/Recon/RecTofTrackCol" );
37 if( sc != StatusCode::SUCCESS ) {
38 log << MSG::FATAL << "Initialize: Could not unregister RecTofTrack collection!" << endreq;
39 delete recTofTrackCol;
40 return StatusCode::FAILURE;
41 }
42 }
43 delete aRecTofTrackCol;
44
45 sc = eventSvc->registerObject("/Event/Recon/RecTofTrackCol", recTofTrackCol);
46 if( sc != StatusCode::SUCCESS ) {
47 log << MSG::FATAL << "Initialize: MrpcRec could not register Null Rec TOF track collection!" << endreq;
48 delete recTofTrackCol;
49 return StatusCode::FAILURE;
50 }
51
52 return StatusCode::SUCCESS;
53}
ObjectVector< RecTofTrack > RecTofTrackCol

Referenced by MrpcRec::execute(), and InitializeTDS().

◆ RegisterNullRecTofTrackCol() [2/2]

StatusCode MrpcRecTDS::RegisterNullRecTofTrackCol ( )

◆ RegisterReconEvent() [1/2]

StatusCode MrpcRecTDS::RegisterReconEvent ( )

Definition at line 64 of file MrpcRecTDS.cxx.

64 {
65 IMessageSvc* msgSvc;
66 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
67 MsgStream log(msgSvc, "MrpcRecTDS");
68
69 IDataProviderSvc* eventSvc;
70 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
71
72// Register Reconstructed Track To TDS
73 DataObject *aReconEvent ;
74 eventSvc->findObject("/Event/Recon",aReconEvent);
75 if(aReconEvent==NULL) {
76 log << MSG::INFO << "MrpcRecTDS::RegisterReconEvent()" << endreq;
77 aReconEvent = new ReconEvent();
78 StatusCode sc = eventSvc->registerObject("/Event/Recon",aReconEvent);
79 if(sc!=StatusCode::SUCCESS) {
80 log << MSG::FATAL << "MrpcRec could not register ReconEvent!" <<endreq;
81 return StatusCode::FAILURE;
82 }
83 }
84 return StatusCode::SUCCESS;
85}

Referenced by InitializeTDS().

◆ RegisterReconEvent() [2/2]

StatusCode MrpcRecTDS::RegisterReconEvent ( )

◆ RegisterRecTofTrackCol() [1/2]

StatusCode MrpcRecTDS::RegisterRecTofTrackCol ( std::vector< MrpcTrack * > *&  tofTrackVec)

Definition at line 88 of file MrpcRecTDS.cxx.

88 {
89 IMessageSvc* msgSvc;
90 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
91 MsgStream log(msgSvc, "MrpcRecTDS");
92 log << MSG::INFO << "MrpcRecTDS::RegisterRecTofTrack()" << endreq;
93
94 IDataProviderSvc* eventSvc;
95 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
96
97 RecTofTrackCol* recTofTrackCol = new RecTofTrackCol;
98
99 std::vector<MrpcTrack*>::iterator iter = tofTrackVec->begin();
100 for( ; iter < tofTrackVec->end(); iter++ ) {
101 (*iter)->convert2RecTofTrackCol( recTofTrackCol );
102 }
103
104// Check whether the RecTofTrackCol has been registered.
105 StatusCode sc;
106 DataObject *aRecTofTrackCol;
107 eventSvc->findObject( "/Event/Recon/RecTofTrackCol", aRecTofTrackCol );
108 if( aRecTofTrackCol != NULL ) {
109
110 sc = eventSvc->unregisterObject( "/Event/Recon/RecTofTrackCol" );
111
112 delete aRecTofTrackCol;
113
114 if( sc != StatusCode::SUCCESS ) {
115 log << MSG::FATAL << "Could not unregister RecTofTrack collection!" << endreq;
116
117 RecTofTrackCol::iterator iter_tof = recTofTrackCol->begin();
118 for( ; iter_tof!=recTofTrackCol->end(); iter_tof++ ) {
119 delete (*iter_tof);
120 }
121 recTofTrackCol->clear();
122 delete recTofTrackCol;
123
124 std::vector<MrpcTrack*>::iterator iter_data = tofTrackVec->begin();
125 for( ; iter_data!=tofTrackVec->end(); iter_data++ ) {
126 delete (*iter_data);
127 }
128 tofTrackVec->clear();
129 delete tofTrackVec;
130
131 return StatusCode::FAILURE;
132 }
133 }
134
135 sc = eventSvc->registerObject("/Event/Recon/RecTofTrackCol", recTofTrackCol);
136 if( sc != StatusCode::SUCCESS ) {
137 log << MSG::FATAL << "MrpcRec could not register Rec TOF track collection!" << endreq;
138 RecTofTrackCol::iterator iter_tof = recTofTrackCol->begin();
139 for( ; iter_tof!=recTofTrackCol->end(); iter_tof++ ) {
140 delete (*iter_tof);
141 }
142 recTofTrackCol->clear();
143 delete recTofTrackCol;
144 return StatusCode::FAILURE;
145 }
146
147 return StatusCode::SUCCESS;
148}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

Referenced by RegisterTDS().

◆ RegisterRecTofTrackCol() [2/2]

StatusCode MrpcRecTDS::RegisterRecTofTrackCol ( std::vector< MrpcTrack * > *&  tofTrackVec)

◆ RegisterTDS() [1/2]

StatusCode MrpcRecTDS::RegisterTDS ( int  runNumber,
int  eventNumber,
std::vector< MrpcTrack * > *&  tofTrackVec 
)

Definition at line 56 of file MrpcRecTDS.cxx.

56 {
57 // if( RegisterReconEvent() == StatusCode::FAILURE ) return StatusCode::FAILURE;
58 if( RegisterRecTofTrackCol( tofTrackVec ) == StatusCode::FAILURE ) return StatusCode::FAILURE;
59
60 return StatusCode::SUCCESS;
61}
StatusCode RegisterRecTofTrackCol(std::vector< MrpcTrack * > *&tofTrackVec)
Definition: MrpcRecTDS.cxx:88

Referenced by MrpcRec::execute().

◆ RegisterTDS() [2/2]

StatusCode MrpcRecTDS::RegisterTDS ( int  runNumber,
int  eventNumber,
std::vector< MrpcTrack * > *&  tofTrackVec 
)

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