]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/EBYE/LRC/AliLRCProcess.h
9d4f9459dbd2e21c186bd01c039b538f11c84a30
[u/mrichter/AliRoot.git] / PWGCF / EBYE / LRC / AliLRCProcess.h
1 // This class is creatig TH2D histogramms for Nch - Nch , Nch - Pt , Pt - Pt
2 // dirtributions for given ETA windows and some supplementary data for Long Range Correlation (LRC) analysis .  
3 // Class is designid to work with AliAnalysisTaskLRC
4
5 // Author : Andrey Ivanov , St.Peterburg State University
6 // Email: Andrey.Ivanov@cern.ch
7
8 /*  See cxx source for full Copyright notice */
9
10
11 #ifndef ALILRCPROCESS_H
12 #define ALILRCPROCESS_H
13
14
15
16 // Include
17 #include "TString.h"
18 #include "AliLRCBase.h"
19 #include "THnSparse.h"
20
21 class TH1F;
22 class TH1D;
23 class TH2D;
24 class TProfile;
25 class TList;
26 //class TClonesArray;//TArrayF;
27 //class THnSparseD;
28
29
30 enum sparse_pid_list
31 {
32     kSparsePIDany = 0,
33     kSparsePIDdefined,
34     kSparsePIDpion,
35     kSparsePIDkaon,
36     kSparsePIDproton,
37     kSparsePIDtotal,
38 };
39
40 enum sparse_data_structure
41 {
42     kSparseNf = 0,
43     kSparseNb,
44     kSparsePtF,
45     kSparsePtB,
46     /*en_sparse_Et_f,
47     en_sparse_Et_b,*/
48     en_sparse_N2_f,
49     en_sparse_Nf_Nb,
50
51     en_sparse_Ptb_Nf,
52     en_sparse_Pt2_f,
53     en_sparse_Ptf_Ptb,
54
55     /*en_sparse_Nf_plus,
56     en_sparse_Nf_minus,
57     en_sparse_Nb_plus,
58     en_sparse_Nb_minus,
59     en_sparse_Nf_plus_Nb_minus,
60     en_sparse_Nb_plus_Nf_minus,*/
61     //en_sparse_N2_b,
62     kSparseTotal,
63 };
64
65
66
67 enum array_labels
68 {
69     en_arr_labels_NN_Nevents = 0,
70     en_arr_labels_NN_Nf,
71     en_arr_labels_NN_Nb,
72     en_arr_labels_NN_N2_f,
73     en_arr_labels_NN_Nf_Nb,
74     en_arr_labels_NN_N2_b,
75
76     en_arr_labels_PtN_Nevents,
77     en_arr_labels_PtN_Nf,
78     en_arr_labels_PtN_PtB,
79     en_arr_labels_PtN_N2_f,
80     en_arr_labels_PtN_Ptb_Nf,
81
82     en_arr_labels_PtPt_Nevents,
83     en_arr_labels_PtPt_PtF,
84     en_arr_labels_PtPt_PtB,
85     en_arr_labels_PtPt_Pt2_f,
86     en_arr_labels_PtPt_Ptf_Ptb,
87
88     en_arr_labels_total,
89 };
90
91
92
93 class AliLRCProcess: public AliLRCBase
94 {
95 public:
96     // Constructors
97     AliLRCProcess();
98
99     AliLRCProcess(Double_t _StartForwardETA,Double_t _EndForwardETA,Double_t _StartBakwardETA,Double_t _EndBakwardETA ); // Constructor with window setup makes ready-to-run processor
100
101     Bool_t InitDataMembers(); //Is to be called in CreateOutputObjects method
102
103     // Destructor
104     virtual ~AliLRCProcess();
105
106     // Setters
107     virtual void SetForwardWindow(Double_t StartETA,Double_t EndETA);  //Sets Forward ETA window
108     virtual void SetBackwardWindow(Double_t StartETA,Double_t EndETA);  // Sets Backward window
109     virtual void SetETAWindows(Double_t _StartForwardETA,Double_t _EndForwardETA,Double_t _StartBakwardETA,Double_t _EndBakwardETA); // Sets both forward and backward windows
110     virtual void SetForwardWindowPhi(Double_t StartForwardPhi,Double_t EndForwardPhi){fStartForwardPhi=StartForwardPhi;fEndForwardPhi=EndForwardPhi;}
111     virtual void SetBackwardWindowPhi(Double_t StartBackwardPhi,Double_t EndBackwardPhi){fStartBackwardPhi=StartBackwardPhi;fEndBackwardPhi=EndBackwardPhi;}
112
113     virtual void SetDoubleSidedBackwardWindowPhi( Bool_t isDoubleSided ) { fDoubleSidedBackwardPhiWindow = isDoubleSided; }// Number of phi division, for rotating sectors
114
115     virtual void SetEventCentrality(Double_t centrality){ fEventCentrality = centrality;}
116     virtual void SetEventPlane(Double_t ) {}
117
118
119     //virtual void SetNumberOfPhiSectors(Int_t nSectors){ fNumberOfSectors = nSectors; }//fNeedToRotateSector = kTRUE; }
120
121
122     virtual  void SetHistPtRange(Double_t LoPt,Double_t HiPt,Int_t PtBins);  // Sets range for Pt histos axis
123     virtual  void SetHistPtRangeForwardWindowRebinFactor( Int_t ptHistXaxisRebinFactor );
124     virtual  void SetHistMultRange(Int_t whichWindow, Int_t LoMult,Int_t HiMult,Int_t MultBins=0); // Sets range for Nch histos axis
125     virtual  void SetHistMultRangeHor(Int_t LoMult,Int_t HiMult,Int_t MultBins=0); // Sets range for Nch histos axis
126     virtual  void SetHistMultRangeVert(Int_t LoMult,Int_t HiMult,Int_t MultBins=0); // Sets range for Nch histos axis
127     virtual  void SetOutputSlotNumber(Int_t SlotNumber); // Sets number of output slot for LRCProcessor
128
129     // Getters
130     virtual void GetETAWindows(Double_t &_StartForwardETA,Double_t &_EndForwardETA,Double_t &_StartBakwardETA,Double_t &_EndBakwardETA);
131     virtual void GetPhiWindows(Double_t &_StartForwardPhi,Double_t &_EndForwardPhi,Double_t &_StartBakwardPhi,Double_t &_EndBakwardPhi);
132     virtual TList* CreateOutput() const ; // Creates output object
133     virtual TString GetShortDef() const ; // Returns fShortDef value
134     virtual Int_t GetOutputSlotNumber() const; // Returns number of output slot for LRCProcessor
135
136     // Track by track event import
137     virtual void StartEvent();  // Open new Event for track by track event import
138     virtual void AddTrackPtEta(Double_t Pt, Double_t Eta , Double_t Phi, Short_t Charge = 100, Int_t particleType = -1 ); // Imports track to the event
139     virtual void AddTrackForward(Double_t Pt, Double_t Eta , Double_t Phi, Short_t Charge, Int_t particleType  );  // Imports track to the event directly to Forward window
140     virtual void AddTrackBackward(Double_t Pt, Double_t Eta , Double_t Phi, Short_t Charge, Int_t particleType  );  // Imports track to the event directly to Backward window
141     virtual void AddTrackPtEtaMixing( Int_t winFB, Double_t Pt, Double_t Eta ,Double_t Phi, Short_t Charge, Int_t particleType = -1 );
142     virtual void FinishEvent(Bool_t kDontCount = kFALSE); // Close opened event
143
144     //virtual void SetPidToFill(  ) { fWhichParticleToProcess = particleType; }  // which particle type in this processor is considered
145     //virtual void SetPidFillCondition( LRCparticleType particleType, LRCpidFillCondition fillCond )
146     //  { fPidFillCondition = fillCond;
147     //          fWhichParticleToProcess = particleType; }  // how to fill bckwd and fwd hists by pid
148     //virtual LRCparticleType GetPidToFill() { return fWhichParticleToProcess;  }
149     //virtual void SetPidForward( LRCparticleType particleType );// { fPidForward = particleType; }  // which pid for fwd
150     //virtual void SetPidBackward( LRCparticleType particleType );// { fPidBackward = particleType; }  // which pid for fwd
151     virtual void SetParticleType( char* strForwardOrBackward, char* strPid );
152     virtual void   Terminate() {} //was done for yield study
153
154     virtual void SetUseSparse( Bool_t flag )            { fUseSparse             = flag;  }
155     virtual void SetUseAccumulatingHist( Bool_t flag )  { fUseAccumulatingHist   = flag;  }
156     inline Bool_t IsPhiInRange( Double_t phi, Double_t phiBoundMin, Double_t phiBoundMax );
157
158     void SetCorrespondanceWithAliROOTpid();
159     void ZeroPidArrays();
160
161
162 private:
163
164     virtual  void SetShortDef();  // Sets fShortDef according to window paramiters
165
166     //Data Init and checks
167     //Bool_t StateCheck();   // Check if data is OK
168     Bool_t fIsEventOpend;  // Indicates opened event
169     Bool_t fIsOnline;  // Are data objects created
170     Bool_t fDisplayInitOnDemandWarning; // Switch warning when InitDataInDemand is called;
171     //Bool_t InitDataOnDemand(); // Create data objects
172
173
174     Bool_t fUseSparse; //flag to use THnSparse
175     Bool_t fUseAccumulatingHist; //flag to accumulate some values
176
177     // Statistics
178     Int_t fEventCount; //Number of processed events
179
180     // Windows paramiters -----------------------------------
181
182     Double_t fStartForwardETA;  // Forward windos lover rapidity
183     Double_t fEndForwardETA;    // Forward window higer rapidity
184     Double_t fStartForwardPhi;  // Forward phi angle interval
185     Double_t fEndForwardPhi;   // Forward phi angle interval
186
187
188     Double_t fStartBackwardETA;  // Backward window lover rapidity
189     Double_t fEndBackwardETA;    // Backward window higer rapidity
190
191     Double_t fStartBackwardPhi;  // Backward window phi angle interval
192     Double_t fEndBackwardPhi;    // Backward window phi angle interval
193
194     Bool_t fDoubleSidedBackwardPhiWindow; // Flag, if true - we look at phi sector and it's opposite one
195
196
197     Double_t fHiPt;             // Max Pt for histos
198     Double_t fLoPt;             // Min Pt for histos
199     Int_t fHiMultHor;           // Min multiplicity for histos (horizontal)
200     Int_t fLowMultHor;          // Max multiplicity for histos (horizontal)
201
202     Int_t fHiMultVert;          // Min multiplicity for histos (vertical)
203     Int_t fLowMultVert; // Max multiplicity for histos (vertical)
204
205
206     Int_t fMultBinsHor;         // N bins for multiplicity (horizontal)
207     Int_t fMultBinsVert;        // N bins for multiplicity (vertical)
208     Int_t fPtBins;              // N bins for Pt
209     Int_t fPtHistXaxisRebinFactor;              // rebinning of Xaxis on PtN and PtPt histos
210
211
212     // Track by track import values
213     Double_t fSumPtFw;          // Summary Pt forward
214     Double_t fSumPtBw;          // Summary Pt backward
215     Double_t fSumPtBw2;         // Summary Pt^2 backward
216     Int_t fNchFw;                       // Number of tracks Forward
217     //Int_t fNchFwPtPt;         // Number of tracks Forward for PtPt accept conditions
218     Int_t fNchBw;                       // Number of tracks Backward
219
220     Int_t fNchFwPlus;                   // Number of plus charged tracks Forward
221     Int_t fNchBwPlus;                   // Number of plus charged tracks Backward
222     Int_t fNchFwMinus;                  // Number of minus charged tracks Forward
223     Int_t fNchBwMinus;                  // Number of minus charged tracks Backward
224
225
226     //PID data arrays
227     Int_t fCorrespondanceWithAliROOTpid[kSparsePIDtotal];
228     
229     Double_t fSumPtFwPID[kSparsePIDtotal];              // Summary Pt forward
230     Double_t fSumPtBwPID[kSparsePIDtotal];              // Summary Pt backward
231     Double_t fSumEtFwPID[kSparsePIDtotal];              // Summary Pt forward
232     Double_t fSumEtBwPID[kSparsePIDtotal];              // Summary Pt backward
233     //Double_t fSumPtBw2;               // Summary Pt^2 backward
234     Int_t fNchFwPID[kSparsePIDtotal];                   // Number of tracks Forward
235     Int_t fNchBwPID[kSparsePIDtotal];                   // Number of tracks Backward
236
237     Int_t fNchFwPlusPID[kSparsePIDtotal];                       // Number of plus charged tracks Forward
238     Int_t fNchBwPlusPID[kSparsePIDtotal];                       // Number of plus charged tracks Backward
239     Int_t fNchFwMinusPID[kSparsePIDtotal];                      // Number of minus charged tracks Forward
240     Int_t fNchBwMinusPID[kSparsePIDtotal];                      // Number of minus charged tracks Backward
241     
242     
243     //Output data
244     TList* fOutList;    //! List of output data
245
246     TString fShortDef; // Short desctiption
247     Int_t fOutputSlot; // Output slot number for this Processor
248
249     // Total spectras (debugging for TAG selection)
250     TH1F        *fHistPt; //! Overal Pt spectrum
251     TH1F        *fHistEta; //! Overal Eta spectrum
252
253
254     // Output histogramms -----------------------------------
255     THnSparseD *fHistClouds; //! all LRC Clouds
256
257     TH2D* fHistNN;        //! N-N 2D Profile
258     TH2D* fHistPtN;     //! Pt-N 2D Profile
259     TH2D* fHistPtPt;    //! Pt-Pt 2D Profile
260     TProfile* fProfNberr;       //! Nbackward error Profile PtN
261     TProfile* fProfNberrPtPt;   //! Nbackward error Profile PtPt
262     TProfile* fProfdPtB;  //! Used to store (in first bin) summary of PtB and its std diviation
263     TProfile* fProfTestLRC; //! Diognostic LRC Pt - N correlation
264
265     // Supp. info for windows
266     TH1D *fHistSparseDimensionLabeling; //correspondance of THnSparse enums to what we are filling in each dimension
267     TH1D *fHistSparsePIDblocksLabeling;
268     //Forward
269     TH1D* fHistPtForward;   //! Pt spectrum in Forward windows
270     TH1D* fHistEtaForward;  //! Eta spectrum in Forward windows
271     TH1D* fHistNchForward;  //! Nch spectrum in Forward windows
272     TH1D* fHistNchForwardPtPt;  //! Nch spectrum in Forward windows for PtPt accept conditions
273     TH1D* fHistPhiForward;  //! Phi spectrum in Forward windows
274     TH1D *fHistTracksChargeForward;   //! Charge of accepted tracks in Forward windows
275
276     //net charge in Fwd window
277     TH1D *fHistPtPlusForward;   //! pt distr for + in Fwd window
278     TH1D *fHistPtMinusForward;   //! pt distr for - in Fwd window
279     TH1D *fHistNetChargeVsPtForward;   //! Net charge vs pt of accepted tracks in Fwd window
280
281
282     //Backward
283     TH1D* fHistPtBackward;   //! Pt spectrum in Backward windows
284     TH1D* fHistEtaBackward;  //! Eta spectrum in Backward windows
285     TH1D* fHistNchBackward;  //! Nch spectrum in Backward windows
286     TH1D* fHistPhiBackward;  //! Phi spectrum in Backward windows
287     TH1D *fHistTracksChargeBackward;   //! Charge of accepted tracks in Backward windows
288
289     //net charge in Bckwd window
290     TH1D *fHistPtPlusBackward;   //! pt distr for + in Bckwd window
291     TH1D *fHistPtMinusBackward;   //! pt distr for - in Bckwd window
292     TH1D *fHistNetChargeVsPtBackward;   //! Net charge vs pt of accepted tracks in Bckwd window
293
294 //    TH1D *fHistChargePlusVsPtTmp;    //! Net charge vs pt of accepted tracks +
295 //    TH1D *fHistChargeMinusVsPtTmp;   //! Net charge vs pt of accepted tracks -
296 //    TH2D *fHist2DNetChargeVsPt;      //! Net charge vs pt of accepted tracks 2D
297 //    TH2D *fHist2DNetChargeVsPtCorrectedOnEventMean;              //! Net charge vs pt of accepted tracks 2D shifted by mean
298 //    TH2D *fHist2DNetChargeVsPtCorrectedOnEventMeanNormOnNch;     //! Net charge vs pt of accepted tracks 2D norm on nCh
299
300     /*TClonesArray */
301     TH1D *fArrAccumulatedValues;   //! accumulated values for observables
302     //TH1D *fHistArrayLabeling; //correspondance of THnSparse enums to what we are filling in each dimension
303
304     
305     AliLRCProcess(const AliLRCProcess&); // not implemented
306     AliLRCProcess& operator=(const AliLRCProcess&); // not implemented
307
308     //Int_t fWhichParticleToFill; //! LRC processor sense only this type of particles
309     //Int_t     fNumberOfSectors; //! Number of phi division, for rotating sectors
310     //Bool_t fNeedToRotateSector;       //! Flag for rotating sectors
311
312     Double_t fEventCentrality;          // for filling hist nF-centrality (for PbPb)
313     TH2D* fHistNfCentrality;    //! Nf-Centrality plot
314     
315     TH1D* fHistTestPIDForward;  //! PID in Forward windows
316     TH1D* fHistTestPIDBackward;  //! PID in Backward windows
317
318     TH2D* fHistDifferenceNf;    //! nB-nF as func of nF
319     TH2D* fHistDifferenceNb;    //! nF-nB as func of nB
320
321     int fPidForward; //! LRC processor sense only this type of particles (-1 by default)
322     int fPidBackward; //! LRC processor sense only this type of particles (-1 by default)
323
324
325     //LRCparticleType fWhichParticleToProcess; // ! LRC processor sense only this type of particles (-1 by default)
326     //LRCpidFillCondition fPidFillCondition;
327
328     ClassDef(AliLRCProcess, 3);
329 };
330
331 #endif
332