45const 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;
82 if(service(
"THistSvc", m_thsvc).isFailure()) {
83 log << MSG::ERROR <<
"Couldn't get THistSvc" << endreq;
84 return StatusCode::FAILURE;
87 TH1F* inclphi_mass =
new TH1F(
"InclPhi_mass",
"INCLUSIVE_PHI_MASS",80,1.01,1.05);
88 inclphi_mass->GetXaxis()->SetTitle(
"M_{KK} (GeV)");
89 inclphi_mass->GetYaxis()->SetTitle(
"Nentries/0.5MeV/c^{2}");
90 if(m_thsvc->regHist(
"/DQAHist/InclPhi/InclPhi_mass", inclphi_mass).isFailure()) {
91 log << MSG::ERROR <<
"Couldn't register inclphi_mass" << endreq;
96 NTuplePtr nt1(
ntupleSvc(),
"DQAFILE/InclPhi");
97 if ( nt1 ) m_tuple1 = nt1;
99 m_tuple1 =
ntupleSvc()->book (
"DQAFILE/InclPhi1", CLID_ColumnWiseTuple,
"inclphi Ntuple");
101 status = m_tuple1->addItem (
"mphiall", m_mphiall);
102 status = m_tuple1->addItem (
"mpphiall", m_pphiall);
105 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple1) << endmsg;
106 return StatusCode::FAILURE;
109 NTuplePtr nt2(
ntupleSvc(),
"DQAFILE/InclPhi2");
110 if ( nt2 ) m_tuple2 = nt2;
112 m_tuple2 =
ntupleSvc()->book (
"DQAFILE/InclPhi2", CLID_ColumnWiseTuple,
"inclphi Ntuple");
114 status = m_tuple2->addItem (
"nkp", m_nkp);
115 status = m_tuple2->addItem (
"nkm", m_nkm);
116 status = m_tuple2->addItem (
"ncharge", m_ncharge);
117 status = m_tuple2->addItem (
"difchi0", m_difchi);
118 status = m_tuple2->addItem (
"mmphi", m_mphi);
119 status = m_tuple2->addItem (
"pphi", m_pphi);
120 status = m_tuple2->addItem (
"pk1", m_pk1);
123 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple2) << endmsg;
124 return StatusCode::FAILURE;
131 log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
132 return StatusCode::SUCCESS;
138 StatusCode sc = StatusCode::SUCCESS;
140 MsgStream log(
msgSvc(), name());
141 log << MSG::INFO <<
"in execute()" << endreq;
146 setFilterPassed(
false);
150 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
151 int run=eventHeader->runNumber();
152 int event=eventHeader->eventNumber();
159 Vint ikp, ikm, iGood;
169 for(
int i = 0; i < evtRecEvent->totalCharged(); i++){
171 if(!(*itTrk)->isMdcTrackValid())
continue;
173 if(fabs(mdcTrk->
z()) >= m_vz0cut)
continue;
174 if(mdcTrk->
r() >= m_vr0cut)
continue;
176 TotCharge += mdcTrk->
charge();
181 int nGood = iGood.size();
187 if((nGood < 2) || (TotCharge!=0))
return sc;
195 for(
int i = 0; i < nGood; i++) {
206 if(!(*itTrk)->isMdcKalTrackValid()) continue ;
213 HepLorentzVector
ptrk;
214 ptrk.setPx(mdcKalTrk->
px());
215 ptrk.setPy(mdcKalTrk->
py());
216 ptrk.setPz(mdcKalTrk->
pz());
219 if(mdcKalTrk->
charge() >0) {
220 ikp.push_back(iGood[i]);
223 ikm.push_back(iGood[i]);
229 int nkp = ikp.size();
230 int nkm = ikm.size();
237 if(nkp < 1 || nkm <1)
return sc;
246 HepLorentzVector pphi, pTot;
250 double difchi0=99999.0;
254 for (
int i = 0; i < nkm; i++) {
255 for (
int j = 0; j < nkp; j++) {
257 pphi = pkm[i] + pkp[j];
258 m_mphiall = pphi.m();
259 m_pphiall = pphi.rho();
262 double difchi =fabs(pphi.m()-
mphi);
263 if(difchi < difchi0){
273 if (ixk1 == -1)
return sc;
277 pTot = pkm[ixk1] + pkp[ixk2];
279 m_pk1 = pkm[ixk1].m();
284 if (m_thsvc->getHist(
"/DQAHist/InclPhi/InclPhi_mass", h).isSuccess()) {
287 log << MSG::ERROR <<
"Couldn't retrieve inclphi_mass" << endreq;
296 (*(evtRecTrkCol->begin()+ikm[ixk1]))->tagKaon();
297 (*(evtRecTrkCol->begin()+ikp[ixk2]))->tagKaon();
303 (*(evtRecTrkCol->begin()+ikm[ixk1]))->setQuality(3);
304 (*(evtRecTrkCol->begin()+ikp[ixk2]))->setQuality(3);
308 setFilterPassed(
true);
310 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