StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTpcDbSlowControl.hh
1 /***************************************************************************
2  *
3  * $Id: StTpcDbSlowControl.hh,v 1.7 2009/11/03 14:34:19 fisyak Exp $
4  *
5  * Author: Manuel Calderon de la Barca Sanchez & Brian Lasiuk Sept 13, 1999
6  ***************************************************************************
7  *
8  * Description: Class to hold Slow Control parameters for TRS taken
9  * from the STAR TPC DB. Class implemented as Singleton
10  *
11  ***************************************************************************
12  *
13  * $Log: StTpcDbSlowControl.hh,v $
14  * Revision 1.7 2009/11/03 14:34:19 fisyak
15  * Remove default in zFromTB
16  *
17  * Revision 1.6 2008/06/20 15:00:59 fisyak
18  * move from StTrsData to StTpcRawData
19  *
20  * Revision 1.5 2003/09/02 17:59:16 perev
21  * gcc 3.2 updates + WarnOff
22  *
23  * Revision 1.4 2000/05/18 17:48:47 long
24  * re_pointing drift velocity to calibrated drift velocity
25  *
26  * Revision 1.3 2000/02/10 01:21:46 calderon
27  * Switch to use StTpcDb.
28  * Coordinates checked for consistency.
29  * Fixed problems with StTrsIstream & StTrsOstream.
30  *
31  * Revision 1.2 2000/01/10 23:11:29 lasiuk
32  * Include MACROS for compatibility with SUN CC5.0
33  *
34  * Revision 1.1 1999/10/11 23:55:09 calderon
35  * Version with Database Access and persistent file.
36  * Not fully tested due to problems with cons, it
37  * doesn't find the local files at compile time.
38  * Yuri suggests forcing commit to work directly with
39  * files in repository.
40  *
41  *
42  **************************************************************************/
43 #ifndef ST_TPC_DB_SLOW_CONTROL_HH
44 #define ST_TPC_DB_SLOW_CONTROL_HH
45 
46 #include <Stiostream.h>
47 
48 
49 #include "SystemOfUnits.h"
50 #ifndef ST_NO_NAMESPACES
51 using namespace units;
52 #endif
53 
54 #include "StTpcSlowControl.hh"
55 #include "StTpcDb/StTpcDb.h"
56 
58 public:
60 
61  static StTpcSlowControl* instance();
62  static StTpcSlowControl* instance(StTpcDb*);
63 
64  double driftVelocity(int sector) const;
65 
66  // voltage
67  double driftVoltage() const;
68 
69  double innerSectorAnodeVoltage() const;
70  double innerSectorGatingGridVoltage() const;
71  double outerSectorAnodeVoltage() const;
72  double outerSectorGatingGridVoltage() const;
73 
74  // environment
75  double hallTemperature() const;
76  double hallPressure() const;
77 
78  // Gas Gain
79  double innerSectorGasGain() const;
80  double innerSectorGasGainVzero() const;
81  double innerSectorGasGainb() const;
82 
83  double outerSectorGasGain() const;
84  double outerSectorGasGainVzero() const;
85  double outerSectorGasGainb() const;
86 
87  // Diagnostic
88  void print(ostream& os = cout) const;
89 
90 private:
93 
94 private:
95  static StTpcSlowControl* mInstance;
96  StTpcDb* gTpcDbPtr;
97 
98 // double mDriftVelocity;
99 
100 // // Environment
101 // double mHallTemperature;
102 // double mHallPressure;
103 
104 // // Voltages
105 // double mDriftVoltage;
106 
107 // double mISAnodeVoltage;
108 // double mISGatingGridVoltage;
109 // double mOSAnodeVoltage;
110 // double mOSGatingGridVoltage;
111 
112 // // Gas Gain
113 // double mISGasGain;
114 // double mISGasGainVzero;
115 // double mISGasGainb;
116 
117 // double mOSGasGain;
118 // double mOSGasGainVzero;
119 // double mOSGasGainb;
120 };
121 
122 inline double StTpcDbSlowControl::driftVelocity(int sector) const {return gTpcDbPtr->DriftVelocity(sector)*(centimeter/(second));}
123  // Voltages
124 inline double StTpcDbSlowControl::driftVoltage() const{return gTpcDbPtr->SlowControlSim()->driftVoltage()*volt;}
125 inline double StTpcDbSlowControl::innerSectorAnodeVoltage() const{return gTpcDbPtr->SlowControlSim()->innerSectorAnodeVoltage()*volt;}
126 inline double StTpcDbSlowControl::innerSectorGatingGridVoltage() const{return gTpcDbPtr->SlowControlSim()->innerSectorGatingGridV()*volt;}
127 inline double StTpcDbSlowControl::outerSectorAnodeVoltage() const{return gTpcDbPtr->SlowControlSim()->outerSectorAnodeVoltage()*volt;}
128 inline double StTpcDbSlowControl::outerSectorGatingGridVoltage() const{return gTpcDbPtr->SlowControlSim()->outerSectorGatingGridV()*volt;}
129  // Environment
130 inline double StTpcDbSlowControl::hallTemperature() const{return gTpcDbPtr->SlowControlSim()->hallTemperature();}
131 inline double StTpcDbSlowControl::hallPressure() const{return gTpcDbPtr->SlowControlSim()->hallPressure()*atmosphere;}
132  // Gas Gain
133 inline double StTpcDbSlowControl::innerSectorGasGain() const{return gTpcDbPtr->SlowControlSim()->innerSectorGasGain();}
134 inline double StTpcDbSlowControl::innerSectorGasGainVzero() const{return gTpcDbPtr->SlowControlSim()->innerSectorGasGainVzero()*volt;}
135 inline double StTpcDbSlowControl::innerSectorGasGainb() const{return gTpcDbPtr->SlowControlSim()->outerSectorGasGainb()/volt;}
136 
137 inline double StTpcDbSlowControl::outerSectorGasGain() const{return gTpcDbPtr->SlowControlSim()->outerSectorGasGain();}
138 inline double StTpcDbSlowControl::outerSectorGasGainVzero() const{return gTpcDbPtr->SlowControlSim()->outerSectorGasGainVzero()*volt;}
139 inline double StTpcDbSlowControl::outerSectorGasGainb() const{return gTpcDbPtr->SlowControlSim()->outerSectorGasGainb()/volt;}
140 
141 // inline double StTpcDbSlowControl::driftVelocity() const {return mDriftVelocity;}
142 // // Voltages
143 // inline double StTpcDbSlowControl::driftVoltage() const {return mDriftVoltage;}
144 // inline double StTpcDbSlowControl::innerSectorAnodeVoltage() const {return mISAnodeVoltage;}
145 // inline double StTpcDbSlowControl::innerSectorGatingGridVoltage() const {return mISGatingGridVoltage;}
146 // inline double StTpcDbSlowControl::outerSectorAnodeVoltage() const {return mOSAnodeVoltage;}
147 // inline double StTpcDbSlowControl::outerSectorGatingGridVoltage() const {return mOSGatingGridVoltage;}
148 // // Environment
149 // inline double StTpcDbSlowControl::hallTemperature() const {return mHallTemperature;}
150 // inline double StTpcDbSlowControl::hallPressure() const {return mHallPressure;}
151 // // Gas Gain
152 // inline double StTpcDbSlowControl::innerSectorGasGain() const {return mISGasGain;}
153 // inline double StTpcDbSlowControl::innerSectorGasGainVzero() const {return mISGasGainVzero;}
154 // inline double StTpcDbSlowControl::innerSectorGasGainb() const {return mISGasGainb;}
155 
156 // inline double StTpcDbSlowControl::outerSectorGasGain() const {return mOSGasGain;}
157 // inline double StTpcDbSlowControl::outerSectorGasGainVzero() const {return mOSGasGainVzero;}
158 // inline double StTpcDbSlowControl::outerSectorGasGainb() const {return mOSGasGainb;}
159 #endif