BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcCalEvent Class Reference

#include <MdcCalEvent.h>

Public Member Functions

 MdcCalEvent ()
 
 ~MdcCalEvent ()
 
void setParam (MdcCalParams &param)
 
void setGeomSvc (IMdcGeomSvc *mdcGeomSvc)
 
void setUtilSvc (IMdcUtilitySvc *mdcUtilitySvc)
 
StatusCode setRecEvent ()
 
StatusCode setKalEvent ()
 
int getNRawHitTQ () const
 
int getEsFlag () const
 
bool getEsCutFlag () const
 
int getNesCutFlag () const
 
double getTes () const
 
int getNTrk () const
 
MdcCalRecTrkgetRecTrk (int index) const
 
void setEvtNoOnline (int evtNo)
 
int getEvtNoOnline () const
 
void setEvtNoOffline (int evtNo)
 
int getEvtNoOffline () const
 
void clear ()
 

Detailed Description

Definition at line 15 of file MdcCalEvent.h.

Constructor & Destructor Documentation

◆ MdcCalEvent()

MdcCalEvent::MdcCalEvent ( )

Definition at line 36 of file MdcCalEvent.cxx.

36 {
37}

◆ ~MdcCalEvent()

MdcCalEvent::~MdcCalEvent ( )

Definition at line 39 of file MdcCalEvent.cxx.

39 {
40}

Member Function Documentation

◆ clear()

void MdcCalEvent::clear ( )

Definition at line 193 of file MdcCalEvent.cxx.

193 {
194 unsigned int i;
195 for(i=0; i<m_rectrk.size(); i++){
196 delete m_rectrk[i];
197 }
198 m_rectrk.clear();
199}

◆ getEsCutFlag()

bool MdcCalEvent::getEsCutFlag ( ) const
inline

Definition at line 29 of file MdcCalEvent.h.

29{ return m_esCutFg; }

◆ getEsFlag()

int MdcCalEvent::getEsFlag ( ) const
inline

Definition at line 28 of file MdcCalEvent.h.

28{ return m_esFlag; }

◆ getEvtNoOffline()

int MdcCalEvent::getEvtNoOffline ( ) const
inline

Definition at line 40 of file MdcCalEvent.h.

40{ return m_nEvtOffline; }

◆ getEvtNoOnline()

int MdcCalEvent::getEvtNoOnline ( ) const
inline

Definition at line 37 of file MdcCalEvent.h.

37{ return m_nEvtOnline; }

◆ getNesCutFlag()

int MdcCalEvent::getNesCutFlag ( ) const
inline

Definition at line 30 of file MdcCalEvent.h.

30{ return m_nEsCutFg; }

◆ getNRawHitTQ()

int MdcCalEvent::getNRawHitTQ ( ) const
inline

Definition at line 27 of file MdcCalEvent.h.

27{ return m_nhitTQ; }

◆ getNTrk()

int MdcCalEvent::getNTrk ( ) const
inline

Definition at line 33 of file MdcCalEvent.h.

33{ return m_rectrk.size(); }

◆ getRecTrk()

MdcCalRecTrk * MdcCalEvent::getRecTrk ( int index) const
inline

Definition at line 34 of file MdcCalEvent.h.

34{ return m_rectrk[index]; }

◆ getTes()

double MdcCalEvent::getTes ( ) const
inline

Definition at line 31 of file MdcCalEvent.h.

31{ return m_tes; }

◆ setEvtNoOffline()

void MdcCalEvent::setEvtNoOffline ( int evtNo)
inline

Definition at line 39 of file MdcCalEvent.h.

39{ m_nEvtOffline = evtNo; }

Referenced by MdcCalibAlg::execute().

◆ setEvtNoOnline()

void MdcCalEvent::setEvtNoOnline ( int evtNo)
inline

Definition at line 36 of file MdcCalEvent.h.

36{ m_nEvtOnline = evtNo; }

Referenced by MdcCalibAlg::execute().

◆ setGeomSvc()

