1) static variable were replaced by local variables and data members
[u/mrichter/AliRoot.git] / PWG4 / UserTasks / CaloCellQA / AliCaloCellsQA.h
CommitLineData
045862db 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
21class AliCaloCellsQA {
22
23public:
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 Fill(Int_t runNumber, TObjArray *clusArray, AliVCaloCells *cells, Double_t vertexXYZ[3]); // main method
42
43 // getters
44 virtual Int_t GetDetector() { return fDetector; }
45 virtual Int_t GetNMods() { return fNMods; }
46 virtual Double_t GetClusElowMin() { return fClusElowMin; }
47 virtual Double_t GetClusEhighMin() { return fClusEhighMin; }
48 virtual Double_t GetPi0EClusMin() { return fPi0EClusMin; }
49 virtual Bool_t GetFullAnalysis() { return fkFullAnalysis; }
50
51 virtual TObjArray* GetListOfHistos() { return fListOfHistos; }
52
53 // setters
54 virtual void SetClusterEnergyCuts(Double_t pi0EClusMin = 0.5, Double_t ElowMin = 0.3, Double_t EhighMin = 1.0);
55 virtual void SetBinningParameters(Int_t nbins1 = 100, Int_t nbins2 = 250, Int_t nbins3x = 200, Int_t nbins3y = 30,
56 Double_t xmax1 = 5., Double_t xmax2 = 0.5, Double_t xmax3 = 20.);
57
58protected:
59
60 virtual void Init(Int_t nmods, Int_t det, Int_t startRunNumber, Int_t endRunNumber);
61 virtual Int_t FindCurrentRunIndex(Int_t runNumber);
62 virtual void InitHistosForRun(Int_t run, Int_t ri);
63
64 virtual void FillCellsInCluster(Int_t ri, TObjArray *clusArray, AliVCaloCells *cells);
65 virtual void FillJustCells(Int_t ri, AliVCaloCells *cells);
66 virtual void FillPi0Mass(Int_t ri, TObjArray *clusArray, Double_t vertexXYZ[3]);
67
68 virtual Int_t CheckClusterGetSM(AliVCluster* clus);
69 virtual Int_t GetSM(Int_t absId);
70 virtual Bool_t IsCellLocalMaximum(Int_t c, AliVCluster* clus, AliVCaloCells* cells);
71 virtual Bool_t IsCellLocalMaximum(Int_t absId, AliVCaloCells* cells);
72 virtual void AbsIdToSMEtaPhi(Int_t absId, Int_t &sm, Int_t &eta, Int_t &phi);
73
74private:
75
76 AliCaloCellsQA(const AliCaloCellsQA &);
0d81af58 77 AliCaloCellsQA & operator = (const AliCaloCellsQA &);
045862db 78
79private:
80
81 // changeable parameters
82 Int_t fDetector; // kEMCAL or kPHOS
83 Int_t fNMods; // maximum supermodule number + 1 (4 or 10)
84 Double_t fClusElowMin; // minimum cluster energy cut for low energy per run histograms
85 Double_t fClusEhighMin; // minimum cluster energy cut for high energy per run histograms
86 Double_t fPi0EClusMin; // minimum cluster energy cut for pi0 mass histograms
87 Bool_t fkFullAnalysis; // flag to activate all available histograms
88
89 // changeable binning parameters
0d81af58 90 Int_t fNBinsECells; // number of bins in hECells
91 Int_t fNBinsPi0Mass; // number of bins in hPi0Mass
92 Int_t fNBinsXNCellsInCluster; // number of bins in hNCellsInCluster, X axis
93 Int_t fNBinsYNCellsInCluster; // number of bins in hNCellsInCluster, Y axis
94 Double_t fXMaxECells; // X axis maximum in hECells
95 Double_t fXMaxPi0Mass; // X axis maximum in hPi0Mass
96 Double_t fXMaxNCellsInCluster; // X axis maximum in hNCellsInCluster
045862db 97
f4dd0897 98 // internal parameters
99 Int_t fRunNumbers[1000]; // already encountered runs
100 Int_t fNRuns; // number of encountered runs
101 Int_t fRI; // current (cached) run index
102
045862db 103 // internal parameters, used for coding convenience
f4dd0897 104 Int_t fAbsIdMin; // minimum absId number (0/EMCAL, 1/PHOS)
105 Int_t fAbsIdMax; // maximum absId number + 1
045862db 106
f4dd0897 107 TObjArray *fListOfHistos; //! array with all the histograms
108 TH1D *fhNEventsProcessedPerRun; //! number of processed events per run
045862db 109
110 // per run histograms, X axis -- cell absId number;
111 // NOTE: the maximum number of runs to handle per analysis instance is set to 1000;
112 // this simplifies the code at expence of a small increase of memory usage
113 TH1F *fhCellLocMaxNTimesInClusterElow[1000]; //! number of times cell was local maximum in a low energy cluster
114 TH1F *fhCellLocMaxNTimesInClusterEhigh[1000]; //! number of times cell was local maximum in a high energy cluster
115 TH1F *fhCellLocMaxETotalClusterElow[1000]; //! total cluster energy for local maximum cell, low energy
116 TH1F *fhCellLocMaxETotalClusterEhigh[1000]; //! total cluster energy for local maximum cell, high energy
117 TH1F *fhCellNonLocMaxNTimesInClusterElow[1000]; //! number of times cell wasn't local maximum in a low energy cluster
118 TH1F *fhCellNonLocMaxNTimesInClusterEhigh[1000]; //! number of times cell wasn't local maximum in a high energy cluster
119 TH1F *fhCellNonLocMaxETotalClusterElow[1000]; //! total cluster energy for not local maximum cell, low energy
120 TH1F *fhCellNonLocMaxETotalClusterEhigh[1000]; //! total cluster energy for not local maximum cell, high energy
121
122 // per run, per supermodule histograms; the maximum number of supermodules is 10
123 TH1F *fhECells[1000][10]; //! cell amplitude distribution
124 TH1F *fhPi0Mass[1000][10][10]; //! pi0 mass spectrum
125 TH2F *fhNCellsInCluster[1000][10]; //! distribution of number of cells in cluster vs cluster energy
126
127 // summary histograms: cells spectra at different conditions; X axis -- cell absId number
128 TH2F *fhCellAmplitude; //! amplitude distribution per cell
129 TH2F *fhCellAmplitudeEhigh; //! amplitude distribution per cell, high energies
130 TH2F *fhCellAmplitudeNonLocMax; //! amplitude distribution per cell which is not a local maximum
131 TH2F *fhCellAmplitudeEhighNonLocMax; //! amplitude distribution per cell which is not a local maximum, high energies
132 TH2F *fhCellTime; //! time distribution per cell
133
134// ClassDef(AliCaloCellsQA,1)
135};
136
137#endif