StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSpinDbMaker.h
1 // $Id: StSpinDbMaker.h,v 1.8 2014/08/06 11:43:40 jeromel Exp $
2 
7 #ifndef STAR_StspinDbMaker
8 #define STAR_StspinDbMaker
9 
10 #ifndef StMaker_H
11 #include "StMaker.h"
12 #endif
13 
14 #include "StSpinPool/StSpinDbMaker/cstructs/spinConstDB.hh"
15 
16 // needed DB c-structs
17 class spinDbV124_st;
18 class spinDbStar_st;
19 class spinDbBXmask_st;
20 
21 class StSpinDbMaker : public StMaker {
22  private:
23  spinDbV124_st *mTabSpinV124;
24  spinDbStar_st *mTabSpinStar;
25  spinDbBXmask_st *mTabSpinBXmask;
26 
27  // static Char_t m_VersionCVS = "$Id: StSpinDbMaker.h,v 1.8 2014/08/06 11:43:40 jeromel Exp $";
28 
29  void clearTables();
30  void requestDataBase();
31  void optimizeTables();
32  void auxilairyVariables();
33 
34  int mNFound;
35  TString mDbName;
36  int mDbDate;
37  int mNfilledBunches[SPINDbMaxRing];
38  TString mCADpolPattern;
39 
40  template <class St_T, class T_st> void getTable(TDataSet *mydb, TString tabName, T_st **outTab);
41 
42  void setDBname(TString name){ mDbName=name;}
43  int numberOfFilledBunches(enum spinDbEnum);
44 
45  public:
46  bool isPolDir(enum spinDbEnum);
47  int spin8bits[SPINDbMaxBXings];
48  int spin4bits[SPINDbMaxBXings];
49 
51  void print(int level=0);
52 
53  bool isValid(){ return mNFound==3;}
54  bool isPolDirTrans(){return isPolDir(polDirTrans);}
55  bool isPolDirLong(){return isPolDir(polDirLong);}
56 
57  int spin8usingBX48(int bx48);
58  int spin4usingBX48(int bx48);
59  int BXyellowUsingBX48(int bx48);
60 
61  int BX48offset();
62  bool isBXfilledUsingBX48(int bx48);
63  bool isMaskedUsingBX48(int bx48); // returns true _also_ if DB is empty
64 
65  int spin8usingBX7(int bx7);
66  int spin4usingBX7(int bx7);
67  int BXyellowUsingBX7(int bx7);
68  int BX7offset();
69  bool isBXfilledUsingBX7(int bx7);
70 
71  int offsetBX48minusBX7(int bx48, int bx7);
72  bool isBXfilledUsingBXyellow(int bxStar);
73  bool isBXmaskedUsingBXyellow(int bxStar);
74  //BXyellowUsingBX7() is deprecaited, use BXstar.. instead,JB
75  int numberOfFilledBunchesBlue() { return numberOfFilledBunches(blueRing); }
76 
77  int numberOfFilledBunchesYellow(){ return numberOfFilledBunches(yellRing);}
78  TString cadPolPattern() { return mCADpolPattern; }
79 
80  // added in 2009, Jan B.
81  bool isBXfilledUsingInternalBX(int bx); // w/o any bXing offsets added, only cogging included
82  const char *getV124comment();
83  int BXstarUsingBX48(int bx48);
84  int BXstarUsingBX7(int bx7);
85 
86 
87  const unsigned char *getRawV124bits();
88  const int *getBucketOffsets();
89  const int *getSpin8bits();
90 
91  StSpinDbMaker(const char *name="SpinDbMaker");
92 
93  virtual ~StSpinDbMaker();
94  virtual Int_t Init();
95  virtual Int_t Make();
96  virtual Int_t InitRun (int runumber);
97 
98  virtual const char *GetCVS() const {
99  static const char cvs[]="Tag $Name: $ $Id: StSpinDbMaker.h,v 1.8 2014/08/06 11:43:40 jeromel Exp $ built " __DATE__ " " __TIME__ ;
100  return cvs;
101  }
102 
103  ClassDef(StSpinDbMaker,0)
104 
105  };
106 
107 #endif
108 
109 // $Log: StSpinDbMaker.h,v $
110 // Revision 1.8 2014/08/06 11:43:40 jeromel
111 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
112 //
113 // Revision 1.7 2009/09/26 20:34:50 balewski
114 // additional methods added for 2009 data processing,
115 // since allignment of STAR bXing changed from yellow beam (2005) to blue (2009) the names of some methods were adjusted
116 //
117 // Revision 1.6 2006/10/24 20:19:37 balewski
118 // cleanup: - spin4 for abort gaps, drop STARbXing
119 //
120 // Revision 1.5 2006/06/08 00:37:02 balewski
121 // wrong ifdef was used
122 //
123 // Revision 1.4 2006/01/05 18:21:24 balewski
124 // added get: cadPollPatt, nFillBunch
125 // changed BXstar --> BXyellow
126 //
127 // Revision 1.3 2005/10/05 13:41:47 balewski
128 // more get-methods
129 //
130 // Revision 1.2 2005/10/03 20:40:17 balewski
131 // clenup
132 //
133 // Revision 1.1 2005/09/30 23:47:46 balewski
134 // start
135 //
bool isBXfilledUsingInternalBX(int bx)
defined only for 2005 run by CAD , based on first 4 filled bunches in both rings. Note...
bool isPolDirTrans()
true if all needed DB tables were found
Definition: StSpinDbMaker.h:54
bool isValid()
dump spinDb content for current time stamp
Definition: StSpinDbMaker.h:53
int spin4bits[SPINDbMaxBXings]
vs. STAR==yellow bXing
Definition: StSpinDbMaker.h:48
int spin8usingBX48(int bx48)
Returns true if beams are longitudinally polarized, false otherwise.
bool isBXfilledUsingBX48(int bx48)
STAR==yellow bXing=(bx48+48off)%120.
bool isBXfilledUsingBXyellow(int bxStar)
should be zero for every run
virtual Int_t InitRun(int runumber)
to access STAR-DB
int spin4usingBX48(int bx48)
8bit spin information
int spin4usingBX7(int bx7)
8bit spin information
int BXyellowUsingBX7(int bx7)
4bit spin information
int BX7offset()
bXing at STAR IP, [0,119]
void print(int level=0)
vs. STAR==yellow bXing
virtual Int_t Make()
int BXyellowUsingBX48(int bx48)
4bit spin information
StSpinDbMaker(const char *name="SpinDbMaker")
experts only
const unsigned char * getRawV124bits()
bXing at STAR IP, [0,119]
int BX48offset()
bXing at STAR IP, [0,119]
int BXstarUsingBX7(int bx7)
bXing at STAR IP, [0,119]
int spin8bits[SPINDbMaxBXings]
defined at cstructs/spinConstDB.hh
Definition: StSpinDbMaker.h:47
const int * getSpin8bits()
experts only
bool isBXfilledUsingBX7(int bx7)
STAR==yellow bXing=(bx7+7off)%120.
const int * getBucketOffsets()
experts only
bool isPolDirLong()
Returns true if beams are transversely polarized, false otherwise.
Definition: StSpinDbMaker.h:55