99 cout <<
" please use ParticleID::calculate(run) ! " << endl;
110 IDataProviderSvc* m_eventSvc;
111 Gaudi::svcLocator()->service(
"EventDataSvc", m_eventSvc,
true);
113 SmartDataPtr<Event::EventHeader> eventHeaderpid(m_eventSvc,
"/Event/EventHeader");
114 int runpid=eventHeaderpid->runNumber();
115 int eventpid=eventHeaderpid->eventNumber();
131 if(m_pidcase == 0 ) {
135 if(IsDedxInfoUsed()) {
147 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()|IsTofCInfoUsed())
173 if(IsTofCorrInfoUsed()) {
176 m_tofcorrpid->
init();
207 if(IsTofQInfoUsed()) {
216 if(IsTofEInfoUsed()&&(!IsTofCorrInfoUsed())) {
225 if(IsEmcInfoUsed()) {
234 if(IsMucInfoUsed()) {
256int ParticleID ::particleIDCalculation() {
258 bool valid = IsDedxInfoValid() || IsTofInfoValid()||IsTofEInfoValid()
259 || IsTofQInfoValid() || IsEmcInfoValid() || IsMucInfoValid()
260 || IsTofCInfoValid() || IsTofCorrInfoValid();
262 if(!valid)
return irc;
266 for(
int i = 0; i < 5; i++) {
271 if((m_pidcase & onlyElectron()) == onlyElectron()) pidcase[0] =
true;
272 if((m_pidcase & onlyMuon()) == onlyMuon()) pidcase[1] =
true;
273 if((m_pidcase & onlyPion()) == onlyPion()) pidcase[2] =
true;
274 if((m_pidcase & onlyKaon()) == onlyKaon()) pidcase[3] =
true;
275 if((m_pidcase & onlyProton()) == onlyProton()) pidcase[4] =
true;
280 if(IsDedxInfoUsed()) {
281 if(IsDedxInfoValid()) {
283 for(
int i = 0; i < 5; i++) {
284 if(pidcase[i] && (fabs(chiDedx(i)) < m_dedxpid->chiMinCut()))
285 if(!okpid) okpid =
true;
289 for(
int i = 0; i < 5; i++) chisq[i] += chiDedx(i)*chiDedx(i);
299 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed() | IsTofCInfoUsed())
300 {
if(IsTofCInfoUsed())
302 if(IsTofCInfoValid()) {
304 for(
int i = 0; i < 5; i++) {
305 if(pidcase[i] && (fabs(chiTofC(i)) < m_tofcpid->chiMinCut()))
306 if(!okpid) okpid =
true;
310 for(
int i = 0; i < 5; i++) chisq[i] += chiTofC(i)*chiTofC(i);
315 if(IsTofInfoValid()) {
317 for(
int i = 0; i < 5; i++) {
318 if(pidcase[i] && (fabs(chiTof(i)) < m_tofpid->chiMinCut()))
319 if(!okpid) okpid =
true;
323 for(
int i = 0; i < 5; i++) chisq[i] += chiTof(i)*chiTof(i);
332 if(IsTofEInfoUsed()) {
333 if(IsTofEInfoValid()) {
335 for(
int i = 0; i < 5; i++) {
336 if(pidcase[i] && (fabs(chiTofE(i)) < m_tofepid->chiMinCut()))
337 if(!okpid) okpid =
true;
341 for(
int i = 0; i < 5; i++) chisq[i] += chiTofE(i)*chiTofE(i);
350 if(IsTofCorrInfoUsed()) {
351 if(IsTofCorrInfoValid()) {
353 for(
int i = 0; i < 5; i++) {
354 if(pidcase[i] && ( chiTofCorr(i) < m_tofcorrpid->chiMaxCut() ) && ( chiTofCorr(i) > ( 0.0 - m_tofcorrpid->chiMinCut() ) ) )
356 if(!okpid) okpid =
true;
360 for(
int i = 0; i < 5; i++) chisq[i] += chiTofCorr(i)*chiTofCorr(i);
369 if(IsTofQInfoUsed()) {
370 if(IsTofQInfoValid()) {
372 for(
int i = 0; i < 5; i++) {
373 if(pidcase[i] && (fabs(chiTofQ(i)) < m_tofqpid->chiMinCut()))
374 if(!okpid) okpid =
true;
378 for(
int i = 0; i < 5; i++) chisq[i] += chiTofQ(i)*chiTofQ(i);
384 if(IsMucInfoUsed()) {
385 if(IsMucInfoValid()) {
387 for(
int i = 0; i < 5; i++) {
388 if(pidcase[i] && (fabs(chiMuc(i)) < m_mucpid->chiMinCut()))
389 if(!okpid) okpid =
true;
393 for(
int i = 0; i < 5; i++) chisq[i] += chiMuc(i)*chiMuc(i);
400 if(IsEmcInfoUsed()) {
401 if(IsEmcInfoValid()) {
403 for(
int i = 0; i < 5; i++) {
404 if(pidcase[i] && (fabs(chiEmc(i)) < m_emcpid->chiMinCut()))
405 if(!okpid) okpid =
true;
409 for(
int i = 0; i < 5; i++) chisq[i] += chiEmc(i)*chiEmc(i);
415 if(m_ndof <= 0)
return irc;
418 for(
int i = 0; i < 5; i++) {
419 m_chisq[i] = chisq[i];
420 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 setChiMaxCut(const double chi=6)
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 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