void MdcCalEvent::setGeomSvc ( IMdcGeomSvc * mdcGeomSvc)
inline

Definition at line 21 of file MdcCalEvent.h.

21{ m_mdcGeomSvc = mdcGeomSvc; }

Referenced by setKalEvent(), and setRecEvent().

◆ setKalEvent()

StatusCode MdcCalEvent::setKalEvent ( )

Definition at line 120 of file MdcCalEvent.cxx.

120 {
121 IMessageSvc *msgSvc;
122 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
123 MsgStream log(msgSvc, "MdcCalEvent");
124 log << MSG::INFO << "MdcCalEvent::setKalEvent" << endreq;
125
126 IDataProviderSvc* eventSvc = NULL;
127 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
128
129 // retrieve Mdc digi
130 SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc,"/Event/Digi/MdcDigiCol");
131 if (!mdcDigiCol) {
132 log << MSG::FATAL << "Could not find event" << endreq;
133 }
134
135 MdcDigiCol::iterator iter = mdcDigiCol->begin();
136 m_nhitTQ = 0;
137 for(; iter != mdcDigiCol->end(); iter++) {
138 MdcDigi *aDigi = (*iter);
139 unsigned fgOverFlow = (aDigi) -> getOverflow();
140 if ( ((fgOverFlow & 3) !=0 ) || ((fgOverFlow & 12) != 0) ||
141 (aDigi->getTimeChannel() == 0x7FFFFFFF) ||
142 (aDigi->getChargeChannel() == 0x7FFFFFFF) ) continue;
143 m_nhitTQ++;
144 }
145
146 // get EsTimeCol
147 SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc,"/Event/Recon/RecEsTimeCol");
148 if( (!aevtimeCol) || (aevtimeCol->size()==0) ){
149 m_tes = -9999.0;
150 m_esFlag = -1;
151 }else{
152 RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
153 for(; iter_evt!=aevtimeCol->end(); iter_evt++){
154 m_tes = (*iter_evt)->getTest();
155 m_esFlag = (*iter_evt)->getStat();
156 }
157 }
158 m_esCutFg = false;
159 m_nEsCutFg = -1;
160 bool flagTes = false;
161 for(int iEs=0; iEs<m_param.nEsFlag; iEs++){
162 if(m_esFlag == m_param.esFlag[iEs]){
163 flagTes = true;
164 m_nEsCutFg = iEs;
165 break;
166 }
167 }
168 if( flagTes && (m_tes > m_param.tesMin) && (m_tes < m_param.tesMax) ) m_esCutFg = true;
169
170 SmartDataPtr<RecMdcKalTrackCol> kaltrkCol(eventSvc,"/Event/Recon/RecMdcKalTrackCol");
171 if (!kaltrkCol) {
172 log << MSG::FATAL << "Could not find RecMdcKalTrackCol" << endreq;
173 return StatusCode::FAILURE;
174 }
175
176 int i = 0;
177 MdcCalRecTrk* rectrk;
178 RecMdcKalTrackCol::iterator iter_trk = kaltrkCol->begin();
179 for(; iter_trk != kaltrkCol->end(); iter_trk++) {
180 rectrk = new MdcCalRecTrk(m_param.particle);
181 rectrk -> setGeomSvc(m_mdcGeomSvc);
182 rectrk -> setUtilSvc(m_mdcUtilitySvc);
183 rectrk -> setKalTrk(iter_trk);
184 m_rectrk.push_back(rectrk);
185
186 i++;
187 }
188 log << MSG::INFO << "KalTrack ntrk = " << i << endreq;
189
190 return StatusCode::SUCCESS;
191}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
IMessageSvc * msgSvc()
#define NULL
void setGeomSvc(IMdcGeomSvc *mdcGeomSvc)
Definition MdcCalEvent.h:21
void setUtilSvc(IMdcUtilitySvc *mdcUtilitySvc)
Definition MdcCalEvent.h:22
int esFlag[50]
unsigned int getChargeChannel() const
Definition RawData.cxx:45
unsigned int getTimeChannel() const
Definition RawData.cxx:40

