00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef STSVTBADANODESMAKER_H
00023 #define STSVTBADANODESMAKER_H
00024
00025 #ifndef StMaker_H
00026 #include "StMaker.h"
00027 #endif
00028 class TFile;
00029 class TH2F;
00030 class TString;
00031
00032 class TObjectSet;
00033 class StSvtHybridCollection;
00034 class StSvtHybridData;
00035 class StSvtData;
00036 class StSvtHybridBadAnodes;
00037 class StSvtHybridPed;
00038
00039 class StSvtBadAnodesMaker : public StMaker {
00040 private:
00041 StSvtHybridData *mHybridData;
00042 StSvtData *mSvtData;
00043 StSvtHybridCollection *mSvtBadAnodes;
00044 StSvtHybridBadAnodes *mHybridBadAnodes;
00045 StSvtHybridCollection *mSvtPed;
00046 StSvtHybridCollection *mSvtRMSPed;
00047 StSvtHybridPed *mHybridPed;
00048 StSvtHybridPed *mHybridRMSPed;
00049
00050 TObjectSet *mBadAnodesSet;
00051
00052 int mEvents;
00053 int mRmsScaleFactor;
00054
00055 int NULL_ADC;
00056 int OVERLOADED_ADC;
00057 float BAD_RMS;
00058 int BAD_MEAN_PED_MIN;
00059 int BAD_MEAN_PED_MAX;
00060 float BAD_MEAN_RMS_MIN;
00061 float BAD_MEAN_RMS_MAX;
00062
00063 int NULL_ADC_THRESHOLD;
00064 int OVERLOADED_ADC_THRESHOLD;
00065 int OCCUP_THRESHOLD;
00066 int RMS_THRESHOLD;
00067
00068 float FREQ_OVERLOADED_ADC;
00069 float FREQ_NULL_ADC;
00070 float FREQ_OCCUP;
00071
00072 TH2F** mBadAnodesHist;
00073 TH1F** mBadAnodesBarrel;
00074 TH1F** mBadAnodesLadder;
00075
00076 TFile* mFile;
00077 TString* mFileName;
00078 TString* mFileNameTxt;
00079
00080 protected:
00081
00082 public:
00083 StSvtBadAnodesMaker(const char *name="SvtBadAnodes");
00084 virtual ~StSvtBadAnodesMaker();
00085 virtual Int_t Init();
00086 virtual Int_t Make();
00087 virtual Int_t Finish();
00088 virtual void Reset();
00089
00090 void setSvtData();
00091 void setPedestal();
00092 void setRMSPedestal();
00093 void setSvtBadAnodes();
00094 void bookHistograms();
00095
00096 void setBadValues(int x1, int x2, int x3);
00097 void setThresholds(int x1, int x2, int x3, int x4);
00098 void setThresholdNull(int);
00099 void setThresholdOver(int);
00100 void setThresholdOccup(int);
00101 void setThresholdRMS(int);
00102 void setFrequencies(float x1, float x2, float x3);
00103 void setFrequencyNull(float);
00104 void setFrequencyOver(float);
00105 void setFrequencyOccup(float);
00106 void setNullADC(int);
00107 void setOverloadedADC(int);
00108 void setBadRMS(float);
00109 void setBadMeanPedMin(int);
00110 void setBadMeanPedMax(int);
00111 void setBadMeanRMSMin(float);
00112 void setBadMeanRMSMax(float);
00113 void setRMSFactor(int factor){mRmsScaleFactor = factor;}
00114
00115 void setOutputFile(const char* name);
00116 void writeToFile(const char* fileName = "badAnodes.txt");
00117 void blwh2rma(int barrel, int ladder, int wafer, int hybrid,
00118 int& recBoard, int& mezz, int& mz_hyb);
00119
00120 ClassDef(StSvtBadAnodesMaker, 1)
00121 };
00122
00123 inline void StSvtBadAnodesMaker::setNullADC(int x)
00124 {NULL_ADC = x;};
00125 inline void StSvtBadAnodesMaker::setOverloadedADC(int x)
00126 {OVERLOADED_ADC = x;};
00127 inline void StSvtBadAnodesMaker::setBadRMS(float x)
00128 {BAD_RMS = x;};
00129 inline void StSvtBadAnodesMaker::setBadMeanPedMin(int x)
00130 {BAD_MEAN_PED_MIN = x;};
00131 inline void StSvtBadAnodesMaker::setBadMeanPedMax(int x)
00132 {BAD_MEAN_PED_MAX = x;};
00133 inline void StSvtBadAnodesMaker::setBadMeanRMSMin(float x)
00134 {BAD_MEAN_RMS_MIN = x;};
00135 inline void StSvtBadAnodesMaker::setBadMeanRMSMax(float x)
00136 {BAD_MEAN_RMS_MAX = x;};
00137 inline void StSvtBadAnodesMaker::setThresholds(int x1, int x2, int x3, int x4)
00138 {NULL_ADC_THRESHOLD = x1; OVERLOADED_ADC_THRESHOLD = x2;
00139 OCCUP_THRESHOLD = x3; RMS_THRESHOLD = x4;};
00140 inline void StSvtBadAnodesMaker::setThresholdNull(int x1)
00141 {NULL_ADC_THRESHOLD = x1;};
00142 inline void StSvtBadAnodesMaker::setThresholdOver(int x2)
00143 {OVERLOADED_ADC_THRESHOLD = x2;};
00144 inline void StSvtBadAnodesMaker::setThresholdOccup(int x3)
00145 {OCCUP_THRESHOLD = x3;};
00146 inline void StSvtBadAnodesMaker::setThresholdRMS(int x4)
00147 {RMS_THRESHOLD = x4;};
00148 inline void StSvtBadAnodesMaker::setFrequencies(float x1, float x2, float x3)
00149 {FREQ_NULL_ADC = x1; FREQ_OVERLOADED_ADC = x2;
00150 FREQ_OCCUP = x3;};
00151 inline void StSvtBadAnodesMaker::setFrequencyNull(float x1)
00152 {FREQ_NULL_ADC = x1;};
00153 inline void StSvtBadAnodesMaker::setFrequencyOver(float x2)
00154 {FREQ_OVERLOADED_ADC = x2;};
00155 inline void StSvtBadAnodesMaker::setFrequencyOccup(float x3)
00156 {FREQ_OCCUP = x3;};
00157
00158 #endif
00159
00160