StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRHICfFunction.cxx
1 /***************************************************************************
2  * Author: Seunghwan Lee
3  ***************************************************************************
4  *
5  * Description: RHICf Useful class for calibration and reconstruction
6  *
7  ***************************************************************************
8  * $Id: StRHICfFunction.cxx,v 1.0 2022/08/25 2:51:00 SeunghwanLee Exp $
9  * $Log: StRHICfFunction.cxx,v $
10  ***************************************************************************/
11 
12 #include "StRHICfFunction.h"
13 
14 StRHICfFunction::StRHICfFunction()
15 {
16  mRunType = 999;
17 }
18 
19 StRHICfFunction::~StRHICfFunction()
20 {
21 }
22 
23 int StRHICfFunction::checkRunTypeForRHICf2017(int runNum)
24 {
25  static const int starNoTL[17] = {18175022, 18175023, 18175024, 18175025, 18175026,
26  18175027, 18175029, 18175030, 18176011, 18176012,
27  18176014, 18176016, 18176017, 18176018, 18176019,
28  18176020, 18176021};
29 
30  static const int starNoTS[29] = {18176033, 18176034, 18176035, 18176040, 18176042,
31  18176043, 18177001, 18177002, 18177003, 18177005,
32  18177043, 18177046, 18177047, 18177049, 18177050,
33  18177052, 18178002, 18178003, 18178004, 18178005,
34  18178006, 18178007, 18178008, 18178009, 18178011,
35  18178012, 18178015, 18178016, 18178017};
36 
37  static const int starNoTOP[19] = {18177011, 18177012, 18177014, 18177015, 18177016,
38  18177017, 18177018, 18177019, 18177020, 18177024,
39  18177025, 18177026, 18177027, 18177028, 18177029,
40  18177031, 18177032, 18177034, 18177036};
41 
42 
43  for(int idx=0; idx<29; idx++){
44  if(idx < 17){ // for starNoTL array
45  if(starNoTL[idx] == runNum){
46  mRunType = kRHICfTL;
47  return mRunType;
48  }
49  }
50 
51  // for starNoTS array
52  if(starNoTS[idx] == runNum){
53  mRunType = kRHICfTS;
54  return mRunType;
55  }
56 
57  if(idx < 19){ // for starNoTOP array
58  if(starNoTOP[idx] == runNum){
59  mRunType = kRHICfTOP;
60  return mRunType;
61  }
62  }
63  }
64 
65  return kRHICfFatal;
66 }
67 
68 int StRHICfFunction::checkGSOBarSize(int tower)
69 {
70  if(tower==0){return kRHICfNbarSmall;}
71  else if(tower==1){return kRHICfNbarLarge;}
72  else{return kRHICfFatal;}
73 }
74 
75 float StRHICfFunction::rescaleEnergyFactor(int tower, int layer)
76 {
77  if(mRunType == 999){
78  cout << "StRHICfFunction::rescaleFactorByTower() - Not set the RunType !!!" << endl;
79  return kRHICfFatal;
80  }
81 
82  float rescaleFactor = 0.;
83 
84  // energy rescale factor by tower each runtpye.
85  static const float factorByTowerTL[2] = {1.043, 1.042};
86  static const float factorByTowerTS[2] = {1.042, 1.061};
87  static const float factorByTowerTOP[2] = {1.055, 1.067};
88 
89  // energy rescale factor by layer
90  static const float factorByLayer[2][16] = {{0.9687, 1.006, 0.9749, 1.06, 1.01,
91  0.9476, 1.069, 0.9761, 1.046, 1.055,
92  1.178, 1.349, 1.996, 2.593, 4.576,
93  4.966},
94  {0.8955, 0.8995, 1.032, 1.032, 1.082,
95  0.9758, 0.9511, 1.008, 0.999, 1.023,
96  1.011, 1.2, 2.4, 2.946, 5.13,
97  10.94}};
98 
99  if(mRunType == kRHICfTL){
100  rescaleFactor = factorByTowerTL[tower] / factorByLayer[tower][layer];
101  if(layer > 8){rescaleFactor = factorByTowerTL[tower];}
102  }
103  else if(mRunType == kRHICfTS){
104  rescaleFactor = factorByTowerTS[tower] / factorByLayer[tower][layer];
105  if(layer > 8){rescaleFactor = factorByTowerTS[tower];}
106  }
107  else if(mRunType == kRHICfTOP){
108  rescaleFactor = factorByTowerTOP[tower] / factorByLayer[tower][layer];
109  if(layer > 8){rescaleFactor = factorByTowerTOP[tower];}
110  }
111  return rescaleFactor;
112 }