◆ setParam()

void MdcCalEvent::setParam ( MdcCalParams & param)
inline

Definition at line 20 of file MdcCalEvent.h.

20{ m_param = param; }

◆ setRecEvent()

StatusCode MdcCalEvent::setRecEvent ( )

Definition at line 42 of file MdcCalEvent.cxx.

42 {
43 IMessageSvc *msgSvc;
44 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
45 MsgStream log(msgSvc, "MdcCalEvent");
46 log << MSG::INFO << "MdcCalEvent::setRecEvent" << endreq;
47
48 IDataProviderSvc* eventSvc = NULL;
49 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
50
51 // retrieve Mdc digi
52 SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc,"/Event/Digi/MdcDigiCol");
53 if (!mdcDigiCol) {
54 log << MSG::FATAL << "Could not find event" << endreq;
55 }
56
57 MdcDigiCol::iterator iter = mdcDigiCol->begin();
58 m_nhitTQ = 0;
59 for(; iter != mdcDigiCol->end(); iter++) {
60 MdcDigi *aDigi = (*iter);
61 unsigned fgOverFlow = (aDigi) -> getOverflow();
62 if ( ((fgOverFlow & 3) !=0 ) || ((fgOverFlow & 12) != 0) ||
63 (aDigi->getTimeChannel() == 0x7FFFFFFF) ||
64 (aDigi->getChargeChannel() == 0x7FFFFFFF) ) continue;
65 m_nhitTQ++;
66 }
67
68 // get EsTimeCol
69 SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc,"/Event/Recon/RecEsTimeCol");
70 if( (!aevtimeCol) || (aevtimeCol->size()==0) ){
71 m_tes = -9999.0;
72 m_esFlag = -1;
73 }else{
74 RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
75 for(; iter_evt!=aevtimeCol->end(); iter_evt++){
76 m_tes = (*iter_evt)->getTest();
77 m_esFlag = (*iter_evt)->getStat();
78 }
79 }
80 m_esCutFg = false;
81 m_nEsCutFg = -1;
82 bool flagTes = false;
83 for(int iEs=0; iEs<m_param.nEsFlag; iEs++){
84 if(m_esFlag == m_param.esFlag[iEs]){
85 flagTes = true;
86 m_nEsCutFg = iEs;
87 break;
88 }
89 }
90 if(-1 == m_esFlag){
91 m_esCutFg = false;
92 } else{
93 if( !m_param.esCut) m_esCutFg = true;
94 else if( flagTes && (m_tes > m_param.tesMin) && (m_tes < m_param.tesMax) ) m_esCutFg = true;
95 }
96
97 SmartDataPtr<RecMdcTrackCol> newtrkCol(eventSvc, "/Event/Recon/RecMdcTrackCol");
98 if(!newtrkCol){
99 log << MSG::ERROR << "Could not find RecMdcTrackCol" << endreq;
100 return ( StatusCode::FAILURE );
101 }
102
103 int i = 0;
104 MdcCalRecTrk* rectrk;
105 RecMdcTrackCol::iterator it_trk = newtrkCol->begin();
106 for(; it_trk != newtrkCol->end(); it_trk++){
107 rectrk = new MdcCalRecTrk(m_param.particle);
108 rectrk -> setGeomSvc(m_mdcGeomSvc);
109 rectrk -> setUtilSvc(m_mdcUtilitySvc);
110 rectrk -> setRecTrk(it_trk);
111 m_rectrk.push_back(rectrk);
112
113 i++;
114 }
115// log << MSG::WARNING << "RecTrack ntrk = " << i << endreq;
116
117 return StatusCode::SUCCESS;
118}

◆ setUtilSvc()

void MdcCalEvent::setUtilSvc ( IMdcUtilitySvc * mdcUtilitySvc)
inline

Definition at line 22 of file MdcCalEvent.h.

22{ m_mdcUtilitySvc = mdcUtilitySvc; }

Referenced by setKalEvent(), and setRecEvent().


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