53const double xmass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272};
76 MsgStream log(
msgSvc(), name());
78 log << MSG::INFO <<
"in initialize()" << endmsg;
84 NTuplePtr nt(
ntupleSvc(),
"DQAFILE/JsiLL");
85 if ( nt ) m_tuple = nt;
87 m_tuple =
ntupleSvc()->book(
"DQAFILE/JsiLL", CLID_ColumnWiseTuple,
"JsiLL ntuple");
89 status = m_tuple->addItem(
"runNo", m_runNo);
90 status = m_tuple->addItem(
"event", m_event);
91 status = m_tuple->addItem(
"chisq", m_chisq);
92 status = m_tuple->addItem(
"mLambda", m_mLambda);
93 status = m_tuple->addItem(
"mLambdabar", m_mLambdabar);
94 status = m_tuple->addItem(
"pLambda", m_pLambda);
95 status = m_tuple->addItem(
"pLambdabar", m_pLambdabar);
98 log << MSG::ERROR <<
"Can not book N-tuple:" << long(m_tuple) << endreq;
102 if(service(
"THistSvc", m_thsvc).isFailure()) {
103 log << MSG::ERROR <<
"Couldn't get THistSvc" << endreq;
104 return StatusCode::FAILURE;
109 TH1F* hrxy =
new TH1F(
"Rxy",
"Rxy distribution", 110, -1., 10.);
110 if(m_thsvc->regHist(
"/DQAHist/JsiLL/hrxy", hrxy).isFailure()) {
111 log << MSG::ERROR <<
"Couldn't register Rxy" << endreq;
113 TH1F* hz =
new TH1F(
"z",
"z distribution", 200, -100., 100.);
114 if(m_thsvc->regHist(
"/DQAHist/JsiLL/hz", hz).isFailure()) {
115 log << MSG::ERROR <<
"Couldn't register z" << endreq;
118 log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
119 return StatusCode::SUCCESS;
127 MsgStream log(
msgSvc(), name());
128 log << MSG::INFO <<
"in execute()" << endreq;
133 setFilterPassed(
false);
135 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
136 m_runNo=eventHeader->runNumber();
137 m_event=eventHeader->eventNumber();
138 log << MSG::DEBUG <<
"run, evtnum = "
144 log << MSG::DEBUG <<
"ncharg, nneu, tottks = "
145 << evtRecEvent->totalCharged() <<
" , "
146 << evtRecEvent->totalNeutral() <<
" , "
147 << evtRecEvent->totalTracks() <<endreq;
151 if(evtRecEvent->totalNeutral()>100) {
152 return StatusCode::SUCCESS;
155 Vint iGood, iplus, iminus;
163 Hep3Vector xorigin(0,0,0);
166 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
170 xorigin.setX(dbv[0]);
171 xorigin.setY(dbv[1]);
172 xorigin.setZ(dbv[2]);
176 for(
int i = 0; i < evtRecEvent->totalCharged(); i++){
178 if(!(*itTrk)->isMdcTrackValid())
continue;
179 if (!(*itTrk)->isMdcKalTrackValid())
continue;
182 double pch =mdcTrk->
p();
183 double x0 =mdcTrk->
x();
184 double y0 =mdcTrk->
y();
185 double z0 =mdcTrk->
z();
186 double phi0=mdcTrk->
helix(1);
187 double xv=xorigin.x();
188 double yv=xorigin.y();
189 double Rxy=fabs((x0-xv)*
cos(phi0)+(y0-yv)*
sin(phi0));
191 if(fabs(z0) >= m_vz0cut)
continue;
192 if(Rxy >= m_vr0cut)
continue;
197 if (m_thsvc->getHist(
"/DQAHist/JsiLL/hrxy", h).isSuccess()) {
200 log << MSG::ERROR <<
"Couldn't retrieve hrxy" << endreq;
202 if (m_thsvc->getHist(
"/DQAHist/JsiLL/hz", h).isSuccess()) {
205 log << MSG::ERROR <<
"Couldn't retrieve hz" << endreq;
210 nCharge += mdcTrk->
charge();
211 if (mdcTrk->
charge() > 0) {
221 int nGood = iGood.size();
222 log << MSG::DEBUG <<
"ngood, totcharge = " << nGood <<
" , " << nCharge << endreq;
223 if((nGood != 4)||(nCharge!=0)){
224 return StatusCode::SUCCESS;
234 int pidp0 = 5, pidp1 = 3, pidm0 = 5, pidm1 = 3;
236 RecMdcKalTrack *itTrkp = (*(evtRecTrkCol->begin() + iplus[0]))->mdcKalTrack();
237 RecMdcKalTrack *itTrkpip = (*(evtRecTrkCol->begin() + iplus[1]))->mdcKalTrack();
238 RecMdcKalTrack *itTrkpb = (*(evtRecTrkCol->begin() + iminus[0]))->mdcKalTrack();
239 RecMdcKalTrack *itTrkpim = (*(evtRecTrkCol->begin() + iminus[1]))->mdcKalTrack();
243 if (itTrkp->
p() < itTrkpip->
p()){
244 itTrkp = (*(evtRecTrkCol->begin() + iplus[1]))->mdcKalTrack();
245 itTrkpip = (*(evtRecTrkCol->begin() + iplus[0]))->mdcKalTrack();
249 if (itTrkpb->
p() < itTrkpim->
p()){
250 itTrkpb = (*(evtRecTrkCol->begin() + iminus[1]))->mdcKalTrack();
251 itTrkpim = (*(evtRecTrkCol->begin() + iminus[0]))->mdcKalTrack();
255 if (itTrkp->
p() < 0.7 || itTrkp->
p() >1.1)
return StatusCode::SUCCESS;
256 if (itTrkpb->
p() < 0.7 || itTrkpb->
p() >1.1)
return StatusCode::SUCCESS;
257 if (itTrkpip->
p() > 0.35)
return StatusCode::SUCCESS;
258 if (itTrkpim->
p() > 0.35)
return StatusCode::SUCCESS;
271 HepSymMatrix Evx(3, 0);
298 if(!vtxfita0->
Fit(0))
return StatusCode::SUCCESS;
304 if(!vtxfita->
Fit())
return StatusCode::SUCCESS;
312 if(!vtxfitb0->
Fit(0))
return StatusCode::SUCCESS;
319 if(!vtxfitb->
Fit())
return StatusCode::SUCCESS;
327 if(!vtxfit->
Fit(0))
return StatusCode::SUCCESS;
338 HepLorentzVector
ecms(0.034065,0.0,0.0,3.0969);
339 const Hep3Vector
u_cms = -
ecms.boostVector();
346 if(!kmfit->
Fit())
return StatusCode::SUCCESS;
347 m_chisq = kmfit->
chisq();
348 if(m_chisq > 50)
return StatusCode::SUCCESS;
349 HepLorentzVector kmf_pLambda = kmfit->
pfit(0);
350 HepLorentzVector kmf_pLambdabar = kmfit->
pfit(1);
352 kmf_pLambda.boost(
u_cms);
353 kmf_pLambdabar.boost(
u_cms);
354 m_mLambda = kmf_pLambda.m();
355 m_mLambdabar = kmf_pLambdabar.m();
356 m_pLambda = kmf_pLambda.rho();
357 m_pLambdabar = kmf_pLambdabar.rho();
359 if(fabs(m_mLambda-1.1157)>0.003||fabs(m_mLambdabar-1.1157)>0.003)
return StatusCode::SUCCESS;
370 (*(evtRecTrkCol->begin()+iplus[0]))->setPartId(pidp0);
371 (*(evtRecTrkCol->begin()+iplus[1]))->setPartId(pidp1);
372 (*(evtRecTrkCol->begin()+iminus[0]))->setPartId(pidm0);
373 (*(evtRecTrkCol->begin()+iminus[1]))->setPartId(pidm1);
379 (*(evtRecTrkCol->begin()+iplus[0]))->setQuality(0);
380 (*(evtRecTrkCol->begin()+iplus[1]))->setQuality(0);
381 (*(evtRecTrkCol->begin()+iminus[0]))->setQuality(0);
382 (*(evtRecTrkCol->begin()+iminus[1]))->setQuality(0);
387 setFilterPassed(
true);
390 return StatusCode::SUCCESS;