]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/Correlations/JCORRAN/AliJCard.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / Correlations / JCORRAN / AliJCard.h
1 //=================================================
2 // AliJCard.h
3 // last modified FK 6.NOV 2009
4 //=================================================
5
6 #ifndef ALIJCARD_H
7 #define ALIJCARD_H
8
9 #include <TObject.h>
10
11 #include <iostream>
12 #include <fstream>
13 #include <stdlib.h>
14 #include <stdio.h>
15 #include <iomanip>
16
17 #include <string.h>
18 #include <TString.h>
19 #include <TVector.h>
20 #include <TMath.h>
21 #include <TObjArray.h>
22 #include <TObjString.h>
23 #include <TFile.h>
24 #include <TF1.h>
25 #include <TH1D.h>
26 #include <TH2D.h>
27 #include <vector>
28 #include <TVector3.h>
29 #include <THashList.h>
30 #include <TNamed.h>
31
32 #include "AliJConst.h"
33 #include "AliJBaseCard.h"
34
35 class AliJBaseTrack;
36 #include "AliJPhoton.h"
37 class AliJTrack;
38
39 using namespace std;
40
41
42 class AliJCard : public AliJBaseCard {
43
44     public:
45
46         AliJCard(); // constructor
47         AliJCard(const char *filename); // constructor
48         AliJCard(const AliJCard& obj);
49         AliJCard& operator=(const AliJCard& obj);
50
51         virtual ~AliJCard();
52
53         void MakeFastCorrTypeIndex();
54
55         void   PrintOut(); 
56
57         float  Get(TString keyword, int VectorComponent=0){ return AliJBaseCard::Get(keyword, VectorComponent); }
58         float  Get(corrType ctype, int VectorComponent =0);  //get TVector component
59         float  GetFast(corrType ctype, int VectorComponent=0);  //get TVector component
60         int    GetN(TString keyword){ return AliJBaseCard::GetN(keyword); }       //get TVector dimension
61         int    GetN(corrType ctype);        //get TVector dimension
62         int    GetNFast(corrType ctype);    //get TVector dimension
63
64         //---- Collision Species --
65         float  GetCollisionType()  { return Get("CollisionType");}
66
67         //------  v e r t e x -----
68
69         float  VertInZRange(float Z) {
70             //cout<< "zv " << Z <<" "<< ( GetBinBorder(kZVertType,0) < Z && Z < GetBinBorder(kZVertType, GetNoOfBins(kZVertType)) ) <<endl; 
71             return ( GetBinBorder(kZVertType,0) < Z && Z < GetBinBorder(kZVertType, GetNoOfBins(kZVertType)) ); }
72
73         //Alice vertex  cuts
74         bool CheckEventZVetrex(double fZVertex, double ZVertErr){
75             if(Get("ZVertexRange",0)<fZVertex && fZVertex <Get("ZVertexRange",1) && (Get("MaxZVertexError") > ZVertErr))        return true; 
76             else    return false;
77         }
78
79         int IsLessThanUpperPairPtCut(double inPairPt);
80
81
82         //--- c o r r e l a t i o n  bins & borders --
83         int    GetNoOfBins (corrType ctype){ return GetNFast(ctype)-1; }
84         float  GetBinBorder(corrType ctype, int ii){ return GetFast(ctype,ii); }
85         int    GetBin(corrType ctype, float val);
86         int    GetBinFast(corrType ctype, float val);
87         double GetBinCenter(corrType ctype, int ii){ return (GetFast(ctype,ii)+GetFast(ctype,ii+1))/2.;}
88
89         //-----  m i x i n g ----
90         int    GetEventPoolDepth(int cBin){ return (int) Get("EventPoolDepth",cBin);}
91         bool   SimilarVertZ(float Z1, float Z2);
92         bool   SimilarMultiplicity(float mult1, float mult2);
93         bool   SimilarCentrality(float c1, float c2, int cbin);
94
95         //run characteristics
96         bool   IsGoodRun(int runID);
97
98         //trigger
99         bool   MbTrigger(int triggin) const;
100
101         //photon
102         bool   IsPhoton(AliJPhoton *g){ return g->GetProbPhot() > Get("probPhot"); }
103         float  GetPhotEnergyCut(){ return Get("minEnergy"); }
104
105         bool   InPhiRange(float Phi);
106         bool   IsInZEDandThetaRange(float zedDC, float theta){
107             return (fabs(zedDC)<Get("zedRange") && fabs(kJPi/2-theta)<Get("thetaRange"));
108         }
109
110         bool   IsInEtaRange(float eta){return fabs(eta)<Get("EtaRange"); }
111         //  bool   likeSgnCheck(PhJCgl *cgl1, PhJCgl *cgl2);
112         bool   DeltaEtaCheck(const AliJBaseTrack *ftk1, const AliJBaseTrack *ftk2);
113         bool   NotGhost(float zedDC, float PhiDC){ 
114             return (zedDC > Get("deltaZEDPhiDC",0) && fabs(PhiDC) > Get("deltaZEDPhiDC",1));
115         }
116
117         /* bool CheckCovDiagonalElements(double *element){
118            if(Get("MaxCovDiagonalElements",0)<0) return true;
119            bool isGoodTrack = true;
120            for(Int_t i=0;i<5;i++){
121            if(Get("MaxCovDiagonalElements",i) < element[i]) isGoodTrack = false;
122            }
123            return isGoodTrack; 
124            }*/
125
126         bool CheckTrackParamsInTPC(int NClustersTPC,float Chi2PerClusterTPC);
127
128         bool CheckMinNumTPCClustPt(int NClustersTPC, float fpt);
129
130         bool CheckTrackImpact(float xyIm, float zIm, float fpt);
131
132
133         bool AcceptKinkDaughters(int kinkIndex){
134             if(( ! (bool) Get("AcceptKinkDaughters")) && kinkIndex > 0 ) return false;//we do not want kinks but kink findex>0
135             else return true;
136         }
137
138
139         double GetCutOnBkgActivity(){
140             return (double) Get("CutOnBkgActivity");
141         }
142
143         void   SetEventV3kv(double inV3kv) {feventV3kv = inV3kv;}
144         double GetEventV3kv() const {return feventV3kv;}
145
146         //Alice CALO
147         bool ReadEmcalSm(int sm){ return (bool) Get("EMCAL_SM",sm);}
148         bool ReadPhosSm(int sm){ return (bool) Get("PHOS_SM",sm);}
149
150         bool  MixPhotonForPi0Mass() {return ((int) Get("massMix")==1);}//FK//
151         bool  MixMBForPi0Mass() {return ((int) Get("massMixMB")>0);}
152         bool  MixMBMBForPi0Mass() {return ((int) Get("massMixMB")==2);}
153
154         virtual void InitCard(); //TODO
155         void FinishCard(); // TODO
156         void ReCompile();
157
158
159     protected:
160
161
162         TString GetKeyWord(corrType ctype);
163         corrType GetCorrType( TString inStr );
164
165         //====   D a t a    M e m b e r s  ========
166
167         //   double effPar[16];
168         //   double corrCent[10]; //FK// additional scaling factor to effPar to correct on hi fcentrality
169         TH2D *fhCorr;  // comment me
170
171         double feventV3kv;  // comment me
172
173         vector< int >       fIndexVector;     //array of float number confg parameter vectors 
174
175         Double_t **fpi0massbin; //! faster access to pi0 mass bins
176
177         //ClassDef(AliJCard, 1); // EMCAL for jcorran
178 };
179
180 #endif
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202