CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemAliEvent.cxx
Go to the documentation of this file.
2
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/IMessageSvc.h"
5#include "GaudiKernel/StatusCode.h"
6#include "GaudiKernel/ISvcLocator.h"
7#include "GaudiKernel/Bootstrap.h"
8#include "GaudiKernel/SmartDataPtr.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10#include "GaudiKernel/PropertyMgr.h"
11
14
15#include "EventModel/Event.h"
17#include "EventModel/Event.h"
18
21
27
29#include "Identifier/CgemID.h"
30
31#include <iostream>
32#include <math.h>
33
34using namespace Event;
35
37 IMessageSvc *msgSvc;
38 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
39 MsgStream log(msgSvc, "CgemAliEvent");
40 log << MSG::INFO << "CgemAliEvent::setRecEvent" << endreq;
41
42 IDataProviderSvc* eventSvc = NULL;
43 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
44
45 SmartDataPtr<RecMdcTrackCol> newtrkCol(eventSvc, "/Event/Recon/RecMdcTrackCol");
46 if(!newtrkCol){
47 //log << MSG::ERROR << "Could not find RecMdcTrackCol" << endreq;
48 return ( StatusCode::FAILURE );
49 }
50
51 int i = 0;
52 CgemAliRecTrk* rectrk;
53 RecMdcTrackCol::iterator it_trk = newtrkCol->begin();
54 for(; it_trk != newtrkCol->end(); it_trk++){
55 rectrk = new CgemAliRecTrk();
56 rectrk -> setRecTrk(it_trk);
57 m_rectrk.push_back(rectrk);
58
59 i++;
60 }
61 log << MSG::WARNING << "RecTrack ntrk = " << i << endreq;
62
63 return StatusCode::SUCCESS;
64}
65
67 IMessageSvc *msgSvc;
68 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
69 MsgStream log(msgSvc, "CgemAliEvent");
70 log << MSG::INFO << "CgemAliEvent::setKalEvent" << endreq;
71
72 IDataProviderSvc* eventSvc = NULL;
73 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
74
75
76 SmartDataPtr<RecMdcKalTrackCol> kaltrkCol(eventSvc,"/Event/Recon/RecMdcKalTrackCol");
77 if (!kaltrkCol) {
78 log << MSG::FATAL << "Could not find RecMdcKalTrackCol" << endreq;
79 return StatusCode::FAILURE;
80 }
81
82 int i = 0;
83 CgemAliRecTrk* rectrk;
84 RecMdcKalTrackCol::iterator iter_trk = kaltrkCol->begin();
85 for(; iter_trk != kaltrkCol->end(); iter_trk++) {
86 rectrk = new CgemAliRecTrk();
87 rectrk -> setKalTrk(iter_trk);
88 m_rectrk.push_back(rectrk);
89
90 i++;
91 }
92 log << MSG::INFO << "KalTrack ntrk = " << i << endreq;
93
94 return StatusCode::SUCCESS;
95}
96
98 unsigned int i;
99 for(i=0; i<m_rectrk.size(); i++){
100 delete m_rectrk[i];
101 }
102 m_rectrk.clear();
103}
IMessageSvc * msgSvc()
StatusCode setKalEvent()
StatusCode setRecEvent()
Definition: Event.h:21