updated task to make it possible to run on the grid
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliDalitzElectronSelector.h
1 #ifndef ALIDALITZELECTRONSELECTOR_H
2 #define ALIDALITZELECTRONSELECTOR_H
3
4 #include "AliAnalysisTaskSE.h"
5 #include "AliAODv0.h"
6 #include "AliESDv0.h"
7 #include "AliDalitzElectronCuts.h"
8 #include "AliExternalTrackParam.h"
9
10 class TRandom3;
11 class AliStack;
12 class TList;
13 class TString;
14 class TH1F;
15 class TH2F;
16
17 using namespace std;
18
19 class AliDalitzElectronSelector : public AliAnalysisTaskSE {
20
21  public:
22
23    AliDalitzElectronSelector(const char *name="ElectronSelector");
24    //Uncopyable & operator=(const Uncopyable&);
25
26    virtual ~AliDalitzElectronSelector();                            //virtual destructor
27    void UserCreateOutputObjects();
28
29    virtual void UserExec(Option_t *option);
30    virtual void Terminate(Option_t *);
31    virtual void Init();
32
33    Bool_t ProcessEvent(AliVEvent *inputEvent,AliMCEvent *mcEvent=NULL);
34    Bool_t IsEventSelected(){return fEventIsSelected;}
35
36    // Return selected electron/positron array
37    vector <Int_t> GetReconstructedElectronsIndex(){ return fElectronsIndex; }
38    vector <Int_t> GetReconstructedPositronsIndex(){ return fPositronsIndex; }
39    AliDalitzElectronCuts *GetDalitzElectronCuts(){   return fElectronCuts; }
40    TList *GetCutHistograms(){ if(fElectronCuts){return fElectronCuts->GetCutHistograms();} return NULL;}
41    // Set Options
42
43    void SetDalitzElectronCuts(const TString cut);
44    void SetDalitzElectronCuts(AliDalitzElectronCuts *cuts){fElectronCuts=cuts;}
45
46  protected:
47    //selected electron arrays
48    
49    Bool_t ProcessESDs();
50    AliDalitzElectronCuts *fElectronCuts; // Pointer to the ConversionCut Selection
51    vector<Int_t> fPositronsIndex;
52    vector<Int_t> fElectronsIndex;
53    Bool_t fEventIsSelected;
54
55  private:
56    AliDalitzElectronSelector (const AliDalitzElectronSelector&); // not implemented
57    AliDalitzElectronSelector & operator=(const AliDalitzElectronSelector&); // not implemented
58
59
60    
61    ClassDef(AliDalitzElectronSelector,1)
62       };
63
64 inline void AliDalitzElectronSelector::SetDalitzElectronCuts(const TString cut){
65    if(fElectronCuts != NULL){
66       delete fElectronCuts;
67       fElectronCuts=NULL;
68    }
69    if(fElectronCuts == NULL){
70       fElectronCuts=new AliDalitzElectronCuts("ElectronCuts","ElectronCuts");
71       fElectronCuts->InitializeCutsFromCutString(cut.Data());
72    }
73 }
74
75
76 #endif