BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcAliEvent Class Reference

#include <MdcAliEvent.h>

Public Member Functions

void setParam (MdcAliParams &param)
 
StatusCode setRecEvent ()
 
StatusCode setKalEvent ()
 
int getEsFlag () const
 
bool getEsCutFlag () const
 
double getTes () const
 
int getNTrk () const
 
MdcAliRecTrkgetRecTrk (int index) const
 
void clear ()
 

Detailed Description

Definition at line 15 of file MdcAliEvent.h.

Member Function Documentation

◆ clear()

void MdcAliEvent::clear ( )

Definition at line 142 of file MdcAliEvent.cxx.

142 {
143 unsigned int i;
144 for(i=0; i<m_rectrk.size(); i++){
145 delete m_rectrk[i];
146 }
147 m_rectrk.clear();
148}

Referenced by MdcAlignAlg::execute().

◆ getEsCutFlag()

bool MdcAliEvent::getEsCutFlag ( ) const
inline

Definition at line 22 of file MdcAliEvent.h.

22{ return m_esCutFg; }

◆ getEsFlag()

int MdcAliEvent::getEsFlag ( ) const
inline

Definition at line 21 of file MdcAliEvent.h.

21{ return m_esFlag; }

◆ getNTrk()

int MdcAliEvent::getNTrk ( ) const
inline

Definition at line 25 of file MdcAliEvent.h.

25{ return m_rectrk.size(); }

◆ getRecTrk()

MdcAliRecTrk * MdcAliEvent::getRecTrk ( int  index) const
inline

Definition at line 26 of file MdcAliEvent.h.

26{ return m_rectrk[index]; }

◆ getTes()

double MdcAliEvent::getTes ( ) const
inline

Definition at line 23 of file MdcAliEvent.h.

23{ return m_tes; }

◆ setKalEvent()

StatusCode MdcAliEvent::setKalEvent ( )

Definition at line 89 of file MdcAliEvent.cxx.

89 {
90 IMessageSvc *msgSvc;
91 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
92 MsgStream log(msgSvc, "MdcAliEvent");
93 log << MSG::INFO << "MdcAliEvent::setKalEvent" << endreq;
94
95 IDataProviderSvc* eventSvc = NULL;
96 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
97
98 // get EsTimeCol
99 SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc,"/Event/Recon/RecEsTimeCol");
100 if( ! aevtimeCol || (aevtimeCol->size()==0) ){
101 m_tes = -9999.0;
102 m_esFlag = -1;
103 }else{
104 RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
105 for(; iter_evt!=aevtimeCol->end(); iter_evt++){
106 m_tes = (*iter_evt)->getTest();
107 m_esFlag = (*iter_evt)->getStat();
108 }
109 }
110
111 m_esCutFg = false;
112 bool flagTes = false;
113 for(int iEs=0; iEs<m_param.nEsFlag; iEs++){
114 if(m_esFlag == m_param.esFlag[iEs]){
115 flagTes = true;
116 break;
117 }
118 }
119 if( flagTes && (m_tes > m_param.tesMin) && (m_tes < m_param.tesMax) ) m_esCutFg = true;
120
121 SmartDataPtr<RecMdcKalTrackCol> kaltrkCol(eventSvc,"/Event/Recon/RecMdcKalTrackCol");
122 if (!kaltrkCol) {
123 log << MSG::FATAL << "Could not find RecMdcKalTrackCol" << endreq;
124 return StatusCode::FAILURE;
125 }
126
127 int i = 0;
128 MdcAliRecTrk* rectrk;
129 RecMdcKalTrackCol::iterator iter_trk = kaltrkCol->begin();
130 for(; iter_trk != kaltrkCol->end(); iter_trk++) {
131 rectrk = new MdcAliRecTrk();
132 rectrk -> setKalTrk(iter_trk);
133 m_rectrk.push_back(rectrk);
134
135 i++;
136 }
137 log << MSG::INFO << "KalTrack ntrk = " << i << endreq;
138
139 return StatusCode::SUCCESS;
140}
IMessageSvc * msgSvc()
#define NULL
double tesMax
Definition: MdcAliParams.h:12
double tesMin
Definition: MdcAliParams.h:11
int esFlag[50]
Definition: MdcAliParams.h:10

◆ setParam()

void MdcAliEvent::setParam ( MdcAliParams param)
inline

Definition at line 17 of file MdcAliEvent.h.

17{ m_param = param; }

◆ setRecEvent()

StatusCode MdcAliEvent::setRecEvent ( )

Definition at line 36 of file MdcAliEvent.cxx.

36 {
37 IMessageSvc *msgSvc;
38 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
39 MsgStream log(msgSvc, "MdcAliEvent");
40 log << MSG::INFO << "MdcAliEvent::setRecEvent" << endreq;
41
42 IDataProviderSvc* eventSvc = NULL;
43 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
44
45 // get EsTimeCol
46 SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc,"/Event/Recon/RecEsTimeCol");
47 if( ! aevtimeCol || (aevtimeCol->size()==0) ){
48 m_tes = -9999.0;
49 m_esFlag = -1;
50 }else{
51 RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
52 for(; iter_evt!=aevtimeCol->end(); iter_evt++){
53 m_tes = (*iter_evt)->getTest();
54 m_esFlag = (*iter_evt)->getStat();
55 }
56 }
57
58 m_esCutFg = false;
59 bool flagTes = false;
60 for(int iEs=0; iEs<m_param.nEsFlag; iEs++){
61 if(m_esFlag == m_param.esFlag[iEs]){
62 flagTes = true;
63 break;
64 }
65 }
66 if( flagTes && (m_tes > m_param.tesMin) && (m_tes < m_param.tesMax) ) m_esCutFg = true;
67
68 SmartDataPtr<RecMdcTrackCol> newtrkCol(eventSvc, "/Event/Recon/RecMdcTrackCol");
69 if(!newtrkCol){
70 log << MSG::ERROR << "Could not find RecMdcTrackCol" << endreq;
71 return ( StatusCode::FAILURE );
72 }
73
74 int i = 0;
75 MdcAliRecTrk* rectrk;
76 RecMdcTrackCol::iterator it_trk = newtrkCol->begin();
77 for(; it_trk != newtrkCol->end(); it_trk++){
78 rectrk = new MdcAliRecTrk();
79 rectrk -> setRecTrk(it_trk);
80 m_rectrk.push_back(rectrk);
81
82 i++;
83 }
84 log << MSG::WARNING << "RecTrack ntrk = " << i << endreq;
85
86 return StatusCode::SUCCESS;
87}

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