]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/UserTasks/CaloCellQA/AliCaloCellsQA.h
Move per-run histogram initialization at the beginning of UserExec().
[u/mrichter/AliRoot.git] / PWG4 / UserTasks / CaloCellQA / AliCaloCellsQA.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 //_________________________________________________________________________
5 // Class for bad channels & bad runs identification
6 // Author: Olga Driga (SUBATECH)
7
8 #ifndef ALICALOCELLSQA_H
9 #define ALICALOCELLSQA_H
10
11 // --- ROOT system ---
12 #include <TObjArray.h>
13 #include <TH1D.h>
14 #include <TH1F.h>
15 #include <TH2F.h>
16
17 // --- AliRoot header files ---
18 #include <AliVCaloCells.h>
19 #include <AliVCluster.h>
20
21 class AliCaloCellsQA : public TObject {
22
23 public:
24
25   // detectors
26   enum {
27     kEMCAL = 0,
28     kPHOS  = 1
29 // ,kDCAL  = 2      // not yet implemented
30   };
31
32   AliCaloCellsQA();
33   AliCaloCellsQA(Int_t nmods, Int_t det = kEMCAL, Int_t startRunNumber = 100000, Int_t endRunNumber = 200000);
34
35   virtual ~AliCaloCellsQA();
36
37   virtual void ActivateFullAnalysis();
38   virtual void InitSummaryHistograms(Int_t nbins = 400, Double_t emax = 4.,
39                                      Int_t nbinsh = 100, Double_t emaxh = 300.,
40                                      Int_t nbinst = 250, Double_t tmin = 0.4e-6, Double_t tmax = 0.85e-6);
41   virtual void InitTransientFindCurrentRun(Int_t runNumber);
42   virtual void Fill(Int_t runNumber, TObjArray *clusArray, AliVCaloCells *cells, Double_t vertexXYZ[3]);  // main method
43
44   // getters
45   virtual Int_t      GetDetector()     { return fDetector; }
46   virtual Int_t      GetNMods()        { return fNMods; }
47   virtual Double_t   GetClusElowMin()  { return fClusElowMin; }
48   virtual Double_t   GetClusEhighMin() { return fClusEhighMin; }
49   virtual Double_t   GetPi0EClusMin()  { return fPi0EClusMin; }
50   virtual Bool_t     GetFullAnalysis() { return fkFullAnalysis; }
51
52   virtual TObjArray* GetListOfHistos() { return fListOfHistos; }
53
54   // setters
55   virtual void SetClusterEnergyCuts(Double_t pi0EClusMin = 0.5, Double_t ElowMin = 0.3, Double_t EhighMin = 1.0);
56   virtual void SetBinningParameters(Int_t nbins1 = 100, Int_t nbins2 = 250, Int_t nbins3x = 200, Int_t nbins3y = 30,
57                                     Double_t xmax1 = 5., Double_t xmax2 = 0.5, Double_t xmax3 = 20.);
58
59 protected:
60
61   virtual void    Init(Int_t nmods, Int_t det, Int_t startRunNumber, Int_t endRunNumber);
62   virtual void    InitTransientMembers(Int_t run);
63   virtual void    InitHistosForRun(Int_t run);
64
65   virtual void    FillCellsInCluster(TObjArray *clusArray, AliVCaloCells *cells);
66   virtual void    FillJustCells(AliVCaloCells *cells);
67   virtual void    FillPi0Mass(TObjArray *clusArray, Double_t vertexXYZ[3]);
68
69   virtual Int_t   CheckClusterGetSM(AliVCluster* clus);
70   virtual Int_t   GetSM(Int_t absId);
71   virtual Bool_t  IsCellLocalMaximum(Int_t c, AliVCluster* clus, AliVCaloCells* cells);
72   virtual Bool_t  IsCellLocalMaximum(Int_t absId, AliVCaloCells* cells);
73   virtual void    AbsIdToSMEtaPhi(Int_t absId, Int_t &sm, Int_t &eta, Int_t &phi);
74
75 private:
76
77   AliCaloCellsQA(const AliCaloCellsQA &);
78   AliCaloCellsQA & operator = (const AliCaloCellsQA &);
79
80 private:
81
82   // changeable parameters
83   Int_t     fDetector;                  // kEMCAL or kPHOS
84   Int_t     fNMods;                     // maximum supermodule number + 1 (4 or 10)
85   Double_t  fClusElowMin;               // minimum cluster energy cut for low energy per run histograms
86   Double_t  fClusEhighMin;              // minimum cluster energy cut for high energy per run histograms
87   Double_t  fPi0EClusMin;               // minimum cluster energy cut for pi0 mass histograms
88   Bool_t    fkFullAnalysis;             // flag to activate all available histograms
89
90   // changeable binning parameters
91   Int_t     fNBinsECells;               // number of bins in hECells
92   Int_t     fNBinsPi0Mass;              // number of bins in hPi0Mass
93   Int_t     fNBinsXNCellsInCluster;     // number of bins in hNCellsInCluster, X axis
94   Int_t     fNBinsYNCellsInCluster;     // number of bins in hNCellsInCluster, Y axis
95   Double_t  fXMaxECells;                // X axis maximum in hECells
96   Double_t  fXMaxPi0Mass;               // X axis maximum in hPi0Mass
97   Double_t  fXMaxNCellsInCluster;       // X axis maximum in hNCellsInCluster
98
99   // internal parameters
100   Int_t     fRunNumbers[1000];          // already encountered runs
101   Int_t     fNRuns;                     // number of encountered runs
102   Int_t     fRI;                        //! current (cached) run index
103
104   // internal parameters, used for coding convenience
105   Int_t     fAbsIdMin;                  // minimum absId number (0/EMCAL, 1/PHOS)
106   Int_t     fAbsIdMax;                  // maximum absId number + 1
107
108   TObjArray  *fListOfHistos;            // array with all the histograms
109
110
111   /* All the histograms below are present in fListOfHistos.
112    *
113    * NOTE: strictly speaking, the transient members below are not necessary, but the
114    * caching mechanism used in this class boosts the analysis speed considerably
115    * (no searching for a histogram by its name is performed in each event).
116    */
117
118   TH1D *fhNEventsProcessedPerRun;             //! number of processed events per run
119
120   // current run histograms; X axis -- cell absId number;
121   TH1F *fhCellLocMaxNTimesInClusterElow;      //! number of times cell was local maximum in a low energy cluster
122   TH1F *fhCellLocMaxNTimesInClusterEhigh;     //! number of times cell was local maximum in a high energy cluster
123   TH1F *fhCellLocMaxETotalClusterElow;        //! total cluster energy for local maximum cell, low energy
124   TH1F *fhCellLocMaxETotalClusterEhigh;       //! total cluster energy for local maximum cell, high energy
125   TH1F *fhCellNonLocMaxNTimesInClusterElow;   //! number of times cell wasn't local maximum in a low energy cluster
126   TH1F *fhCellNonLocMaxNTimesInClusterEhigh;  //! number of times cell wasn't local maximum in a high energy cluster
127   TH1F *fhCellNonLocMaxETotalClusterElow;     //! total cluster energy for not local maximum cell, low energy
128   TH1F *fhCellNonLocMaxETotalClusterEhigh;    //! total cluster energy for not local maximum cell, high energy
129
130   // current run, per supermodule histograms; the maximum number of supermodules is 10
131   TH1F *fhECells[10];                         //! cell amplitude distribution
132   TH1F *fhPi0Mass[10][10];                    //! pi0 mass spectrum
133   TH2F *fhNCellsInCluster[10];                //! distribution of number of cells in cluster vs cluster energy
134
135   // summary histograms: cells spectra at different conditions; X axis -- cell absId number
136   TH2F *fhCellAmplitude;                      //! amplitude distribution per cell
137   TH2F *fhCellAmplitudeEhigh;                 //! amplitude distribution per cell, high energies
138   TH2F *fhCellAmplitudeNonLocMax;             //! amplitude distribution per not a local maximum cell
139   TH2F *fhCellAmplitudeEhighNonLocMax;        //! amplitude distribution per not a local maximum cell, high energies
140   TH2F *fhCellTime;                           //! time distribution per cell
141
142   ClassDef(AliCaloCellsQA,2)
143 };
144
145 #endif