BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
DstEventMaker Class Reference

#include <DstEventMaker.h>

+ Inheritance diagram for DstEventMaker:

Public Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ DstEventMaker() [1/2]

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

Definition at line 55 of file DstEventMaker.cxx.

55 :
56 Algorithm(name, pSvcLocator)
57{
58 // Declare the properties
59 // declareProperty("FittingMethod", m_fittingMethod = 2);
60 // declareProperty("ConfigFile", m_configFile = "MDCConfig.xml");
61}

◆ DstEventMaker() [2/2]

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

Member Function Documentation

◆ execute() [1/2]

StatusCode DstEventMaker::execute ( )

Definition at line 73 of file DstEventMaker.cxx.

73 {
74
75 MsgStream log(msgSvc(), name());
76 log << MSG::INFO << "in execute()" << endreq;
77
78 // Part 1: Get the event header, print out event and run number
79
80 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
81 if (!eventHeader) {
82 log << MSG::FATAL << "Could not find Event Header" << endreq;
83 return( StatusCode::FAILURE);
84 }
85
86
87 int eventId = eventHeader->eventNumber() ;
88 int runId = eventHeader->runNumber();
89 log << MSG::INFO << "DstEventMaker: retrieved event: " <<" Event Number "<< eventId << " run: " <<runId << endreq;
90
91 StatusCode sc = StatusCode::SUCCESS ;
92 int trackID;
93
94 // register ReconEvent Data Object to TDS; 2005/09/14
95 DstEvent* dstEvt = new DstEvent();
96 //dstEvt->setEventId(eventId);
97 //dstEvt->setRunId(runId);
98 sc = eventSvc()->registerObject(EventModel::Dst::Event, dstEvt);
99
100
101 //Part 2: Retrieve Mdc Track
102 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(eventSvc(),"/Event/Recon/RecMdcTrackCol");
103 if (!recMdcTrackCol) {
104 log << MSG::INFO << "Could not find RecMdcTrackCol" << endreq;
105 } else {
106 DstMdcTrackCol* dstMdcTrackCol = new DstMdcTrackCol();
107 RecMdcTrackCol::iterator iter_mdc = recMdcTrackCol->begin();
108 trackID = 0;
109 for (;iter_mdc != recMdcTrackCol->end(); iter_mdc++, trackID++) {
110 DstMdcTrack* dstMdcTrack = new DstMdcTrack();
111 *dstMdcTrack = **iter_mdc;
112 (*dstMdcTrackCol).push_back(dstMdcTrack);
113
114 log << MSG::INFO
115 << " Mdc Track ID = " << trackID
116 << " Mdc Track Nster = " << (*iter_mdc)->nster()
117 << endreq;
118 }
119 sc = eventSvc()->registerObject(EventModel::Dst::DstMdcTrackCol,dstMdcTrackCol);
120 }
121
122 //Part 3: Retrieve Tof Track
123 SmartDataPtr<RecTofTrackCol> tofTrackCol(eventSvc(),"/Event/Recon/RecTofTrackCol");
124 if ( !tofTrackCol ) {
125 log << MSG::INFO << "Could not find TofTrackCol" << endreq;
126 }
127 else {
128 DstTofTrackCol* dstTofTrackCol = new DstTofTrackCol();
129 RecTofTrackCol::iterator iter_tof = tofTrackCol->begin();
130 for( ; iter_tof != tofTrackCol->end(); iter_tof++ ) {
131 DstTofTrack* dstTofTrack = new DstTofTrack();
132 *dstTofTrack = **iter_tof;
133 (*dstTofTrackCol).push_back(dstTofTrack);
134
135 log << MSG::INFO
136 << "Tof Track ID = " << (*iter_tof)->tofTrackID()
137 << " Track ID = " << (*iter_tof)->trackID()
138 << " Tof Counter ID = "<<(*iter_tof)->tofID()
139 << " Quality = "<< (*iter_tof)->quality()
140 << endreq;
141 }
142 sc = eventSvc()->registerObject(EventModel::Dst::DstTofTrackCol,dstTofTrackCol);
143 }
144
145
146 //Part 4: Retrieve Muc Track
147 SmartDataPtr<RecMucTrackCol> mucTrackCol(eventSvc(),"/Event/Recon/RecMucTrackCol");
148 if (!mucTrackCol) {
149 log <<MSG::INFO << "Could not find RecMucTrackCol" << endreq;
150 } else {
151 DstMucTrackCol* dstMucTrackCol = new DstMucTrackCol();
152 RecMucTrackCol::iterator iter_muc = mucTrackCol->begin();
153 trackID = 0;
154 for (;iter_muc != mucTrackCol->end(); iter_muc++, trackID++) {
155 DstMucTrack* dstMucTrack = new DstMucTrack();
156 *dstMucTrack = **iter_muc;
157 (*dstMucTrackCol).push_back(dstMucTrack);
158 log<< MSG::INFO
159 << "Muc Track ID = " << trackID
160 << " Muc NumHits = " << (*iter_muc)->GetTotalHits()
161 << " Muc Pos x = " << (*iter_muc)->getMucPos().x()
162 << " Muc Pos y = " << (*iter_muc)->getMucPos().y()
163 << " Muc Pos z = " << (*iter_muc)->getMucPos().z()
164 << endreq;
165 }
166 sc = eventSvc()->registerObject(EventModel::Dst::DstMucTrackCol,dstMucTrackCol);
167 }
168
169
170 //Part 5: Retrieve MdcDedx Track
171
172 SmartDataPtr<RecMdcDedxCol> mdcDedxCol(eventSvc(),"/Event/Recon/RecMdcDedxCol");
173 if (!mdcDedxCol) {
174 log <<MSG::INFO << "Could not find RecMdcDedxCol" << endreq;
175 } else {
176 trackID = 0;
177 DstMdcDedxCol* dstMdcDedxCol = new DstMdcDedxCol();
178 RecMdcDedxCol::iterator iter_dedx = mdcDedxCol->begin();
179 for (;iter_dedx != mdcDedxCol->end(); iter_dedx++, trackID++) {
180 DstMdcDedx* dstMdcDedx = new DstMdcDedx();
181 *dstMdcDedx = **iter_dedx;
182 (*dstMdcDedxCol).push_back(dstMdcDedx);
183 log << MSG::INFO
184 << " Dedx TrackID = "<< trackID
185 // << " Num Sigma E = " << (*iter_dedx)->getSigmaDedx(1)
186 // << " Num Sigma Mu = " << (*iter_dedx)->getSigmaDedx(2)
187 << endreq;
188 }
189 sc = eventSvc()->registerObject(EventModel::Dst::DstMdcDedxCol,dstMdcDedxCol);
190 }
191
192
193
194 //Part 6: Retrieve Emc shower
195
196 SmartDataPtr<RecEmcShowerCol> emcRecShowerCol(eventSvc(),"/Event/Recon/RecEmcShowerCol");
197 if (!emcRecShowerCol) {
198 log <</* MSG::FATAL*/MSG::INFO << "Could not find RecEmcShowerCol" << endreq;
199 // return( StatusCode::FAILURE);
200 }
201 else {
202 trackID = 0;
203 DstEmcShowerCol* dstEmcTrackCol = new DstEmcShowerCol();
204 RecEmcShowerCol::iterator iter_emc = emcRecShowerCol->begin();
205 for (;iter_emc != emcRecShowerCol->end(); iter_emc++, trackID++) {
206 DstEmcShower* dstEmcTrack = new DstEmcShower(*(*iter_emc));
207 (*dstEmcTrackCol).push_back(dstEmcTrack);
208 log << MSG::INFO
209 << " Emc Track Id = " << trackID
210 //<< " Emc Shower Cell Id = " << (*iter_emc)->ShowerId()
211 << endreq;
212 }
213 sc = eventSvc()->registerObject(EventModel::Dst::DstEmcShowerCol,dstEmcTrackCol);
214 }
215
216 //Part 7: Retrieve Ext shower
217
218 SmartDataPtr<RecExtTrackCol> extTrackCol(eventSvc(),"/Event/Recon/RecExtTrackCol");
219 if (!extTrackCol) {
220 log <</* MSG::FATAL*/MSG::INFO << "Could not find RecExtTrackCol" << endreq;
221 //return( StatusCode::FAILURE);
222 }
223 else {
224 trackID = 0;
225 DstExtTrackCol* dstExtTrackCol = new DstExtTrackCol();
226 RecExtTrackCol::iterator iter_ext = extTrackCol->begin();
227 for (;iter_ext != extTrackCol->end(); iter_ext++, trackID++) {
228 DstExtTrack* dstExtTrack = new DstExtTrack();
229 *dstExtTrack = **iter_ext;
230 (*dstExtTrackCol).push_back(dstExtTrack);
231 log << MSG::INFO
232 << " Ext Track Id = " << trackID
233 << "volume name of Tof1 : " << (*iter_ext)->tof1VolumeName()
234 <<" Ext Tof1 Error Z = " << (*iter_ext)->tof1PosSigmaAlongZ()
235 <<" Ext Tof2 Error Z = " << (*iter_ext)->tof2PosSigmaAlongZ()
236 <<" Ext Emc Error theta = " << (*iter_ext)->emcPosSigmaAlongTheta()
237 <<" Ext Muc Error Z = " << (*iter_ext)->mucPosSigmaAlongZ()
238 << endreq;
239 }
240
241 sc = eventSvc()->registerObject(EventModel::Dst::DstExtTrackCol,dstExtTrackCol);
242 }
243 //Part 8: Retrieve MdcKal track
244
245 SmartDataPtr<RecMdcKalTrackCol> mdcKalTrackCol(eventSvc(),"/Event/Recon/RecMdcKalTrackCol");
246 if (!mdcKalTrackCol) {
247 log <</* MSG::FATAL*/ MSG::INFO<< "Could not find MdcKalTrackCol" << endreq;
248 //return( StatusCode::FAILURE);
249 }
250 else {
251 trackID = 0;
252 int nhits[5];
253 int stat[2][5];
254 float chisq[2][5];
255 int ndf[2][5];
256 int nster[2][5];
257 int fL[2][5];
258 int lL[2][5];
259
260 DstMdcKalTrackCol* dstMdcKalTrackCol = new DstMdcKalTrackCol();
261 RecMdcKalTrackCol::iterator iter_kal = mdcKalTrackCol->begin();
262 for (;iter_kal != mdcKalTrackCol->end(); iter_kal++, trackID++) {
263 DstMdcKalTrack* dstMdcKalTrack = new DstMdcKalTrack();
264 *dstMdcKalTrack = **iter_kal;
265
266 /*
267 for (int i=0; i<5; i++){
268 nhits[i] = (*iter_kal)->getNhits(i);
269 stat[i] = (*iter_kal)->getStat(0,i);
270 chisq[i] = (*iter_kal)->getChisq(0,i);
271 ndf[i] = (*iter_kal)->getNdf(0,i);
272 nster[i] = (*iter_kal)->getNster(0,i);
273 fL[i] = (*iter_kal)->getFirstLayer(0,i);
274 lL[i] = (*iter_kal)->getLastLayer(0,i);
275
276 dstMdcKalTrack->setNhits(nhits[i],i);
277 dstMdcKalTrack->setStat(stat[i],i);
278 dstMdcKalTrack->setChisq(chisq[i],i);
279 dstMdcKalTrack->setNdf(ndf[i],i);
280 dstMdcKalTrack->setNster(nster[i],i);
281 dstMdcKalTrack->setFirstLayer(fL[i],i);
282 dstMdcKalTrack->setLastLayer(lL[i],i);
283 }
284 dstMdcKalTrack->setTrackId((*iter_kal)->getTrackId());
285
286 for(int j=0; j<5; j++){
287 dstMdcKalTrack->setPoca((*iter_kal)->getPoca(j),j);
288 dstMdcKalTrack->setZHelix((*iter_kal)->getZHelix(j),j);
289 dstMdcKalTrack->setZError((*iter_kal)->getZError(j),j);
290 }
291
292 */
293
294 (*dstMdcKalTrackCol).push_back(dstMdcKalTrack);
295
296 log<<MSG::INFO<<" * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endreq;
297 for(int i =0 ; i < 5; i++){
298 log << MSG::INFO<<"dstMdcKalTrack ZHelix["<<i<<"] = " <<dstMdcKalTrack->getZHelix(i) <<endreq;
299 log << MSG::INFO << "number of total hits contained ["<<i<<"]"<<nhits[i]<<endreq;
300 log << MSG::INFO<< "status flag ["<<i<<"]"<<stat[i]<<endreq;
301 log << MSG::INFO<< "dstMdcKalTrack ZError ["<<i<<"]"<<dstMdcKalTrack->getZError(i)<<endreq;
302 log << MSG::INFO<< "dstMdcKalTrack Poca ["<<i<<"]"<<dstMdcKalTrack->getPoca(i)<<endreq;
303 }
304 }
305 sc = eventSvc()->registerObject(EventModel::Dst::DstMdcKalTrackCol, dstMdcKalTrackCol);
306 }
307
308 return sc;
309}
ObjectVector< DstEmcShower > DstEmcShowerCol
ObjectVector< DstExtTrack > DstExtTrackCol
ObjectVector< DstMdcDedx > DstMdcDedxCol
ObjectVector< DstMdcKalTrack > DstMdcKalTrackCol
ObjectVector< DstMdcTrack > DstMdcTrackCol
ObjectVector< DstMucTrack > DstMucTrackCol
ObjectVector< DstTofTrack > DstTofTrackCol
const HepVector & getZHelix(const int pid) const
const HepSymMatrix & getZError(const int pid) const
const HepPoint3D & getPoca(const int pid) const
int nhits

◆ execute() [2/2]

StatusCode DstEventMaker::execute ( )

◆ finalize() [1/2]

StatusCode DstEventMaker::finalize ( )

Definition at line 312 of file DstEventMaker.cxx.

312 {
313
314 MsgStream log(msgSvc(), name());
315 log << MSG::INFO << "in finalize()" << endreq;
316
317 return StatusCode::SUCCESS;
318}

◆ finalize() [2/2]

StatusCode DstEventMaker::finalize ( )

◆ initialize() [1/2]

StatusCode DstEventMaker::initialize ( )

Definition at line 64 of file DstEventMaker.cxx.

64 {
65
66 MsgStream log(msgSvc(), name());
67 log << MSG::INFO << "in initialize()" << endreq;
68
69 return StatusCode::SUCCESS;
70}

◆ initialize() [2/2]

StatusCode DstEventMaker::initialize ( )

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