StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTpcDbElectronics.hh
1 /**********************************************************************
2  *
3  * $Id: StTpcDbElectronics.hh,v 1.2 2000/02/10 01:21:46 calderon Exp $
4  *
5  * Author: Manuel Calderon de la Barca Sanchez & Brian Lasiuk Sept 13, 1999
6  *
7  **********************************************************************
8  *
9  * Description: Class interface for Electronics parameters taken from
10  * STAR TPC DB
11  *
12  **********************************************************************
13  *
14  * $Log: StTpcDbElectronics.hh,v $
15  * Revision 1.2 2000/02/10 01:21:46 calderon
16  * Switch to use StTpcDb.
17  * Coordinates checked for consistency.
18  * Fixed problems with StTrsIstream & StTrsOstream.
19  *
20  * Revision 1.1 1999/10/11 23:55:09 calderon
21  * Version with Database Access and persistent file.
22  * Not fully tested due to problems with cons, it
23  * doesn't find the local files at compile time.
24  * Yuri suggests forcing commit to work directly with
25  * files in repository.
26  *
27  *
28  **********************************************************************/
29 #ifndef ST_TPC_DB_ELECTRONICS_HH
30 #define ST_TPC_DB_ELECTRONICS_HH
31 
32 
33 
34 #include "StTpcElectronics.hh"
35 class StTpcDb;
37 public:
38  ~StTpcDbElectronics() {/* nopt */}
39 
40  static StTpcElectronics* instance();
41  static StTpcElectronics* instance(StTpcDb*);
42 
43  // Analog Electronics
44  double nominalGain() const;
45  double channelGain(int,int,int) const;
46  double channelGain(StTpcPadCoordinate&) const;
47  double samplingFrequency() const;
48  double tZero() const;
49  double tZero(int,int,int) const;
50  double tZero(StTpcPadCoordinate&) const;
51  double shapingTime() const;
52  double tau() const;
53 
54  // Digital Electronics
55  double adcConversion() const;
56  double adcConversionCharge() const;
57  int numberOfTimeBins() const;
58  int averagePedestal() const;
59  int pedestal(int,int,int,int) const;
60  int pedestal(StTpcPadCoordinate&) const;
61 
62  // Diagnostic: print out complete database
63  void print(ostream& = cout) const;
64 
65 private:
68 
69 private:
70  static StTpcElectronics* mInstance;
71  StTpcDb* gTpcDbPtr;
72 
73  double mNominalGain;
74  double mSamplingFrequency;
75  double mTZero;
76  double mShapingTime;
77  double mTau;
78 
79  double mAdcConversion;
80  double mAdcConversionCharge;
81  int mNumberOfTimeBins;
82  int mAveragePedestal;
83 };
84 
85 inline double StTpcDbElectronics::nominalGain() const {return mNominalGain;}
86 inline double StTpcDbElectronics::samplingFrequency() const {return mSamplingFrequency;}
87 inline double StTpcDbElectronics::shapingTime() const {return mShapingTime;}
88 inline double StTpcDbElectronics::tZero() const {return mTZero;}
89 inline double StTpcDbElectronics::tau() const {return mTau;}
90 inline double StTpcDbElectronics::adcConversion() const {return mAdcConversion;}
91 inline double StTpcDbElectronics::adcConversionCharge() const {return mAdcConversionCharge;}
92 inline int StTpcDbElectronics::numberOfTimeBins() const {return mNumberOfTimeBins;}
93 inline int StTpcDbElectronics::averagePedestal() const {return mAveragePedestal;}
94 #endif