]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGDQ/dielectron/AliDielectronMixingHandler.h
-add option to skip the first event for ME
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronMixingHandler.h
1 #ifndef ALIDIELECTRONMIXINGHANDLER_H
2 #define ALIDIELECTRONMIXINGHANDLER_H
3
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 //#############################################################
8 //#                                                           # 
9 //#         Class AliDielectronMixingHandler                  #
10 //#                                                           #
11 //#  Authors:                                                 #
12 //#   Jens Wiechula, Uni-Tübingen / Jens.Wiechula@cern.ch     #
13 //#                                                           #
14 //#############################################################
15
16 #include <TNamed.h>
17 #include <TObjArray.h>
18 #include <TClonesArray.h>
19
20 #include "AliDielectronVarManager.h"
21
22 class AliDielectron;
23 class AliVTrack;
24 class AliVEvent;
25
26 class AliDielectronMixingHandler : public TNamed {
27 public:
28   enum { kMaxCuts=10 };
29   enum EMixType {
30     kOSonly=0,
31     kOSandLS,
32     kAll
33   };
34   AliDielectronMixingHandler();
35   AliDielectronMixingHandler(const char*name, const char* title);
36
37   virtual ~AliDielectronMixingHandler();
38
39   void AddVariable(AliDielectronVarManager::ValueTypes type, Int_t nbins,
40                    Double_t min, Double_t max, Bool_t log=kFALSE);
41   void AddVariable(AliDielectronVarManager::ValueTypes type, const char* binLimitStr);
42
43   void SetDepth(UShort_t depth) { fDepth=depth; }
44   UShort_t GetDepth()     const { return fDepth; }
45
46   void SetMixType(EMixType type) { fMixType=type; }
47   EMixType GetMixType() const    { return fMixType; }
48
49   void SetMixUncomplete(Bool_t mix) { fMixIncomplete=mix; }
50   Bool_t GetMixUncomplete() const { return fMixIncomplete; }
51
52   void SetMoveToSameVertex(Bool_t move) { fMoveToSameVertex=move; }
53   Bool_t GetMoveToSameVertex() const { return fMoveToSameVertex; }
54
55   void SetSkipFirstEvent(Bool_t skip) { fSkipFirstEvt=skip; }
56
57   Int_t GetNumberOfBins() const;
58   Int_t FindBin(const Double_t values[], TString *dim=0x0);
59   void Fill(const AliVEvent *ev, AliDielectron *diele);
60
61   void MixRemaining(AliDielectron *diele);
62
63   void Init(const AliDielectron *diele=0x0);
64   static void MoveToSameVertex(AliVTrack * const vtrack, const Double_t vFirst[3], const Double_t vMix[3]);
65
66 private:
67   UShort_t     fDepth;     //Number of events per bin to start the merging
68   TClonesArray fArrPools; //Array of events in bins
69
70   UShort_t  fEventCuts[kMaxCuts]; //cut variables
71   TObjArray fAxes;        //Axis descriptions of the event binning
72
73   EMixType fMixType;      // which combinations to include in the mixing
74
75   Bool_t fMixIncomplete;  // whether to mix uncomplete bins at the end of the processing
76   Bool_t fMoveToSameVertex; //whether to move the mixed tracks to the same vertex position
77   Bool_t fSkipFirstEvt;   //whether to skip the first event in the pool
78
79   TProcessID *fPID;             //! internal PID for references to buffered objects
80   
81   void DoMixing(TClonesArray &pool, AliDielectron *diele);
82
83   AliDielectronMixingHandler(const AliDielectronMixingHandler &c);
84   AliDielectronMixingHandler &operator=(const AliDielectronMixingHandler &c);
85
86   
87   ClassDef(AliDielectronMixingHandler,1)         // Dielectron MixingHandler
88 };
89
90
91
92 #endif