]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/GammaConv/AliGammaConversionAODBGHandler.h
- changed order of filling validated histograms
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliGammaConversionAODBGHandler.h
1 //-*- Mode: C++ -*-
2 #ifndef ALIGAMMACONVERSIONAODBGHANDLER_H
3 #define ALIGAMMACONVERSIONAODBGHANDLER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice     */
6
7 ////////////////////////////////////////////////
8 //--------------------------------------------- 
9 // Class  for handling of background calculation
10 //---------------------------------------------
11 ////////////////////////////////////////////////
12
13 #include <vector>
14
15
16 // --- ROOT system ---
17 #include <TObject.h> 
18 #include "AliKFParticle.h"
19 #include "AliAODConversionPhoton.h"
20 #include "AliAODConversionMother.h"
21 #include "TClonesArray.h"
22 #include "AliESDVertex.h"
23
24 #if __GNUC__ >= 3
25 using namespace std;
26 #endif
27
28 typedef vector<AliAODConversionPhoton*> AliGammaConversionAODVector;
29 typedef vector<AliAODConversionMother*> AliGammaConversionMotherAODVector;
30
31 class AliGammaConversionAODBGHandler : public TObject {
32
33         public: 
34         struct GammaConversionVertex{
35                 Double_t fX;
36                 Double_t fY;
37                 Double_t fZ;
38                 Double_t fEP;
39         };
40         
41         typedef struct GammaConversionVertex GammaConversionVertex;                                                                                                                             //!
42
43         typedef vector<AliGammaConversionAODVector> AliGammaConversionBGEventVector;
44         typedef vector<AliGammaConversionBGEventVector> AliGammaConversionMultipicityVector;
45         typedef vector<AliGammaConversionMultipicityVector> AliGammaConversionBGVector;
46
47         typedef vector<AliGammaConversionMotherAODVector> AliGammaConversionMotherBGEventVector;
48         typedef vector<AliGammaConversionMotherBGEventVector> AliGammaConversionMotherMultipicityVector;
49         typedef vector<AliGammaConversionMotherMultipicityVector> AliGammaConversionMotherBGVector;
50         
51         AliGammaConversionAODBGHandler();                                                                                                                                                                                       //constructor
52         AliGammaConversionAODBGHandler(UInt_t binsZ,UInt_t binsMultiplicity,UInt_t nEvents);                                                                            // constructor
53         AliGammaConversionAODBGHandler(UInt_t collisionSystem,UInt_t centMin,UInt_t centMax,UInt_t nEvents, Bool_t useTrackMult);
54         AliGammaConversionAODBGHandler(const AliGammaConversionAODBGHandler & g);                                                                                                       //copy constructor
55         AliGammaConversionAODBGHandler & operator = (const AliGammaConversionAODBGHandler & g);                                                                         //assignment operator
56         virtual ~AliGammaConversionAODBGHandler();                                                                                                                                                                      //virtual destructor
57
58         void Initialize(Double_t * const zBinLimitsArray, Double_t * const multiplicityBinLimitsArray);
59
60         Int_t GetZBinIndex(Double_t z) const;
61
62         Int_t GetMultiplicityBinIndex(Int_t mult) const;
63
64         void AddEvent(TList* const eventGammas, Double_t xvalue,Double_t yvalue,Double_t zvalue, Int_t multiplicity, Double_t epvalue = -100);
65         void AddMesonEvent(TList* const eventMothers, Double_t xvalue,Double_t yvalue,Double_t zvalue, Int_t multiplicity, Double_t epvalue = -100);
66         void AddElectronEvent(TClonesArray* const eventENeg, Double_t zvalue, Int_t multiplicity);
67
68         Int_t GetNBGEvents()const {return fNEvents;}
69
70         // Get BG photons
71         AliGammaConversionAODVector* GetBGGoodV0s(Int_t zbin, Int_t mbin, Int_t event);
72         // Get BG mesons
73         AliGammaConversionMotherAODVector* GetBGGoodMesons(Int_t zbin, Int_t mbin, Int_t event);
74         // Get BG electron
75         AliGammaConversionAODVector* GetBGGoodENeg(Int_t event, Double_t zvalue, Int_t multiplicity);
76         
77         void PrintBGArray();
78
79         GammaConversionVertex * GetBGEventVertex(Int_t zbin, Int_t mbin, Int_t event){return &fBGEventVertex[zbin][mbin][event];}
80
81         Double_t GetBGProb(Int_t z, Int_t m){return fBGProbability[z][m];}
82
83         private:
84
85                 Int_t                                                           fNEvents;                                               // number of events
86                 Int_t **                                                        fBGEventCounter;                                //! bg counter
87                 Int_t **                                                        fBGEventENegCounter;                    //! bg electron counter
88                 Int_t **                                                        fBGEventMesonCounter;                   //! bg counter
89                 Double_t **                                             fBGProbability;                                 //! prob per bin
90                 GammaConversionVertex ***                       fBGEventVertex;                                 //! array of event vertex
91                 Int_t                                                           fNBinsZ;                                                //n z bins
92                 Int_t                                                           fNBinsMultiplicity;                     //n bins multiplicity
93                 Double_t *                                                      fBinLimitsArrayZ;                               //! bin limits z array
94                 Double_t *                                                      fBinLimitsArrayMultiplicity;    //! bin limit multiplicity array
95                 AliGammaConversionBGVector                      fBGEvents;                                              // photon background events
96                 AliGammaConversionBGVector                      fBGEventsENeg;                                  // electron background electron events
97                 AliGammaConversionMotherBGVector        fBGEventsMeson;                                 // neutral meson background events
98                 
99         ClassDef(AliGammaConversionAODBGHandler,4)
100 };
101 #endif