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() )
84 log << MSG::ERROR <<
"Couldn't get THistSvc" << endmsg;
85 return StatusCode::FAILURE;
88 TH1F* inclphi_mass =
new TH1F(
"InclPhi_mass",
"INCLUSIVE_PHI_MASS", 80, 1.01, 1.05 );
89 inclphi_mass->GetXaxis()->SetTitle(
"M_{KK} (GeV)" );
90 inclphi_mass->GetYaxis()->SetTitle(
"Nentries/0.5MeV/c^{2}" );
91 if ( m_thsvc->regHist(
"/DQAHist/InclPhi/InclPhi_mass", inclphi_mass ).isFailure() )
92 { log << MSG::ERROR <<
"Couldn't register inclphi_mass" << endmsg; }
96 NTuplePtr nt1(
ntupleSvc(),
"DQAFILE/InclPhi" );
97 if ( nt1 ) m_tuple1 = nt1;
100 m_tuple1 =
ntupleSvc()->book(
"DQAFILE/InclPhi1", CLID_ColumnWiseTuple,
"inclphi Ntuple" );
103 status = m_tuple1->addItem(
"mphiall", m_mphiall );
104 status = m_tuple1->addItem(
"mpphiall", m_pphiall );
108 log << MSG::ERROR <<
" Cannot book N-tuple:" << long( m_tuple1 ) << endmsg;
109 return StatusCode::FAILURE;
112 NTuplePtr nt2(
ntupleSvc(),
"DQAFILE/InclPhi2" );
113 if ( nt2 ) m_tuple2 = nt2;
116 m_tuple2 =
ntupleSvc()->book(
"DQAFILE/InclPhi2", CLID_ColumnWiseTuple,
"inclphi Ntuple" );
119 status = m_tuple2->addItem(
"nkp", m_nkp );
120 status = m_tuple2->addItem(
"nkm", m_nkm );
121 status = m_tuple2->addItem(
"ncharge", m_ncharge );
122 status = m_tuple2->addItem(
"difchi0", m_difchi );
123 status = m_tuple2->addItem(
"mmphi", m_mphi );
124 status = m_tuple2->addItem(
"pphi", m_pphi );
125 status = m_tuple2->addItem(
"pk1", m_pk1 );
129 log << MSG::ERROR <<
" Cannot book N-tuple:" << long( m_tuple2 ) << endmsg;
130 return StatusCode::FAILURE;
137 log << MSG::INFO <<
"successfully return from initialize()" << endmsg;
138 return StatusCode::SUCCESS;
143 StatusCode sc = StatusCode::SUCCESS;
145 MsgStream log(
msgSvc(), name() );
146 log << MSG::INFO <<
"in execute()" << endmsg;
151 setFilterPassed(
false );
155 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(),
"/Event/EventHeader" );
156 int run = eventHeader->runNumber();
157 int event = eventHeader->eventNumber();
164 Vint ikp, ikm, iGood;
174 for (
int i = 0; i < evtRecEvent->totalCharged(); i++ )
177 if ( !( *itTrk )->isMdcTrackValid() )
continue;
179 if ( fabs( mdcTrk->
z() ) >= m_vz0cut )
continue;
180 if ( mdcTrk->
r() >= m_vr0cut )
continue;
181 iGood.push_back( i );
182 TotCharge += mdcTrk->
charge();
187 int nGood = iGood.size();
193 if ( ( nGood < 2 ) || ( TotCharge != 0 ) )
return sc;
201 for (
int i = 0; i < nGood; i++ )
213 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
220 HepLorentzVector ptrk;
221 ptrk.setPx( mdcKalTrk->
px() );
222 ptrk.setPy( mdcKalTrk->
py() );
223 ptrk.setPz( mdcKalTrk->
pz() );
224 double p3 = ptrk.mag();
225 ptrk.setE( sqrt( p3 * p3 +
mk *
mk ) );
226 if ( mdcKalTrk->
charge() > 0 )
228 ikp.push_back( iGood[i] );
229 pkp.push_back( ptrk );
233 ikm.push_back( iGood[i] );
234 pkm.push_back( ptrk );
239 int nkp = ikp.size();
240 int nkm = ikm.size();
246 if ( nkp < 1 || nkm < 1 )
return sc;
255 HepLorentzVector pphi, pTot;
259 double difchi0 = 99999.0;
263 for (
int i = 0; i < nkm; i++ )
265 for (
int j = 0; j < nkp; j++ )
268 pphi = pkm[i] + pkp[j];
269 m_mphiall = pphi.m();
270 m_pphiall = pphi.rho();
273 double difchi = fabs( pphi.m() -
mphi );
274 if ( difchi < difchi0 )
285 if ( ixk1 == -1 )
return sc;
289 pTot = pkm[ixk1] + pkp[ixk2];
291 m_pk1 = pkm[ixk1].m();
296 if ( m_thsvc->getHist(
"/DQAHist/InclPhi/InclPhi_mass", h ).isSuccess() )
297 { h->Fill( pTot.m() ); }
298 else { log << MSG::ERROR <<
"Couldn't retrieve inclphi_mass" << endmsg; }
306 ( *( evtRecTrkCol->begin() + ikm[ixk1] ) )->tagKaon();
307 ( *( evtRecTrkCol->begin() + ikp[ixk2] ) )->tagKaon();
313 ( *( evtRecTrkCol->begin() + ikm[ixk1] ) )->setQuality( 3 );
314 ( *( evtRecTrkCol->begin() + ikp[ixk2] ) )->setQuality( 3 );
318 setFilterPassed(
true );
320 return StatusCode::SUCCESS;
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