]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/TPCcalib/AliTPCcalibTracksGain.h
Updated Publisher Mrian)
[u/mrichter/AliRoot.git] / TPC / TPCcalib / AliTPCcalibTracksGain.h
CommitLineData
56787291 1#ifndef AliTPCCALIBTRACKSGAIN_H
2#define AliTPCCALIBTRACKSGAIN_H
3
9dcb072e 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
56787291 7#include <TChain.h>
8#include <TNamed.h>
9
10
11#include <TObjArray.h>
12#include <TH2D.h>
13#include <TVectorD.h>
3d0ad3bb 14#include <TMatrixD.h>
56787291 15
16#include <iostream>
9dcb072e 17#include <TH1F.h>
18
56787291 19using namespace std;
20
21class TTreeSRedirector;
22class TH3F;
23class TLinearFitter;
24
25class AliTPCClusterParam;
26class AliTPCParamSR;
9dcb072e 27class AliTPCCalROC;
28class AliTPCCalPad;
56787291 29class AliTPCseed;
30class AliTPCclusterMI;
31class AliTrackPointArray;
3d0ad3bb 32class TTreeStream;
9dcb072e 33class AliTPCcalibTracksCuts;
34class AliTPCFitPad;
56787291 35
36class AliTPCcalibTracksGain : public TNamed {
9dcb072e 37private:
38 class PreProcess {
39 public:
40 PreProcess(AliTPCseed* seed);
41 virtual ~PreProcess();
2617ff5b 42
9dcb072e 43 AliTPCseed* GetSeed() { return fSeed; }
44 Double_t GetAngleTrackPadrow(UInt_t segment, UInt_t padType) { return fAngleTrackPadrow[segment + 36*padType]; }
45 Double_t GetAngleTrackBeam(UInt_t segment, UInt_t padType) { return fAngleTrackBeam[segment + 36*padType]; }
46 Double_t GetMeanCharge(UInt_t segment, UInt_t padType) { return fMeanCharge[segment + 36*padType]; }
47 Double_t GetMeanZ(UInt_t segment, UInt_t padType) { return fMeanZ[segment + 36*padType]; }
48 Bool_t IsClusterAccepted(UInt_t clusterIndex) { return fAcceptedClusters[clusterIndex]; }
49
50 private:
51 AliTPCseed* fSeed; // the seed used for preprocessing
52 Double_t* fAngleTrackPadrow; // angle between the track and the padrows of one TPC pad region, calculated using a line fit through the appropriate clusters
53 Double_t* fAngleTrackBeam; // angle between the track and the beam axis, calculated using a line fit through the appropriate clusters
54 Double_t* fMeanCharge; // the mean charges for this seed (for each pad region)
55 Double_t* fMeanZ; // the mean z position for this seed (for each pad region)
56 Bool_t fAcceptedClusters[159]; // contains kFALSE for not accepted clusters, kTRUE for accepted ones (index is padrow)
57 };
58
59public:
3d0ad3bb 60 enum {
61 kShortPads = 0,
62 kMediumPads = 1,
63 kLongPads = 2
64 };
65 enum {
66 kSimpleFitter = 0,
67 kSqrtFitter = 1,
68 kLogFitter = 2
69 };
70
9dcb072e 71 AliTPCcalibTracksGain();
72 AliTPCcalibTracksGain(const AliTPCcalibTracksGain& obj);
6978ddfb 73 AliTPCcalibTracksGain(const char* name, const char* title, AliTPCcalibTracksCuts* cuts, TNamed* debugStreamPrefix = 0, AliTPCcalibTracksGain* prevIter = 0);
56787291 74 virtual ~AliTPCcalibTracksGain();
9dcb072e 75 AliTPCcalibTracksGain& operator=(const AliTPCcalibTracksGain& rhs);
76
77 static void testSeed(char* file = "/d/alice07/sma/v4-06-Rev-03/pp/0201/AliESDs.root", Int_t entry = 87, Int_t track = 0); // LOESCH MICH ODER DU WIRST UNTERGEHEN
6978ddfb 78 static void AddInfo(TChain* chain, char* debugStreamPrefix = 0, char* prevIterFileName = 0);
9dcb072e 79 Int_t AcceptTrack(AliTPCseed* track);
6978ddfb 80 void Terminate();
9dcb072e 81 //Bool_t AcceptCluster(AliTPCclusterMI* cluster);
82 void Add(AliTPCcalibTracksGain* cal);
56787291 83 void AddTrack(AliTPCseed* seed);
9dcb072e 84 void AddCluster(AliTPCclusterMI* cluster, AliTPCcalibTracksGain::PreProcess& preProc);
6978ddfb 85 void AddCluster2(AliTPCclusterMI* cluster, Float_t momenta, Float_t mdedx, Int_t padType, Float_t xcenter, TVectorD dedxQ, TVectorD dedxM, Float_t fraction, Float_t fraction2, Float_t dedge, TVectorD parY, TVectorD parZ, TVectorD meanPos);
9dcb072e 86 void Process(AliTPCseed* seed);
87 Long64_t Merge(TCollection *list);
88 void Evaluate(Bool_t robust = kFALSE, Double_t frac = -1.);
89 Int_t Evaluate(UInt_t segment, UInt_t padType, UInt_t fitType, TVectorD* fitParam = 0, TVectorD* fitError = 0, Double_t* redChi2 = 0, Bool_t robust = kFALSE, Double_t frac = -1.);
3d0ad3bb 90 void GetParameters(UInt_t segment, UInt_t padType, UInt_t fitType, TVectorD &fitParam);
91 void GetErrors(UInt_t segment, UInt_t padType, UInt_t fitType, TVectorD &fitError);
92 Double_t GetRedChi2(UInt_t segment, UInt_t padType, UInt_t fitType);
93 void GetCovarianceMatrix(UInt_t segment, UInt_t padType, UInt_t fitType, TMatrixD& covMatrix);
9dcb072e 94 AliTPCCalPad* CreateFitCalPad(UInt_t fitType, Bool_t undoTransformation = kFALSE, Bool_t normalizeToPadSize = kFALSE);
95 AliTPCCalROC* CreateFitCalROC(UInt_t sector, UInt_t fitType, Bool_t undoTransformation = kFALSE, Bool_t normalizeToPadSize = kFALSE);
96 AliTPCCalROC* CreateFitCalROC(UInt_t sector, UInt_t padType, TVectorD &fitParam, UInt_t fitType, Bool_t undoTransformation = kFALSE, Bool_t normalizeToPadSize = kFALSE);
56787291 97 AliTPCCalROC* CreateCombinedCalROC(const AliTPCCalROC* roc1, const AliTPCCalROC* roc2);
3d0ad3bb 98 TLinearFitter* GetFitter(UInt_t segment, UInt_t padType, UInt_t fitType);
9dcb072e 99 static Double_t GetPadLength(Double_t lx);
100 static Int_t GetPadType(Double_t lx);
101 void DumpTrack(AliTPCseed* track);
102 Bool_t GetDedx(AliTPCseed* track, Int_t padType, Int_t* rows);
56787291 103
9dcb072e 104 static Bool_t GetRowPad(Double_t lx, Double_t ly, Int_t& row, Int_t& pad); // just for debugging, remove me
105 UInt_t fTotalTracks; // just for debugging, remove me
106 UInt_t fAcceptedTracks; // just for debugging, remove me
107 AliTPCCalPad* fDebugCalPadRaw; // just for debugging, remove me
108 AliTPCCalPad* fDebugCalPadCorr; // just for debugging, remove me
109
110public:
111 TTreeSRedirector* fDebugStream; //! debug stream for debugging
56787291 112
9dcb072e 113 AliTPCFitPad* fSimpleFitter; // simple fitter for short pads
114 AliTPCFitPad* fSqrtFitter; // sqrt fitter for medium pads
115 AliTPCFitPad* fLogFitter; // log fitter for long pads
6978ddfb 116 AliTPCFitPad* fSingleSectorFitter; // just for debugging
9dcb072e 117
9dcb072e 118 AliTPCcalibTracksGain* fPrevIter; // the calibration object in its previous iteration (will not be owned by the new object, don't forget to delete it!)
56787291 119
9dcb072e 120 UInt_t fNShortClusters[36]; // number of clusters registered on short pads
121 UInt_t fNMediumClusters[36]; // number of clusters registered on medium pads
122 UInt_t fNLongClusters[36]; // number of clusters registered on long pads
6978ddfb 123 TObjString* fDebugStreamPrefix; // pathname of the final location of the debug stream file (may also be an xrootd directory)
9dcb072e 124 AliTPCcalibTracksCuts* fCuts; // cuts that are used for sieving the tracks used for calibration
125
126 static AliTPCParamSR* fgTPCparam; //! helper object for geometry related operations
127 static const Double_t fgkM; // value used in the transformation of the charge values for the logarithmic fitter
128 static const char* fgkDebugStreamFileName; // filename of the debug stream file
129 static const Bool_t fgkUseTotalCharge; // whether to use the cluster's total or maximum charge
56787291 130
56787291 131 ClassDef(AliTPCcalibTracksGain, 1);
132};
133
134#endif