]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/GammaConv/AliV0ReaderV1.h
remove warnings
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliV0ReaderV1.h
1 #ifndef ALIV0READERV1_H
2 #define ALIV0READERV1_H
3
4 #include "AliAnalysisTaskSE.h"
5 #include "AliAODv0.h"
6 #include "AliESDv0.h"
7 #include "AliConversionCuts.h"
8 #include "AliExternalTrackParam.h"
9
10 class AliConversionPhotonBase;
11 class TRandom3;
12 class AliStack;
13 class TList;
14 class AliKFConversionPhoton;
15 class TString;
16 class TClonesArray;
17 class TH1F;
18 class TH2F;
19 class AliAODConversionPhoton;
20
21 using namespace std;
22
23 class AliV0ReaderV1 : public AliAnalysisTaskSE {
24         
25  public: 
26         
27   AliV0ReaderV1(const char *name="V0ReaderV1");
28   virtual ~AliV0ReaderV1();                            //virtual destructor
29   void UserCreateOutputObjects();
30
31
32   virtual void UserExec(Option_t *option);
33   virtual void Terminate(Option_t *);
34   virtual void Init();
35
36   Bool_t ProcessEvent(AliVEvent *inputEvent,AliMCEvent *mcEvent=NULL);
37   Bool_t IsEventSelected(){return fEventIsSelected;}
38
39   // Return Reconstructed Gammas
40   TClonesArray *GetReconstructedGammas(){return fConversionGammas;}
41   Int_t GetNReconstructedGammas(){if(fConversionGammas){return fConversionGammas->GetEntriesFast();}else{return 0;}}
42   AliConversionCuts *GetConversionCuts(){return fConversionCuts;}
43   TList *GetCutHistograms(){if(fConversionCuts){return fConversionCuts->GetCutHistograms();}return NULL;}
44   // Set Options
45
46   void SetConversionCuts(const TString cut);
47   void SetConversionCuts(AliConversionCuts *cuts){fConversionCuts=cuts;}
48   void SetUseOwnXYZCalculation(Bool_t flag){fUseOwnXYZCalculation=flag;}
49   void SetUseConstructGamma(Bool_t flag){fUseConstructGamma=flag;}
50   void SetUseAODConversionPhoton(Bool_t b){if(b){cout<<"Setting Outputformat to AliAODConversionPhoton "<<endl;}else{cout<<"Setting Outputformat to AliKFConversionPhoton "<<endl;};kUseAODConversionPhoton=b;}
51   void SetCreateAODs(Bool_t k=kTRUE){fCreateAOD=k;}
52   void SetDeltaAODFilename(TString s){fDeltaAODFilename=s;}
53   void SetDeltaAODBranchName(TString string) { fDeltaAODBranchName = string;AliInfo(Form("Set DeltaAOD BranchName to: %s",fDeltaAODBranchName.Data()));}
54
55 protected:
56     // Reconstruct Gammas
57     Bool_t ProcessESDV0s();
58     AliKFConversionPhoton *ReconstructV0(AliESDv0* fCurrentV0,Int_t currentV0Index);
59     void FillAODOutput();
60     void FindDeltaAODBranchName();
61     Bool_t GetAODConversionGammas();
62    
63     // Getter Functions
64
65     const AliExternalTrackParam *GetExternalTrackParam(AliESDv0 *fCurrentV0,Int_t &tracklabel,Int_t charge);
66     const AliExternalTrackParam *GetExternalTrackParamP(AliESDv0 *fCurrentV0,Int_t &tracklabel){return GetExternalTrackParam(fCurrentV0,tracklabel,1);};
67     const AliExternalTrackParam *GetExternalTrackParamN(AliESDv0 *fCurrentV0,Int_t &tracklabel){return GetExternalTrackParam(fCurrentV0,tracklabel,-1);};
68     AliKFParticle *GetPositiveKFParticle(AliAODv0 *fCurrentV0,Int_t fTrackLabel[2]);
69     AliKFParticle *GetNegativeKFParticle(AliAODv0 *fCurrentV0,Int_t fTrackLabel[2]);
70     AliKFParticle *GetPositiveKFParticle(AliESDv0 *fCurrentV0,Int_t fTrackLabel[2]);
71     AliKFParticle *GetNegativeKFParticle(AliESDv0 *fCurrentV0,Int_t fTrackLabel[2]);
72
73     Bool_t GetConversionPoint(const AliExternalTrackParam *pparam,const AliExternalTrackParam *nparam,Double_t convpos[3],Double_t dca[2]);
74     Bool_t GetHelixCenter(const AliExternalTrackParam *track,Double_t center[2]);
75     Double_t GetPsiPair(const AliESDv0* v0, const AliExternalTrackParam *positiveparam,const AliExternalTrackParam *negativeparam) const;
76
77     AliConversionCuts *fConversionCuts; // Pointer to the ConversionCut Selection
78     TClonesArray *fConversionGammas; // TClonesArray holding the reconstructed photons
79     Bool_t fUseImprovedVertex; // set flag to improve primary vertex estimation by adding photons
80     Bool_t fUseOwnXYZCalculation; //flag that determines if we use our own calculation of xyz (markus)
81     Bool_t fUseConstructGamma; //flag that determines if we use ConstructGamma method from AliKF
82     Bool_t kUseAODConversionPhoton; // set flag to use AOD instead of KF output format for photons
83     Bool_t fCreateAOD; // set flag for AOD creation
84     TString     fDeltaAODBranchName;// File where Gamma Conv AOD is located, if not in default AOD
85     TString fDeltaAODFilename; // set filename for delta/satellite aod
86     Bool_t fEventIsSelected;
87
88 private:
89     AliV0ReaderV1(AliV0ReaderV1 &original);
90     AliV0ReaderV1 &operator=(const AliV0ReaderV1 &ref);
91
92
93     ClassDef(AliV0ReaderV1,1)
94 };
95
96 inline void AliV0ReaderV1::SetConversionCuts(const TString cut){
97     if(fConversionCuts != NULL){
98         delete fConversionCuts;
99         fConversionCuts=NULL;
100     }
101     if(fConversionCuts == NULL){
102         fConversionCuts=new AliConversionCuts("V0ReaderCuts","V0ReaderCuts");
103         fConversionCuts->InitializeCutsFromCutString(cut.Data());
104     }
105 }
106
107
108 #endif