StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtAihongPid.cxx
1 /***************************************************************************
2  *
3  * $Id: StHbtAihongPid.cxx,v 1.4 2003/09/02 17:58:32 perev Exp $
4  *
5  * Author: Frank Laue, Ohio State, laue@bnl.gov
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  *
10  ***************************************************************************
11  *
12  * $Log: StHbtAihongPid.cxx,v $
13  * Revision 1.4 2003/09/02 17:58:32 perev
14  * gcc 3.2 updates + WarnOff
15  *
16  * Revision 1.3 2003/01/31 19:44:00 magestro
17  * Cleared up simple compiler warnings on i386_linux24
18  *
19  * Revision 1.2 2002/01/14 16:10:58 laue
20  * Location of PID table not hardwired anymore
21  *
22  *
23  **************************************************************************/
24 
25 #include "StHbtMaker/Infrastructure/StHbtAihongPid.h"
26 #include <Stiostream.h>
27 #include "StEventUtilities/StuProbabilityPidAlgorithm.h"
28 
29 #ifdef __ROOT__
30 ClassImp(StHbtAihongPid)
31 #endif
32 
33 
34 StHbtAihongPid* StHbtAihongPid::_instance=0;
35 
36 StHbtAihongPid* StHbtAihongPid::Instance(const char* fileName) {
37  if (_instance == 0 ) _instance = new StHbtAihongPid(fileName);
38  return _instance;
39 }
40 
41 StHbtAihongPid::StHbtAihongPid(const char* fileName) {
42  cout << " StHbtAihongPid::StHbtAihongPid() " << endl;
43  mAihongPid = new StuProbabilityPidAlgorithm() ;
44  setPidTable(fileName);
45 }
46 
47 void StHbtAihongPid::setPidTable(const char* fileName) {
48  StuProbabilityPidAlgorithm::readParametersFromFile(fileName);
49 
50 }
51 
52 void StHbtAihongPid::updateEvent(int refMult) {
53  if (refMult > 225 ) mAihongCentrality = 0.03;
54  else if (refMult > 215 ) mAihongCentrality = 0.05;
55  else if (refMult > 200 ) mAihongCentrality = 0.07;
56  else if (refMult > 180 ) mAihongCentrality = 0.10;
57  else if (refMult > 140 ) mAihongCentrality = 0.18;
58  else if (refMult > 130 ) mAihongCentrality = 0.20;
59  else if (refMult > 120 ) mAihongCentrality = 0.23;
60  else if (refMult > 115 ) mAihongCentrality = 0.24;
61  else if (refMult > 100 ) mAihongCentrality = 0.28;
62  else mAihongCentrality = 0.99;
63 }
64 
65 void StHbtAihongPid::updateTrack(int charge, double p, double eta, int nHitsDedx, double dedx) {
66  mAihongPid->processPIDAsFunction(mAihongCentrality, 0., charge, p, eta, nHitsDedx, dedx);
67 }
68 
69 StuProbabilityPidAlgorithm* StHbtAihongPid::aihongPid() {
70  return mAihongPid;
71 }
72 
73 StuProbabilityPidAlgorithm* StHbtAihongPid::aihongPid(int refMult, int charge, double p, double eta, int nHitsDedx, double dedx){
74  updateEvent(refMult);
75  updateTrack(charge, p, eta, nHitsDedx, dedx);
76  return mAihongPid;
77 }
78 
79 StuProbabilityPidAlgorithm* StHbtAihongPid::aihongPid(int charge, double p, double eta, int nHitsDedx, double dedx) {
80  updateTrack(charge, p, eta, nHitsDedx, dedx);
81  return mAihongPid;
82 }
83 
84 
85 
86