]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCdataQA.h
Removing the AliESDCosmicTrack.
[u/mrichter/AliRoot.git] / TPC / AliTPCdataQA.h
1 #ifndef ALITPCDATAQA_H
2 #define ALITPCDATAQA_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7
8 #include <TH1F.h>
9 class TProfile;
10 #include "AliRecoParam.h"
11
12 #include <TArray.h>
13
14 class TH2F;
15 class TTreeSRedirector;
16 class AliTPCROC;
17 class AliTPCCalROC;
18 class AliTPCRawStream;
19 class AliTPCRawStreamV3;
20 class AliRawReader;
21 class AliTPCAltroMapping;
22 class AliTPCCalPad;
23 class TMap; 
24 struct eventHeaderStruct;
25
26 class AliTPCdataQA : public TH1F {
27
28 public:
29   AliTPCdataQA();
30   AliTPCdataQA(const AliTPCdataQA &ped);
31   AliTPCdataQA(const TMap *config);
32   virtual ~AliTPCdataQA();
33
34   AliTPCdataQA& operator = (const  AliTPCdataQA &source);
35  void  DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
36  void MakeTree(const char *fname="QApad.root") const;
37
38   //
39   Bool_t ProcessEvent(AliTPCRawStream *const rawStream);
40   Bool_t ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3);
41   Bool_t ProcessEvent(AliRawReader    *const rawReader);
42   Bool_t ProcessEventOld(AliRawReader    *const rawReader);
43   Bool_t ProcessEvent(eventHeaderStruct   *const event);
44
45   void   Analyse();
46   //
47   //
48   void SetPedestal(AliTPCCalPad *const pedestalCal){ fPedestal = pedestalCal;}
49   void SetNoise(AliTPCCalPad *const noiseCal){ fNoise = noiseCal;}
50
51   // DQM methods
52   void FillOccupancyProfile();
53   void ResetProfiles();
54
55
56   AliTPCCalPad *GetNoThreshold() const { return fNoThreshold;}
57   AliTPCCalPad *GetMaxCharge() const { return fMaxCharge;}
58   AliTPCCalPad *GetMeanCharge() const { return fMeanCharge;}
59   AliTPCCalPad *GetNLocalMaxima() const { return fNLocalMaxima;}
60   AliTPCCalPad *GetOverThreshold10() const { return fOverThreshold10;}
61   AliTPCCalPad *GetOverThreshold20() const { return fOverThreshold20;}
62   AliTPCCalPad *GetOverThreshold30() const { return fOverThreshold30;}
63   AliTPCCalPad *GetNTimeBins() const { return fNTimeBins;}
64   AliTPCCalPad *GetNPads() const { return fNPads;}
65   AliTPCCalPad *GetTimePosition() const { return fTimePosition;}
66   TProfile* GetHistQVsTimeSideA()    const {return fHistQVsTimeSideA;}
67   TProfile* GetHistQVsTimeSideC()    const {return fHistQVsTimeSideC;}
68   TProfile* GetHistQMaxVsTimeSideA() const {return fHistQMaxVsTimeSideA;}
69   TProfile* GetHistQMaxVsTimeSideC() const {return fHistQMaxVsTimeSideC;}
70   TH1F*     GetHistOccupancyVsEventConst() const {return fHistOccupancyVsEvent;}
71   TH1F*     GetHistNclustersVsEventConst() const {return fHistNclustersVsEvent;}
72   TH1F*     GetHistOccupancyVsEvent();
73   TH1F*     GetHistNclustersVsEvent();
74
75   // DQM output
76   TProfile* GetHistOccVsSector()  const { return fHistOccVsSector; }
77   TProfile* GetHistQVsSector()    const { return fHistQVsSector; }
78   TProfile* GetHistQmaxVsSector() const { return fHistQmaxVsSector; }
79
80   //
81   AliTPCAltroMapping **GetAltroMapping() const { return fMapping; };
82   void  SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
83   //
84   //
85   Int_t  GetFirstTimeBin() const { return fFirstTimeBin; }
86   Int_t  GetLastTimeBin()  const { return fLastTimeBin;  }
87   Int_t  GetAdcMin()       const { return fAdcMin;       }
88   Int_t  GetAdcMax()       const { return fAdcMax;       }
89   Int_t  GetEventCounter() const { return fEventCounter; }
90   Bool_t GetIsAnalysed()   const { return fIsAnalysed;   }
91   Int_t  GetMaxEvents()      const { return fMaxEvents;     }
92   Int_t  GetEventsPerBin()   const { return fEventsPerBin;  }
93   Int_t  GetSignalCounter()  const { return fSignalCounter; }
94   Int_t  GetClusterCounter() const { return fClusterCounter;}
95
96   // DQM getter
97   Bool_t    GetIsDQM() const { return fIsDQM; }
98
99   void  SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;}  // Set time bin range that is used for the pedestal calibration
100   void  SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; }  // Set adc range for the pedestal calibration
101   void  SetMaxEvents   (Int_t value) { fMaxEvents = value; }
102   void  SetEventsPerBin(Int_t value) { fEventsPerBin = value; }
103   
104   // DQM setter
105   void  SetIsDQM(Bool_t value) { fIsDQM = value; }
106
107 private:
108   Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
109                const Int_t iTimeBin, Float_t signal);
110   void  FindLocalMaxima(const Int_t iSector);
111
112   void MakeArrays();                // Create arrays for random data acces
113   void CleanArrays();               // Clean arrays for random data acces
114   void SetExpandDigit(const Int_t iRow, Int_t iPad, Int_t iTimeBin, 
115                       const Float_t signal); // Fill arrays with signals
116   void GetPadAndTimeBin(Int_t bin, Int_t& iPad, Int_t& iTimeBin); // Get pad and time bin corresponding to the 1d bin
117   Float_t GetQ(const Float_t* adcArray, const Int_t time,
118                const Int_t pad, const Int_t maxTimeBins, 
119                Int_t& timeMin,Int_t& timeMax,Int_t& padMin,Int_t& padMax) const;
120   void UpdateEventHistograms();
121
122   Int_t fFirstTimeBin;              //  First Time bin needed for analysis
123   Int_t fLastTimeBin;               //  Last Time bin needed for analysis
124   Int_t fAdcMin;                    //  min adc channel of pedestal value
125   Int_t fAdcMax;                    //  max adc channel of pedestal value
126
127   AliTPCAltroMapping **fMapping;    //! Altro Mapping object
128   //
129   //
130   AliTPCCalPad * fPedestal;         //! option to set pedestal cal object
131   AliTPCCalPad * fNoise;            //! option to set noise cal object
132   AliTPCCalPad * fNLocalMaxima;     // local maximas found
133   AliTPCCalPad * fMaxCharge;        // max charge
134   AliTPCCalPad * fMeanCharge;       // mean charge
135   AliTPCCalPad * fNoThreshold;      // number of digits
136   AliTPCCalPad * fNTimeBins;        // timebins width of cluster
137   AliTPCCalPad * fNPads;            // pads with of cluster
138   AliTPCCalPad * fTimePosition;     // Time position of local maximum
139   AliTPCCalPad * fOverThreshold10;  //! local maxima with qMax over threshold
140   AliTPCCalPad * fOverThreshold20;  //! local maxima with qMax over threshold
141   AliTPCCalPad * fOverThreshold30;  //! local maxima with qMax over threshold
142
143   TProfile* fHistQVsTimeSideA;      // Q vs time (side A)
144   TProfile* fHistQVsTimeSideC;      // Q vs time (side C)
145   TProfile* fHistQMaxVsTimeSideA;   // QMax vs time (side A)
146   TProfile* fHistQMaxVsTimeSideC;   // QMax vs time (side C)
147
148   TH1F* fHistOccupancyVsEvent;      // Occupancy vs event number (~time)
149   TH1F* fHistNclustersVsEvent;      // Nclusters vs event number (~time)
150
151   Int_t   fEventCounter;            // event Counter
152   Bool_t  fIsAnalysed;              // Set to true after Analyse has been called
153
154   Int_t fMaxEvents;                 // Max events for event histograms
155   Int_t fEventsPerBin;              // Events per bin for event histograms
156   Int_t fSignalCounter;             // Signal counter
157   Int_t fClusterCounter;            // Cluster counter
158   //
159   //  Expand buffer
160   //
161   Float_t** fAllBins;              //! array for digit using random access
162   Int_t**   fAllSigBins;           //! array of pointers to the indexes over threshold
163   Int_t*    fAllNSigBins;          //! 
164   Int_t fRowsMax;                  //!  Maximum number of time bins
165   Int_t fPadsMax;                  //!  Maximum number of time bins
166   Int_t fTimeBinsMax;              //!  Maximum number of time bins
167
168   // DQM variables
169   Bool_t fIsDQM;                   //!  Is DQM -> Simple output (no 2D!)
170   TProfile* fHistOccVsSector;      //!  Occ vs sector (for DQM only)
171   TProfile* fHistQVsSector;        //!  Q vs sector (for DQM only)
172   TProfile* fHistQmaxVsSector;     //!  QMax vs sector (for DQM only)
173   TArrayD* fOccVec;                //!  Occupancy help counter for DQM
174   TArrayD* fOccMaxVec;             //!  Occupancy help normlization for DQM
175   
176
177   ClassDef(AliTPCdataQA, 5)  // Implementation of the TPC Raw QA
178 };
179
180
181
182 #endif
183