45const double xmass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272};
75 MsgStream log(
msgSvc(), name());
77 log << MSG::INFO <<
"in initialize()" << endmsg;
81 if(service(
"THistSvc", m_thsvc).isFailure()) {
82 log << MSG::ERROR <<
"Couldn't get THistSvc" << endreq;
83 return StatusCode::FAILURE;
86 TH1F* inclphi_mass =
new TH1F(
"InclPhi_mass",
"INCLUSIVE_PHI_MASS",80,1.01,1.05);
87 inclphi_mass->GetXaxis()->SetTitle(
"M_{KK} (GeV)");
88 inclphi_mass->GetYaxis()->SetTitle(
"Nentries/0.5MeV/c^{2}");
89 if(m_thsvc->regHist(
"/DQAHist/InclPhi/InclPhi_mass", inclphi_mass).isFailure()) {
90 log << MSG::ERROR <<
"Couldn't register inclphi_mass" << endreq;
95 NTuplePtr nt1(
ntupleSvc(),
"DQAFILE/InclPhi");
96 if ( nt1 ) m_tuple1 = nt1;
98 m_tuple1 =
ntupleSvc()->book (
"DQAFILE/InclPhi1", CLID_ColumnWiseTuple,
"inclphi Ntuple");
100 status = m_tuple1->addItem (
"mphiall", m_mphiall);
101 status = m_tuple1->addItem (
"mpphiall", m_pphiall);
104 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple1) << endmsg;
105 return StatusCode::FAILURE;
108 NTuplePtr nt2(
ntupleSvc(),
"DQAFILE/InclPhi2");
109 if ( nt2 ) m_tuple2 = nt2;
111 m_tuple2 =
ntupleSvc()->book (
"DQAFILE/InclPhi2", CLID_ColumnWiseTuple,
"inclphi Ntuple");
113 status = m_tuple2->addItem (
"nkp", m_nkp);
114 status = m_tuple2->addItem (
"nkm", m_nkm);
115 status = m_tuple2->addItem (
"ncharge", m_ncharge);
116 status = m_tuple2->addItem (
"difchi0", m_difchi);
117 status = m_tuple2->addItem (
"mmphi", m_mphi);
118 status = m_tuple2->addItem (
"pphi", m_pphi);
119 status = m_tuple2->addItem (
"pk1", m_pk1);
122 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple2) << endmsg;
123 return StatusCode::FAILURE;
130 log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
131 return StatusCode::SUCCESS;
137 StatusCode sc = StatusCode::SUCCESS;
139 MsgStream log(
msgSvc(), name());
140 log << MSG::INFO <<
"in execute()" << endreq;
145 setFilterPassed(
false);
149 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
150 int run=eventHeader->runNumber();
151 int event=eventHeader->eventNumber();
158 Vint ikp, ikm, iGood;
168 for(
int i = 0; i < evtRecEvent->totalCharged(); i++){
170 if(!(*itTrk)->isMdcTrackValid())
continue;
172 if(fabs(mdcTrk->
z()) >= m_vz0cut)
continue;
173 if(mdcTrk->
r() >= m_vr0cut)
continue;
175 TotCharge += mdcTrk->
charge();
180 int nGood = iGood.size();
186 if((nGood < 2) || (TotCharge!=0))
return sc;
194 for(
int i = 0; i < nGood; i++) {
205 if(!(*itTrk)->isMdcKalTrackValid()) continue ;
212 HepLorentzVector ptrk;
213 ptrk.setPx(mdcKalTrk->
px());
214 ptrk.setPy(mdcKalTrk->
py());
215 ptrk.setPz(mdcKalTrk->
pz());
216 double p3 = ptrk.mag();
217 ptrk.setE(sqrt(p3*p3+
mk*
mk));
218 if(mdcKalTrk->
charge() >0) {
219 ikp.push_back(iGood[i]);
222 ikm.push_back(iGood[i]);
228 int nkp = ikp.size();
229 int nkm = ikm.size();
236 if(nkp < 1 || nkm <1)
return sc;
245 HepLorentzVector pphi, pTot;
249 double difchi0=99999.0;
253 for (
int i = 0; i < nkm; i++) {
254 for (
int j = 0; j < nkp; j++) {
256 pphi = pkm[i] + pkp[j];
257 m_mphiall = pphi.m();
258 m_pphiall = pphi.rho();
261 double difchi =fabs(pphi.m()-
mphi);
262 if(difchi < difchi0){
272 if (ixk1 == -1)
return sc;
276 pTot = pkm[ixk1] + pkp[ixk2];
278 m_pk1 = pkm[ixk1].m();
283 if (m_thsvc->getHist(
"/DQAHist/InclPhi/InclPhi_mass", h).isSuccess()) {
286 log << MSG::ERROR <<
"Couldn't retrieve inclphi_mass" << endreq;
295 (*(evtRecTrkCol->begin()+ikm[ixk1]))->tagKaon();
296 (*(evtRecTrkCol->begin()+ikp[ixk2]))->tagKaon();
302 (*(evtRecTrkCol->begin()+ikm[ixk1]))->setQuality(3);
303 (*(evtRecTrkCol->begin()+ikp[ixk2]))->setQuality(3);
307 setFilterPassed(
true);
309 return StatusCode::SUCCESS;
int methodProbability() const
void setChiMinCut(const double chi=4)
void setRecTrack(EvtRecTrack *trk)
void setMethod(const int method)
void identify(const int pidcase)
void usePidSys(const int pidsys)
static ParticleID * instance()
bool IsPidInfoValid() const