]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDqaBlackEvents.h
Changed scripts for new TrainSetup
[u/mrichter/AliRoot.git] / TRD / AliTRDqaBlackEvents.h
CommitLineData
0f772b9f 1#ifndef ALITRDQABLACKEVENTS_H
2#define ALITRDQABLACKEVENTS_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id: AliTRDqaBlackEvents.h 23387 2008-01-17 17:25:16Z cblume $ */
7
8////////////////////////////////////////////////////////////////////////////
9// //
10// QA of black events //
11// //
12// Author: //
13// Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
14// //
15////////////////////////////////////////////////////////////////////////////
16
17#include "TObject.h"
18
19class TH1D;
20class TH2D;
27fe785b 21class TH2S;
22class TH3F;
e508dc19 23class TGraph;
24class TObjArray;
ef1860eb 25class AliTRDrawStreamOld;
48ccaa07 26class AliRawReader;
0f772b9f 27
28class AliTRDqaBlackEvents : public TObject {
29
30 public:
31
32 AliTRDqaBlackEvents();
33 AliTRDqaBlackEvents(const AliTRDqaBlackEvents &qa);
34 ~AliTRDqaBlackEvents() {}
35 AliTRDqaBlackEvents& operator = (const AliTRDqaBlackEvents& /*qa*/) { return *this; };
36
37 void Init();
38 void Reset();
987ba9a3 39 //Int_t AddEvent(AliTRDrawStream *data, AliRawReader *reader);
48ccaa07 40
41 void StartEvent();
ef1860eb 42 void AddBuffer(AliTRDrawStreamOld *data, AliRawReader * const reader);
48ccaa07 43 void FinishEvent();
44
0f772b9f 45 void Process(const char* filename);
46
47 //TH2D *GetChamberPedestal(Int_t sm, Int_t layer, Int_t stack) {return 0;}
c87495af 48 TH2D *GetChamberPedestal(Int_t det) const {return fChPed[det];}
0f772b9f 49
50 //TH2D *GetChamberNoise(Int_t sm, Int_t layer, Int_t stack) {return 0;}
c87495af 51 TH2D *GetChamberNoise(Int_t det) const {return fChNoise[det];}
0f772b9f 52
53 void SetNoiseLevel(Double_t min, Double_t max) {fMinNoise = min; fMaxNoise = max;}
9b99c029 54 void SetFitMethod(Int_t fit) {fFitType = fit;}
0f772b9f 55
e508dc19 56 void SetRefFile(const char *filename);
57
0f772b9f 58 void DrawChamber(const char *filename, Int_t det, Int_t w=700, Int_t h=400);
59 //void ScanChamber(const char *filename, Int_t first, Int_t last);
60 void DrawSm(const char *filename, Int_t sm, Int_t w=900, Int_t h=700);
61
27fe785b 62 void SetFullView(Int_t v, Int_t thresh, Int_t count) {
63 fCreateFull = v;
64 fThresh = thresh;
65 fCount = count;
66 }
67
0f772b9f 68 private:
9b99c029 69
c29b11ff 70 Int_t fnEvents; // number of events processed
27fe785b 71 Int_t fCreateFull; // flag if to create a full view
72 Int_t fThresh; // threshold to analyze MCM data
73 Int_t fCount; // minimum number of entries above threshold
74
48ccaa07 75 Int_t fRefEv; // reference event number
76
2a097c72 77 //Char_t fRefFileName[256]; // name of the file with reference distributions
78 const Char_t *fRefFileName; // name of the file with reference distributions
e508dc19 79
27fe785b 80 // geometry constants
81 enum {
82 kDET = 540,
83 kROB = 8,
84 kMCM = 16,
85 kADC = 21,
86 kTB = 30,
48ccaa07 87 kROW = 16,
e508dc19 88 kPAD = 144,
48ccaa07 89 kSM = 18,
90 kCH = 50
27fe785b 91 };
92
93 // histograms per detector
f5fd37e8 94
9b99c029 95 TH1D *fOccupancy; // how many times is a pad present in data
27fe785b 96 TH2D *fDetRob; // detector -- read out board
97
98 // histograms per chamber
99
100 TH1D *fPed[kDET]; // reconstructed pedestals distribution (on hist per chamber)
101 TH1D *fNoise[kDET]; // reconstructed noise distribution (on hist per chamber)
e508dc19 102 TH1D *fChPP[kDET]; // peak to peak for each chamber
27fe785b 103 TH1D *fNPointDist[kDET]; // distributin of the number of points
104 TH2D *fChPed[kDET]; // Some histograms
105 TH2D *fChNoise[kDET]; // Some histograms
106 TH2D *fNPoint[kDET]; // number of data points
107 TH3F *fData[kDET]; // Some histograms
108 TH1D *fSignal[kDET]; // Some histograms
109 TH2D *fnEntriesRM[kDET]; // number of entries for ROB - MCM
110 TH1D *fnEntriesRMDist[kDET]; // distribtion of number of entries per ROB-MCM
111
48ccaa07 112 // direct access to data
c87495af 113 Float_t fDataDirect[kDET][kROW][kPAD][kCH]; // data array
114 Double_t fSignalDirect[kDET][kCH]; // signal array
48ccaa07 115
e508dc19 116 // after reference subtraction
117 TH2D *fChPedRes[kDET]; // histograms after reference subtraction
118 TH2D *fChNoiseRes[kDET]; // histograms after reference subtraction
119
120 TH2D *fTBEvent; // coherent noise
121
122 TH2D *fRefHistPed; // reference distributions
123 TH2D *fRefHistNoise; // reference distributions
124
27fe785b 125 TH2S *fFullSignal[kDET*kROB*kMCM]; // one histogram per MCM
126 Short_t fFullCounter[kDET*kROB*kMCM]; // counts a number of entries with high signal
127
e508dc19 128 // error codes
129 TH1D *fErrorHC; // number of errors HC
130 TH1D *fErrorMCM; // number of errors MCM
131 TH1D *fErrorADC; // number of errors ADC
132
133 TH1D *fErrorSMHC; // number of errors in HC per SM
134 TH1D *fErrorSMMCM; // number of errors in MCM per SM
135 TH1D *fErrorSMADC; // number of errors in ADC per SM
0f772b9f 136
e508dc19 137 TH2D *fErrorLocHC[kDET]; // location of errors
138 TH2D *fErrorLocMCM[kDET]; // location
139 TH2D *fErrorLocADC[kDET]; // errors in ADC
c29b11ff 140
e508dc19 141 // error fraction
c87495af 142 TGraph *fErrorGraphHC; // HC errors
143 TGraph *fErrorGraphMCM; // MCM errors
144 TGraph *fErrorGraphADC; // ADC errors
e508dc19 145
146 TGraph *fGraphMCM; // number of strange MCMs detected
c87495af 147 TGraph *fGraphPP[3]; // number of strange points
48ccaa07 148
0f772b9f 149
c87495af 150 // mcm tracklets
151 TObjArray *fMcmTracks; // MCM tracklets
e508dc19 152
153 // problematic MCMs
c87495af 154 TH2D *fMapMCM; // map of problematic MCMs
155 TH1D *fFracMCM; // fraction of problematicc MCMs
e508dc19 156
157 // full detector view
c87495af 158 TH2D *fSMHCped; // full detector view of pedestals
159 TH2D *fSMHCerr; // full detector view of errors
160 TH2D *fSMLink[3]; // full detector view
161 TGraph *fGrLink[3]; // full detector view
48ccaa07 162
163 //TH1D *fZSsize;
164
165
e508dc19 166 // number of fired ADC channels in total and per SM
167 TGraph *fNumberADC[kSM+1];
168
169 //Int_t fChkDe
170
c87495af 171 TH1D *fNoiseTotal; // total noise
172 TH1D *fPP; // points
e508dc19 173
c87495af 174 TH1D *fSmNoiseRms[kSM]; // noise RMS
175 TH1D *fSmNoiseFit[kSM]; // noise fit
176 TH1D *fSmPP[kSM]; // points
e508dc19 177
48ccaa07 178
c87495af 179 TH1D *fEvNoDist[1000]; // event numbers
48ccaa07 180
e508dc19 181 //
0f772b9f 182 Double_t fMinNoise; // Minimum noise
183 Double_t fMaxNoise; // Maximum noise
c87495af 184 Int_t fFitType; // fit type
e508dc19 185
48ccaa07 186 // variables keeping info in one event
187 Int_t fnErrorHC[2]; // 0 good, 1 error
c87495af 188 Int_t fnErrorMCM[2]; // 0 good, 1 error
189 Int_t fnErrorADC[2]; // 0 good, 1 error
190
191 Int_t fppThresh[3]; // thresholds for storing pp
48ccaa07 192 Int_t fnPP[3]; // number of entries above the thershold
193 Int_t fnLink[3]; // links present, beaf-beaf, good
194 Int_t fnADCinSM[kSM+1]; // number of ADC channels in a SuperModule
195 //
196
197
198
e508dc19 199 // private function
200 void ReadRefHists(Int_t det);
c87495af 201 Int_t CheckMCM(Int_t index) const;
e508dc19 202
48ccaa07 203 Int_t FillBits(TH1D *hist, Int_t code, Int_t offset);
204
0f772b9f 205
821ef0a9 206 ClassDef(AliTRDqaBlackEvents,1) // QA for black events
0f772b9f 207
208};
209#endif