StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSvtBadAnodesMaker.h
1 /***************************************************************************
2  *
3  * $Id: StSvtBadAnodesMaker.h,v 1.2 2009/01/26 15:01:51 fisyak Exp $
4  *
5  * Author: Marcelo Munhoz
6  ***************************************************************************
7  *
8  * Description: SVT Bad anodes Maker
9  *
10  ***************************************************************************
11  *
12  * $Log: StSvtBadAnodesMaker.h,v $
13  * Revision 1.2 2009/01/26 15:01:51 fisyak
14  * Add missing (in ROOT 5.22) forward declaration
15  *
16  * Revision 1.1 2004/02/03 20:06:28 munhoz
17  * first version of bad anode maker
18  *
19  *
20  **************************************************************************/
21 
22 #ifndef STSVTBADANODESMAKER_H
23 #define STSVTBADANODESMAKER_H
24 
25 #ifndef StMaker_H
26 #include "StMaker.h"
27 #endif
28 class TFile;
29 class TH2F;
30 class TString;
31 
32 class TObjectSet;
34 class StSvtHybridData;
35 class StSvtData;
37 class StSvtHybridPed;
38 
39 class StSvtBadAnodesMaker : public StMaker {
40  private:
41  StSvtHybridData *mHybridData;
42  StSvtData *mSvtData;
43  StSvtHybridCollection *mSvtBadAnodes;
44  StSvtHybridBadAnodes *mHybridBadAnodes;
45  StSvtHybridCollection *mSvtPed;
46  StSvtHybridCollection *mSvtRMSPed;
47  StSvtHybridPed *mHybridPed;
48  StSvtHybridPed *mHybridRMSPed;
49 
50  TObjectSet *mBadAnodesSet;
51 
52  int mEvents;
53  int mRmsScaleFactor;
54 
55  int NULL_ADC; //
56  int OVERLOADED_ADC; //
57  float BAD_RMS; // in ADC counts
58  int BAD_MEAN_PED_MIN; //
59  int BAD_MEAN_PED_MAX; //
60  float BAD_MEAN_RMS_MIN; //
61  float BAD_MEAN_RMS_MAX; //
62 
63  int NULL_ADC_THRESHOLD; //
64  int OVERLOADED_ADC_THRESHOLD; // in number of time bins
65  int OCCUP_THRESHOLD; //
66  int RMS_THRESHOLD; //
67 
68  float FREQ_OVERLOADED_ADC; //
69  float FREQ_NULL_ADC; // fraction of events
70  float FREQ_OCCUP; //
71 
72  TH2F** mBadAnodesHist;
73  TH1F** mBadAnodesBarrel;
74  TH1F** mBadAnodesLadder;
75 
76  TFile* mFile;
77  TString* mFileName;
78  TString* mFileNameTxt;
79 
80  protected:
81 
82  public:
83  StSvtBadAnodesMaker(const char *name="SvtBadAnodes");
84  virtual ~StSvtBadAnodesMaker();
85  virtual Int_t Init();
86  virtual Int_t Make();
87  virtual Int_t Finish();
88  virtual void Reset();
89 
90  void setSvtData();
91  void setPedestal();
92  void setRMSPedestal();
93  void setSvtBadAnodes();
94  void bookHistograms();
95 
96  void setBadValues(int x1, int x2, int x3);
97  void setThresholds(int x1, int x2, int x3, int x4);
98  void setThresholdNull(int);
99  void setThresholdOver(int);
100  void setThresholdOccup(int);
101  void setThresholdRMS(int);
102  void setFrequencies(float x1, float x2, float x3);
103  void setFrequencyNull(float);
104  void setFrequencyOver(float);
105  void setFrequencyOccup(float);
106  void setNullADC(int);
107  void setOverloadedADC(int);
108  void setBadRMS(float);
109  void setBadMeanPedMin(int);
110  void setBadMeanPedMax(int);
111  void setBadMeanRMSMin(float);
112  void setBadMeanRMSMax(float);
113  void setRMSFactor(int factor){mRmsScaleFactor = factor;}
114 
115  void setOutputFile(const char* name);
116  void writeToFile(const char* fileName = "badAnodes.txt");
117  void blwh2rma(int barrel, int ladder, int wafer, int hybrid,
118  int& recBoard, int& mezz, int& mz_hyb);
119 
120  ClassDef(StSvtBadAnodesMaker, 1) //StAF chain virtual base class for Makers
121 };
122 
123 inline void StSvtBadAnodesMaker::setNullADC(int x)
124 {NULL_ADC = x;};
125 inline void StSvtBadAnodesMaker::setOverloadedADC(int x)
126 {OVERLOADED_ADC = x;};
127 inline void StSvtBadAnodesMaker::setBadRMS(float x)
128 {BAD_RMS = x;};
129 inline void StSvtBadAnodesMaker::setBadMeanPedMin(int x)
130 {BAD_MEAN_PED_MIN = x;};
131 inline void StSvtBadAnodesMaker::setBadMeanPedMax(int x)
132 {BAD_MEAN_PED_MAX = x;};
133 inline void StSvtBadAnodesMaker::setBadMeanRMSMin(float x)
134 {BAD_MEAN_RMS_MIN = x;};
135 inline void StSvtBadAnodesMaker::setBadMeanRMSMax(float x)
136 {BAD_MEAN_RMS_MAX = x;};
137 inline void StSvtBadAnodesMaker::setThresholds(int x1, int x2, int x3, int x4)
138 {NULL_ADC_THRESHOLD = x1; OVERLOADED_ADC_THRESHOLD = x2;
139  OCCUP_THRESHOLD = x3; RMS_THRESHOLD = x4;};
140 inline void StSvtBadAnodesMaker::setThresholdNull(int x1)
141 {NULL_ADC_THRESHOLD = x1;};
142 inline void StSvtBadAnodesMaker::setThresholdOver(int x2)
143 {OVERLOADED_ADC_THRESHOLD = x2;};
144 inline void StSvtBadAnodesMaker::setThresholdOccup(int x3)
145 {OCCUP_THRESHOLD = x3;};
146 inline void StSvtBadAnodesMaker::setThresholdRMS(int x4)
147 {RMS_THRESHOLD = x4;};
148 inline void StSvtBadAnodesMaker::setFrequencies(float x1, float x2, float x3)
149 {FREQ_NULL_ADC = x1; FREQ_OVERLOADED_ADC = x2;
150  FREQ_OCCUP = x3;};
151 inline void StSvtBadAnodesMaker::setFrequencyNull(float x1)
152 {FREQ_NULL_ADC = x1;};
153 inline void StSvtBadAnodesMaker::setFrequencyOver(float x2)
154 {FREQ_OVERLOADED_ADC = x2;};
155 inline void StSvtBadAnodesMaker::setFrequencyOccup(float x3)
156 {FREQ_OCCUP = x3;};
157 
158 #endif
159 
160