103 cout <<
" please use ParticleID::calculate(run) ! " << endl;
114 IDataProviderSvc* m_eventSvc;
115 Gaudi::svcLocator()->service(
"EventDataSvc", m_eventSvc,
true);
117 SmartDataPtr<Event::EventHeader> eventHeaderpid(m_eventSvc,
"/Event/EventHeader");
118 int runpid=eventHeaderpid->runNumber();
119 int eventpid=eventHeaderpid->eventNumber();
135 if(m_pidcase == 0 ) {
139 if(IsDedxInfoUsed()) {
151 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()|IsTofCInfoUsed())
175 if(IsTofCorrInfoUsed()) {
178 m_tofcorrpid->
init();
208 if(IsTofQInfoUsed()) {
217 if(IsTofEInfoUsed()&&(!IsTofCorrInfoUsed())) {
226 if(IsEmcInfoUsed()) {
235 if(IsMucInfoUsed()) {
243 if(IsMrpcInfoUsed()) {
269int ParticleID ::particleIDCalculation() {
271 bool valid = IsDedxInfoValid() || IsTofInfoValid()||IsTofEInfoValid()
272 || IsTofQInfoValid() || IsEmcInfoValid() || IsMucInfoValid()
273 || IsTofCInfoValid() || IsTofCorrInfoValid() || IsMrpcInfoValid();
275 if(!valid)
return irc;
279 for(
int i = 0; i < 5; i++) {
284 if((m_pidcase & onlyElectron()) == onlyElectron()) pidcase[0] =
true;
285 if((m_pidcase & onlyMuon()) == onlyMuon()) pidcase[1] =
true;
286 if((m_pidcase & onlyPion()) == onlyPion()) pidcase[2] =
true;
287 if((m_pidcase & onlyKaon()) == onlyKaon()) pidcase[3] =
true;
288 if((m_pidcase & onlyProton()) == onlyProton()) pidcase[4] =
true;
293 if(IsDedxInfoUsed()) {
294 if(IsDedxInfoValid()) {
296 for(
int i = 0; i < 5; i++) {
297 if(pidcase[i] && (fabs(chiDedx(i)) < m_dedxpid->chiMinCut()))
298 if(!okpid) okpid =
true;
302 for(
int i = 0; i < 5; i++) chisq[i] += chiDedx(i)*chiDedx(i);
312 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed() | IsTofCInfoUsed())
313 {
if(IsTofCInfoUsed())
315 if(IsTofCInfoValid()) {
317 for(
int i = 0; i < 5; i++) {
318 if(pidcase[i] && (fabs(chiTofC(i)) < m_tofcpid->chiMinCut()))
319 if(!okpid) okpid =
true;
323 for(
int i = 0; i < 5; i++) chisq[i] += chiTofC(i)*chiTofC(i);
328 if(IsTofInfoValid()) {
330 for(
int i = 0; i < 5; i++) {
331 if(pidcase[i] && (fabs(chiTof(i)) < m_tofpid->chiMinCut()))
332 if(!okpid) okpid =
true;
336 for(
int i = 0; i < 5; i++) chisq[i] += chiTof(i)*chiTof(i);
345 if(IsTofEInfoUsed()) {
346 if(IsTofEInfoValid()) {
348 for(
int i = 0; i < 5; i++) {
349 if(pidcase[i] && (fabs(chiTofE(i)) < m_tofepid->chiMinCut()))
350 if(!okpid) okpid =
true;
354 for(
int i = 0; i < 5; i++) chisq[i] += chiTofE(i)*chiTofE(i);
363 if(IsTofCorrInfoUsed()) {
364 if(IsTofCorrInfoValid()) {
366 for(
int i = 0; i < 5; i++) {
368 if(pidcase[i] && ( chiTofCorr(i) < 6.0 && chiTofCorr(i) > -4.0 ) )
369 if(!okpid) okpid =
true;
373 for(
int i = 0; i < 5; i++) chisq[i] += chiTofCorr(i)*chiTofCorr(i);
382 if(IsTofQInfoUsed()) {
383 if(IsTofQInfoValid()) {
385 for(
int i = 0; i < 5; i++) {
386 if(pidcase[i] && (fabs(chiTofQ(i)) < m_tofqpid->chiMinCut()))
387 if(!okpid) okpid =
true;
391 for(
int i = 0; i < 5; i++) chisq[i] += chiTofQ(i)*chiTofQ(i);
397 if(IsMucInfoUsed()) {
398 if(IsMucInfoValid()) {
400 for(
int i = 0; i < 5; i++) {
401 if(pidcase[i] && (fabs(chiMuc(i)) < m_mucpid->chiMinCut()))
402 if(!okpid) okpid =
true;
406 for(
int i = 0; i < 5; i++) chisq[i] += chiMuc(i)*chiMuc(i);
413 if(IsEmcInfoUsed()) {
414 if(IsEmcInfoValid()) {
416 for(
int i = 0; i < 5; i++) {
417 if(pidcase[i] && (fabs(chiEmc(i)) < m_emcpid->chiMinCut()))
418 if(!okpid) okpid =
true;
422 for(
int i = 0; i < 5; i++) chisq[i] += chiEmc(i)*chiEmc(i);
428 if(IsMrpcInfoUsed()) {
429 if(IsMrpcInfoValid()) {
431 for(
int i = 0; i < 5; i++) {
432 if(pidcase[i] && (fabs(chiMrpc(i)) < m_mrpcpid->chiMinCut()))
433 if(!okpid) okpid =
true;
437 for(
int i = 0; i < 5; i++) chisq[i] += chiMrpc(i)*chiMrpc(i);
443 if(m_ndof <= 0)
return irc;
446 for(
int i = 0; i < 5; i++) {
447 m_chisq[i] = chisq[i];
448 m_prob[i] = probCalculate(chisq[i], m_ndof);
void setPdfMinSigmaCut(const double pdf=4)
EvtRecTrack * PidTrk() const
int methodProbability() const
double pdfCalculate(double offset, double sigma)
void setRunNo(const double runh=8093)
double pdfMinSigmaCut() const
int methodNeuronNetwork() const
void setChiMinCut(const double chi=4)
int methodLikelihood() const
void setRecTrack(EvtRecTrack *trk)
bool IsTofEInfoValid() const
bool IsEmcInfoValid() const
int LikelihoodCalculation()
double chiTofE(int n) const
bool IsTofCorrInfoValid() const
bool IsMrpcInfoValid() const
bool IsTofCInfoValid() const
bool IsTofInfoValid() const
bool IsTofQInfoValid() const
int particleIDCalculation()
static ParticleID * instance()
bool IsDedxInfoValid() const
bool IsMucInfoValid() const
double chiTof(int n) const
double chiTofCorr(int n) const
double chiDedx(int n) const