StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmcPedestalMaker.h
1 #ifndef STAR_StEmcPedestalMaker
2 #define STAR_StEmcPedestalMaker
3 
4 #include <TString.h>
5 #include <TF1.h>
6 #include <TH2.h>
7 #include <TH1.h>
8 
9 #include "StEmcCalibMaker.h"
10 #include "StEmcCalibrationMaker.h"
11 
12 #define MAXTRACK 10000
13 #define MAXBEMC 4
14 #define MAXCHANNEL 18000
15 #define MAXTOWERCHANNEL 18000
16 
18 protected:
19  TH1F* mPedestal;
20  TH1F* mRms;
21  TH1F* mChi;
22  TH1F* mStatus;
23 
24  Int_t mNPedEvents;
25  Float_t mPedInterval;
26  Int_t mLastPedTime;
27  Int_t mLastPedDate;
28  Bool_t mStarted;
29  TString mSavePath;
30  TString mTablesPath;
31  TString mLastTablePath;
32  Bool_t mSaveTables;
33  Float_t mPedDiffSaveDB;
34  Int_t mPedDiffSaveNum;
35  Float_t mPedDiffSaveMinTime;
36  Bool_t mCompareLastTableDB;
37  TString mPedCrateFilenameFormat;
38  TString mBemcStatusFilename;
39  Bool_t mUseBemcStatus;
40 
41 public:
42 
43  StEmcPedestalMaker(const Char_t *name="EmcPedestal");
44  virtual ~StEmcPedestalMaker();
45  virtual Int_t Init();
46  virtual Int_t Make();
47  virtual Int_t Finish();
48  virtual void Clear(Option_t *option="");
49 
50  Float_t getPedestal(Int_t id) const {return mPedestal->GetBinContent(id);}
51  Float_t getRms(Int_t id) const {return mRms->GetBinContent(id);}
52  Float_t getChi(Int_t id) const {return mChi->GetBinContent(id);}
53  Float_t getStatus(Int_t id) const {return mStatus->GetBinContent(id);}
54 
55  Int_t getNPedEvents() const {return mNPedEvents;}
56  void setNPedEvents(Int_t a) {mNPedEvents = a;}
57 
58  Float_t getPedInterval() const {return mPedInterval;}
59  void setPedInterval(Float_t time) {mPedInterval = time;}
60 
61  const Char_t *getSavePath() const {return mSavePath;}
62  void setSavePath(const Char_t *path) {mSavePath = path ? path : "";}
63 
64  const Char_t *getTablesPath() const {return mTablesPath;}
65  void setTablesPath(const Char_t *path) {mTablesPath = path ? path : "";}
66 
67  const Char_t *getLastTablePath() const {return mLastTablePath;}
68  void setLastTablePath(const Char_t *path) {mLastTablePath = path ? path : "";}
69 
70  Bool_t getSaveTables() const {return mSaveTables;}
71  void setSaveTables(Bool_t save) {mSaveTables = save;}
72 
73  Float_t getPedDiffSaveDB() const {return mPedDiffSaveDB;}
74  void setPedDiffSaveDB(Float_t diff) {mPedDiffSaveDB = diff;}
75 
76  Int_t getPedDiffSaveNum() const {return mPedDiffSaveNum;}
77  void setPedDiffSaveNum(Int_t num) {mPedDiffSaveNum = num;}
78 
79  Float_t getPedDiffSaveMinTime() const {return mPedDiffSaveMinTime;}
80  void setPedDiffSaveMinTime(Float_t diff) {mPedDiffSaveMinTime = diff;}
81 
82  Bool_t getCompareLastTableDB() const {return mCompareLastTableDB;}
83  void setCompareLastTableDB(Bool_t cmp) {mCompareLastTableDB = cmp;}
84 
85  const Char_t *getPedCrateFilenameFormat() const {return mPedCrateFilenameFormat;}
86  void setPedCrateFilenameFormat(const Char_t *fmt) {mPedCrateFilenameFormat = fmt ? fmt : "";}
87 
88  const Char_t *getBemcStatusFilename() const {return mBemcStatusFilename;}
89  void setBemcStatusFilename(const Char_t *name) {mBemcStatusFilename = name ? name : "";}
90 
91  Bool_t getUseBemcStatus() const {return mUseBemcStatus;}
92  void setUseBemcStatus(Bool_t use) {mUseBemcStatus = use;}
93 
94  void calcPedestals();
95  void saveToDb(const Char_t *timestamp, const Char_t *tableFilename = 0) const;
96  void saveToDb(Int_t date, Int_t time) const;
97  void savePedestals(Int_t date, Int_t time, Bool_t DB = false) const;
98  void loadPedestals(const Char_t *filename);
99 
100  ClassDef(StEmcPedestalMaker, 2)
101 };
102 
103 #endif
virtual void Clear(Option_t *option="")
User defined functions.