AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliTPCCalibViewer.h
Go to the documentation of this file.
1 #ifndef ALITPCCALIBVIEWER_H
2 #define ALITPCCALIBVIEWER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 /* $Id: AliTPCCalibViewer.h,v */
7 
12 
13 class TFile;
14 class TLegend;
15 class TGraph;
16 class TH1;
17 class TH1F;
18 #include <TTree.h>
19 #include <TMatrixDfwd.h>
20 #include <TVectorDfwd.h>
21 #include <TVectorFfwd.h>
22 
23 class AliTPCCalPad;
24 class AliTPCCalROC;
25 class TFriendElement;
26 
27 
28 class AliTPCCalibViewer : public TObject {
29 public:
32  AliTPCCalibViewer(TTree *const tree);
33  AliTPCCalibViewer(const char* fileName, const char* treeName = "calPads");
35  virtual ~AliTPCCalibViewer();
36  virtual void Delete(Option_t* option = "");
37 
38  TString& GetAbbreviation() { return fAbbreviation; }
39  TString& GetAppendString() { return fAppendString; }
40  void SetAbbreviation(const Char_t *abr) { fAbbreviation = abr; }
41  void SetAppendString(const Char_t *str) { fAppendString = str; }
42 
43  virtual void Draw(Option_t* opt="") { fTree->Draw(opt); }
44  virtual Long64_t Draw(const char* varexp, const TCut& selection, Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0) { return fTree->Draw(varexp, selection, option, nentries, firstentry); };
45  virtual Long64_t Draw(const char* varexp, const char* selection, Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0) { return fTree->Draw(varexp, selection, option, nentries, firstentry); };
46 
47  const char* AddAbbreviations(const Char_t *c, Bool_t printDrawCommand = kFALSE);
48  Int_t EasyDraw(const char* drawCommand, const char* sector, const char* cuts = 0, const char* drawOptions = 0, Bool_t writeDrawCommand = kFALSE) const; // easy drawing of data, use '~' for abbreviation of '.fElements'
49  Int_t EasyDraw(const char* drawCommand, Int_t sector, const char* cuts = 0, const char* drawOptions = 0, Bool_t writeDrawCommand = kFALSE) const; // easy drawing of data, use '~' for abbreviation of '.fElements'
50  Int_t EasyDraw1D(const char* drawCommand, const char* sector, const char* cuts = 0, const char* drawOptions = 0, Bool_t writeDrawCommand = kFALSE) const; // easy drawing of data, use '~' for abbreviation of '.fElements'
51  Int_t EasyDraw1D(const char* drawCommand, Int_t sector, const char* cuts = 0, const char* drawOptions = 0, Bool_t writeDrawCommand = kFALSE) const; // easy drawing of data, use '~' for abbreviation of '.fElements'
52  void FormatHistoLabels(TH1 *histo) const; // formats title and axis labels of histo, removes '.fElements'
53 
54  Int_t DrawHisto1D(const char* drawCommand, Int_t sector, const char* cuts = 0, const char *sigmas = "2;4;6", Bool_t plotMean = kTRUE, Bool_t plotMedian = kTRUE, Bool_t plotLTM = kTRUE) const; // draws 1d histograms and superimposes mean, median, ltm and several sigma cuts
55  Int_t DrawHisto1D(const char* drawCommand, const char* sector, const char* cuts = 0, const char *sigmas = "2;4;6", Bool_t plotMean = kTRUE, Bool_t plotMedian = kTRUE, Bool_t plotLTM = kTRUE) const; // draws 1d histograms and superimposes mean, median, ltm and several sigma cuts
56  Int_t SigmaCut(const char* drawCommand, Int_t sector, const char* cuts = 0, Float_t sigmaMax = 5, Bool_t plotMean = kTRUE, Bool_t plotMedian = kTRUE, Bool_t plotLTM = kTRUE, Bool_t pm = kFALSE, const char *sigmas = "", Float_t sigmaStep = -1) const; // draws fraction of used pads over different sigma cuts
57  Int_t SigmaCutNew(const char* drawCommand, const char* sector, const char* cuts = 0, Float_t sigmaMax = 5, Bool_t plotMean = kTRUE, Bool_t plotMedian = kTRUE, Bool_t plotLTM = kTRUE, Bool_t pm = kFALSE, const char *sigmas = "", Float_t sigmaStep = -1) const; // draws fraction of used pads over different sigma cuts
58  Int_t SigmaCut(const char* drawCommand, const char* sector, const char* cuts = 0, Float_t sigmaMax = 5, Bool_t plotMean = kTRUE, Bool_t plotMedian = kTRUE, Bool_t plotLTM = kTRUE, Bool_t pm = kFALSE, const char *sigmas = "", Float_t sigmaStep = -1) const; // draws fraction of used pads over different sigma cuts
59  Int_t Integrate(const char* drawCommand, const char* sector, const char* cuts = 0, Float_t sigmaMax = 5, Bool_t plotMean = kTRUE, Bool_t plotMedian = kTRUE, Bool_t plotLTM = kTRUE, const char *sigmas = "", Float_t sigmaStep = -1) const; // draws an integrated histogram
60  Int_t Integrate(const char* drawCommand, Int_t sector, const char* cuts = 0, Float_t sigmaMax = 5, Bool_t plotMean = kTRUE, Bool_t plotMedian = kTRUE, Bool_t plotLTM = kTRUE, const char *sigmas = "", Float_t sigmaStep = -1) const; // draws an integrated histogram
61  Int_t IntegrateOld(const char* drawCommand, const char* sector, const char* cuts = 0, Float_t sigmaMax = 5, Bool_t plotMean = kTRUE, Bool_t plotMedian = kTRUE, Bool_t plotLTM = kTRUE, const char *sigmas = "", Float_t sigmaStep = -1) const; // draws an integrated histogram
62 
63  AliTPCCalPad* GetCalPadOld(const char* desiredData, const char* cuts = "", const char* calPadName = "NoName") const; // returns an AliTPCCalPad object containing the specified data with cuts applied
64  AliTPCCalPad* GetCalPad(const char* desiredData, const char* cuts = "", const char* calPadName = "NoName") const; // returns an AliTPCCalPad object containing the specified data with cuts applied
65 
66  AliTPCCalROC* GetCalROC(const char* desiredData, UInt_t sector, const char* cuts = "") const; // returns an AliTPCCalROC object containing the specified data for sector with cuts applied
67 
69  TObjArray* GetListOfVariables(Bool_t printList = kFALSE);
70  TObjArray* GetListOfNormalizationVariables(Bool_t printList = kFALSE) const;
71 
72  static void MakeTreeWithObjects(const char * fileName, const TObjArray *const array, const char * mapFileName = 0);
73  static void MakeTree(const char * fileName, TObjArray * array, const char * mapFileName = 0, AliTPCCalPad *const outlierPad = 0, Float_t ltmFraction = 0.9);
74  static void MakeTree(const char *outPutFileName, const Char_t *inputFileName, AliTPCCalPad *outlierPad = 0, Float_t ltmFraction = 0.9, const char *mapFileName = "$ALICE_ROOT/TPC/Calib/MapCalibrationObjects.root");
75  static void CreateObjectList(const Char_t *filename, TObjArray *calibObjects);
76 
77  TFriendElement* AddReferenceTree(const char* filename, const char* treename = "calPads", const char* refname = "R");
78  TFriendElement* AddFriend(const char* treename, const char* filename) {return fTree->AddFriend(treename, filename);};
79  TFriendElement* AddFriend(TTree* tree, const char* alias, Bool_t warn=kFALSE) {return fTree->AddFriend(tree, alias, warn);};
80  TFriendElement* AddFriend(const char* treename, TFile* file) {return fTree->AddFriend(treename, file);};
81  TTree * GetTree() const { return fTree;}
82  static void MakeCalPadAliases(TTree * tree);
83  TString* Fit(const char* drawCommand, const char* formula, const char* cuts, Double_t & chi2, TVectorD &fitParam, TMatrixD &covMatrix);
84 
85  //
86  // Array tools
87  //
88  static Double_t GetLTM(Int_t n, const Double_t *const array, Double_t *const sigma = 0, Double_t fraction = 0.9);
89  static Int_t GetBin(Float_t value, Int_t nbins, Double_t binLow, Double_t binUp);
90  static TH1F* SigmaCut(Int_t n, const Float_t *array, Float_t mean, Float_t sigma, Int_t nbins, Float_t binLow, Float_t binUp, Float_t sigmaMax, Float_t sigmaStep = -1, Bool_t pm = kFALSE);
91  static TH1F* SigmaCut(TH1F *const histogram, Float_t mean, Float_t sigma, Float_t sigmaMax, Float_t sigmaStep = -1, Bool_t pm = kFALSE);
92  static TH1F* Integrate(TH1F *const histogram, Float_t mean = 0, Float_t sigma = 0, Float_t sigmaMax = 0, Float_t sigmaStep = -1);
93  static TH1F* Integrate(Int_t n, const Float_t *const array, Int_t nbins, Float_t binLow, Float_t binUp, Float_t mean = 0, Float_t sigma = 0, Float_t sigmaMax = 0, Float_t sigmaStep = -1);
94 
95  static TH1F* SigmaCut(Int_t n, const Double_t *array, Double_t mean, Double_t sigma, Int_t nbins, const Double_t *xbins, Double_t sigmaMax);
96 
97 
98 
99 protected:
100  TTree* fTree;
101  TFile* fFile;
104  TString fAbbreviation;
105  TString fAppendString;
106 
107  void DrawLines(TH1F *cutHistoMean, TVectorF nsigma, TLegend *legend, Int_t color, Bool_t pm) const;
108  void DrawLines(TGraph *graph, TVectorF nsigma, TLegend *legend, Int_t color, Bool_t pm) const;
109 
110 
112  ClassDef(AliTPCCalibViewer,1) // TPC calibration viewer class
114 };
115 
116 #endif
117 
118 
119 
TString fAppendString
'.fElements', stored in a TStrig
static Int_t GetBin(Float_t value, Int_t nbins, Double_t binLow, Double_t binUp)
virtual Long64_t Draw(const char *varexp, const TCut &selection, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0)
static void MakeCalPadAliases(TTree *tree)
TFriendElement * AddFriend(const char *treename, TFile *file)
#define TObjArray
static Double_t GetLTM(Int_t n, const Double_t *const array, Double_t *const sigma=0, Double_t fraction=0.9)
void DrawLines(TH1F *cutHistoMean, TVectorF nsigma, TLegend *legend, Int_t color, Bool_t pm) const
void FormatHistoLabels(TH1 *histo) const
TFriendElement * AddFriend(TTree *tree, const char *alias, Bool_t warn=kFALSE)
TFriendElement * AddFriend(const char *treename, const char *filename)
TTree * fTree
tree containing visualization data (e.g. written by AliTPCCalPad::MakeTree(...)
Class for viewing/visualizing TPC calibration data.
Int_t Integrate(const char *drawCommand, const char *sector, const char *cuts=0, Float_t sigmaMax=5, Bool_t plotMean=kTRUE, Bool_t plotMedian=kTRUE, Bool_t plotLTM=kTRUE, const char *sigmas="", Float_t sigmaStep=-1) const
void SetAbbreviation(const Char_t *abr)
TObjArray * GetListOfNormalizationVariables(Bool_t printList=kFALSE) const
TTree * tree
const char * AddAbbreviations(const Char_t *c, Bool_t printDrawCommand=kFALSE)
Int_t SigmaCutNew(const char *drawCommand, const char *sector, const char *cuts=0, Float_t sigmaMax=5, Bool_t plotMean=kTRUE, Bool_t plotMedian=kTRUE, Bool_t plotLTM=kTRUE, Bool_t pm=kFALSE, const char *sigmas="", Float_t sigmaStep=-1) const
virtual void Draw(Option_t *opt="")
Int_t SigmaCut(const char *drawCommand, Int_t sector, const char *cuts=0, Float_t sigmaMax=5, Bool_t plotMean=kTRUE, Bool_t plotMedian=kTRUE, Bool_t plotLTM=kTRUE, Bool_t pm=kFALSE, const char *sigmas="", Float_t sigmaStep=-1) const
TObjArray * GetListOfVariables(Bool_t printList=kFALSE)
TFile * fFile
file that contains a calPads tree (e.g. written by AliTPCCalPad::MakeTree(...)
TObjArray * array
Definition: AnalyzeLaser.C:12
Int_t EasyDraw(const char *drawCommand, const char *sector, const char *cuts=0, const char *drawOptions=0, Bool_t writeDrawCommand=kFALSE) const
TString * Fit(const char *drawCommand, const char *formula, const char *cuts, Double_t &chi2, TVectorD &fitParam, TMatrixD &covMatrix)
Double_t chi2
Definition: AnalyzeLaser.C:7
virtual Long64_t Draw(const char *varexp, const char *selection, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0)
static void CreateObjectList(const Char_t *filename, TObjArray *calibObjects)
void SetAppendString(const Char_t *str)
TFriendElement * AddReferenceTree(const char *filename, const char *treename="calPads", const char *refname="R")
Bool_t fTreeMustBeDeleted
decides weather the tree must be deleted in destructor or not
TPC calibration base class for one ROC.
Definition: AliTPCCalROC.h:19
AliTPCCalROC * GetCalROC(const char *desiredData, UInt_t sector, const char *cuts="") const
AliTPCCalPad * GetCalPadOld(const char *desiredData, const char *cuts="", const char *calPadName="NoName") const
static void MakeTree(const char *fileName, TObjArray *array, const char *mapFileName=0, AliTPCCalPad *const outlierPad=0, Float_t ltmFraction=0.9)
AliTPCCalibViewer & operator=(const AliTPCCalibViewer &param)
virtual void Delete(Option_t *option="")
TObjArray * GetArrayOfCalPads()
AliTPCCalPad * GetCalPad(const char *desiredData, const char *cuts="", const char *calPadName="NoName") const
Int_t EasyDraw1D(const char *drawCommand, const char *sector, const char *cuts=0, const char *drawOptions=0, Bool_t writeDrawCommand=kFALSE) const
TString & GetAppendString()
TTree * GetTree() const
static void MakeTreeWithObjects(const char *fileName, const TObjArray *const array, const char *mapFileName=0)
Int_t IntegrateOld(const char *drawCommand, const char *sector, const char *cuts=0, Float_t sigmaMax=5, Bool_t plotMean=kTRUE, Bool_t plotMedian=kTRUE, Bool_t plotLTM=kTRUE, const char *sigmas="", Float_t sigmaStep=-1) const
Int_t DrawHisto1D(const char *drawCommand, Int_t sector, const char *cuts=0, const char *sigmas="2;4;6", Bool_t plotMean=kTRUE, Bool_t plotMedian=kTRUE, Bool_t plotLTM=kTRUE) const
TString & GetAbbreviation()
TObjArray * fListOfObjectsToBeDeleted
Objects, that will be deleted when the destructor ist called.
TString fAbbreviation
the abreviation for '.fElements'