AliPhysics  9fe175b (9fe175b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnaCaloChannelAnalysis.h
Go to the documentation of this file.
1 #ifndef ALIANACALOCHANNELANALYSIS_H
2 #define ALIANACALOCHANNELANALYSIS_H
3 
21 
22 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
23  * See cxx source for full Copyright notice */
24 
25 #if !defined(__CINT__) || defined(__MAKECINT__)
26 #include <TFile.h>
27 #include <TH1F.h>
28 #include <TH2F.h>
29 #include <TF1.h>
30 #include <TROOT.h>
31 #include <TArrayD.h>
32 #include <Riostream.h>
33 #include <AliCalorimeterUtils.h>
34 #endif
35 using namespace std;
36 using std::vector;
37 using std::array;
38 
39 
40 
41 class AliAnaCaloChannelAnalysis : public TObject {
42 
43 public:
44 
45  AliAnaCaloChannelAnalysis() ; // default ctor
46  virtual ~AliAnaCaloChannelAnalysis() { ; } // virtual dtor
47  AliAnaCaloChannelAnalysis(TString period, TString pass, TString trigger, Int_t runNumber);
48 
49  void Run();
50 
51  //Setters
52  void SetExternalMergedFile(TString inputName) {fExternalFileName = inputName;}
53  void SetInputFileList(TString inputName) {fRunListFileName = inputName;}
54  void SetWorkDir(TString inputName) {fWorkdir = inputName;}
55  void SetNTrial(Int_t inputNr) {fTrial = inputNr ;}
56 
57  void AddPeriodAnalysis(Int_t criteria, Double_t nsigma, Double_t emin, Double_t emax);
58 
59 
60 protected:
61 
62  void Init();
63  TString Convert();
64  void BCAnalysis();
65  void PeriodAnalysis(Int_t criterum=7, Double_t nsigma = 4.0, Double_t emin=0.1, Double_t emax=2.0);
66 
67  TH1F* BuildHitAndEnergyMean(Int_t crit, Double_t emin = 0.1, Double_t emax=2., Double_t nsigma = 4.);
68  TH1F* BuildTimeMean(Int_t crit, Double_t emin, Double_t emax, Double_t nsigma);
69  void TestCellShapes(Int_t crit, Double_t fitemin, Double_t fitemax, Double_t nsigma =4.);
70 
71  void FlagAsDead();
72  void FlagAsBad(Int_t crit, TH1* inhisto, Double_t nsigma = 4., Int_t dnbins = 200, Double_t dmaxval = -1.);
73 
74  void SummarizeResults();
75  TH1 *BuildMeanFromGood();
76  Bool_t CheckDistribution(TH1* ratio, TH1* reference);
77  void SaveBadCellsToPDF(Int_t version, TString pdfName);
78  void PlotFlaggedCells2D(Int_t flag1,Int_t flag2=-1,Int_t flag3=-1);
79 
80 
81 
82 
83 
84  //Settings for analysed period
86  TString fPeriod;
87  TString fPass;
88  TString fTrigger;
89  Int_t fNoOfCells;
91 
92  //Genergal paths
93  TString fMergeOutput;
94  TString fAnalysisOutput;
95  TString fAnalysisInput;
96  TString fRunList;
97 
98  //
99  TString fQADirect;
100  TString fMergedFileName;
101  std::vector<TArrayD> fAnalysisVector;
102 
103  //Things to be individualized by setters
105  TString fWorkdir;
106  Int_t fTrial;
108 
109  //arrays to store information
110  Int_t *fFlag;
111 
112  //histogram settings
113  Int_t fNMaxCols;
114  Int_t fNMaxRows;
115  Int_t fNMaxColsAbs;
116  Int_t fNMaxRowsAbs;
117 
118  //Calorimeter information for the investigated runs
120 
121 private:
122  AliAnaCaloChannelAnalysis (const AliAnaCaloChannelAnalysis&); // not implemented
123  AliAnaCaloChannelAnalysis &operator=(const AliAnaCaloChannelAnalysis&); // not implemented
124 
126  ClassDef(AliAnaCaloChannelAnalysis, 1);
128 };
129 #endif
void TestCellShapes(Int_t *pflag[23040][7], Double_t fitEmin, Double_t fitEmax, Double_t Nsigma=4., Int_t compteur=1, char const *hname="hCellAmplitude", Int_t dnbins=1000)
Int_t fNMaxRows
Maximum No of rows in module (phi direction)
Int_t fTrial
Number of trial that this specific analyis is. By default '0'.
std::vector< TArrayD > fAnalysisVector
Vector of analysis information. Each place is filled with 4 doubles: version, sigma, lower, and upper energy range.
Int_t fNoOfCells
Number of cells in EMCal and DCal.
AliCalorimeterUtils * fCaloUtils
! Calorimeter information for the investigated runs
Int_t fCellStartDCal
ID of the first cell in the DCal.
TString fPass
Pass of the analyzed data.
Int_t * fFlag
! fFlag[CellID] = 0 (ok),1 (dead),2 (bad by lower),3 (bad by upper) start at 0 (cellID 0 = histobin 1...
Int_t fNMaxCols
Maximum No of colums in module (eta direction)
TString fMergeOutput
Here the merged files of a period are saved for a later analysis.
TString fMergedFileName
Filename of the .root file containing the merged runs.
void BCAnalysis(TString file, TString datapath="scratch/alicehp2/germain/QANew2", TString trigger="default", TString period="LHC15f", TString pass="pass2", Int_t trial=0)
TString fAnalysisInput
Here the .root files of each run of the period are saved.
void PeriodAnalysis(Int_t criterum=7, Double_t Nsigma=4.0, Double_t Emin=0.1, Double_t Emax=2.0, Int_t compteur=1, TString datapath="/scratch/alicehp2/germain/QANew2", TString period="LHC15f", TString pass="pass2", Int_t trial=0, TString file="none")
TString fQADirect
Dierctory in the QA.root files where the input histograms are stored.
TString fWorkdir
Directory which contains the folders fMergeOutput, fAnalysisInput and fAnalysisOutput. By default it is './'.
Double_t nsigma
void Convert(TString datapath="/scratch/alicehp2/germain/QANew2", TString fCalorimeter="EMCAL", TString period="LHC11h", TString pass="pass1_HLT", TString trigger="default")
TString fExternalFileName
If you have already a file that contains many runs merged together you can place it in fMergeOutput a...
TString fPeriod
The name of the analyzed period.
TString fTrigger
Selected trigger for the analysis.
Int_t fNMaxRowsAbs
Maximum No of rows in Calorimeter.
Int_t fNMaxColsAbs
Maximum No of colums in Calorimeter.
Analyses cell properties and identifies bad cells.
TString fAnalysisOutput
The list with bad channels and histograms are saved in this folder.
void SetInputFileList(TString inputName)
Class with utils specific to calorimeter clusters/cells.
void SetExternalMergedFile(TString inputName)
TString fRunListFileName
This is the name of the file with the run numbers to be merged, by default it's 'runList.txt'.
Int_t fCurrentRunNumber
A run number of an analyzed period. This is important for the AliCalorimeterUtils initialization...
TString fRunList
Thats the full path and name of the file which contains a list of all runs to be merged together...
void SetWorkDir(TString inputName)