]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCCalibViewer.h
Adding new class for Gain calibration (Marian, Stefan Gaertner)
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibViewer.h
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
8 ///////////////////////////////////////////////////
9 //                                               //
10 //  TPC calibration viewer/visualization class   //
11 //  use Tree for visualization                   //
12 ///////////////////////////////////////////////////
13
14 #include <TObject.h>
15 #include <TTree.h>
16 #include <TFile.h>
17 #include "AliTPCCalPad.h"
18 #include "AliTPCCalROC.h"
19 #include "TFriendElement.h"
20
21
22 class AliTPCCalibViewer : public TObject {
23 public:
24    AliTPCCalibViewer();
25    AliTPCCalibViewer(const AliTPCCalibViewer &c);
26    AliTPCCalibViewer(TTree* tree);
27    AliTPCCalibViewer(char* fileName, char* treeName = "calPads");
28    AliTPCCalibViewer &operator = (const AliTPCCalibViewer & param);
29    virtual ~AliTPCCalibViewer();
30    virtual void Delete(Option_t* option = "");
31    
32    virtual void     Draw(Option_t* opt="") { fTree->Draw(opt); }
33    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); };
34    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); };
35
36    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'
37    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'
38    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'
39    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'
40    Int_t DrawHisto1D(const char* type, Int_t sector, TVectorF& nsigma, 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
41    void SigmaCut(const char* type, Int_t sector, Float_t sigmaMax = 5, Float_t sigmaStep = 0.5, Bool_t plotMean = kTRUE, Bool_t plotMedian = kTRUE, Bool_t plotLTM = kTRUE) const;    // draws fraction of used pads over different sigma cuts
42    
43    AliTPCCalPad* GetCalPad(const char* desiredData, char* cuts = "", char* calPadName = "NoName") const;     // returns an AliTPCCalPad object containing the specified data with cuts applied
44    AliTPCCalROC* GetCalROC(const char* desiredData, UInt_t sector, char* cuts = "") const;  // returns an AliTPCCalROC object containing the specified data for sector with cuts applied
45    
46    TObjArray* GetArrayOfCalPads();
47    TObjArray* GetListOfVariables(Bool_t printList = kFALSE);
48    TObjArray* GetListOfNormalizationVariables(Bool_t printList = kFALSE);
49    
50    static void MakeTreeWithObjects(const char * fileName, TObjArray * array, const char * mapFileName = 0);
51    static void MakeTree(const char * fileName, TObjArray * array, const char * mapFileName = 0, AliTPCCalPad* outlierPad = 0, Float_t ltmFraction = 0.9);
52    
53    TFriendElement* AddReferenceTree(const char* filename, const char* treename = "calPads", const char* refname = "R");
54    TFriendElement* AddFriend(const char* treename, const char* filename) {return fTree->AddFriend(treename, filename);};
55    TFriendElement* AddFriend(TTree* tree, const char* alias, Bool_t warn=kFALSE) {return fTree->AddFriend(tree, alias, warn);};
56    TFriendElement* AddFriend(const char* treename, TFile* file) {return fTree->AddFriend(treename, file);};
57    TTree * GetTree() { return fTree;}
58
59    TString* Fit(const char* drawCommand, const char* formula, const char* cuts, Double_t & chi2, TVectorD &fitParam, TMatrixD &covMatrix);
60       
61 protected:
62    TTree* fTree;     // tree containing visualization data (e.g. written by AliTPCCalPad::MakeTree(...)
63    TFile* fFile;     // file that contains a calPads tree (e.g. written by AliTPCCalPad::MakeTree(...)
64    TObjArray* fListOfObjectsToBeDeleted;  //Objects, that will be deleted when the destructor ist called
65    Bool_t fTreeMustBeDeleted;  // decides weather the tree must be deleted in destructor or not 
66    
67    ClassDef(AliTPCCalibViewer,1)    //  TPC calibration viewer class
68 };
69
70 #endif