1 #ifndef ALIV0READERV1_H
2 #define ALIV0READERV1_H
4 #include "AliAnalysisTaskSE.h"
7 #include "AliConversionPhotonCuts.h"
8 #include "AliConvEventCuts.h"
9 #include "AliExternalTrackParam.h"
11 #include "AliMCEvent.h" // for CF
12 #include "AliESDEvent.h"
13 #include "AliKFParticle.h"
14 #include "TParticle.h"
16 #include "AliESDpid.h"
19 #include "AliAnalysisManager.h"
21 class AliConversionPhotonBase;
25 class AliKFConversionPhoton;
30 class AliAODConversionPhoton;
34 class AliV0ReaderV1 : public AliAnalysisTaskSE {
38 AliV0ReaderV1(const char *name="V0ReaderV1");
39 virtual ~AliV0ReaderV1(); //virtual destructor
40 void UserCreateOutputObjects();
41 virtual Bool_t Notify();
42 virtual void UserExec(Option_t *option);
43 virtual void Terminate(Option_t *);
46 Bool_t ProcessEvent(AliVEvent *inputEvent,AliMCEvent *mcEvent=NULL);
47 Bool_t IsEventSelected(){return fEventIsSelected;}
49 // Return Reconstructed Gammas
50 TClonesArray *GetReconstructedGammas(){return fConversionGammas;}
51 Int_t GetNReconstructedGammas(){if(fConversionGammas){return fConversionGammas->GetEntriesFast();}else{return 0;}}
53 AliConversionPhotonCuts *GetConversionCuts(){return fConversionCuts;}
54 AliConvEventCuts *GetEventCuts(){return fEventCuts;}
55 TList *GetCutHistograms(){if(fConversionCuts){return fConversionCuts->GetCutHistograms();}return NULL;}
56 TList *GetEventCutHistograms(){if(fEventCuts){return fEventCuts->GetCutHistograms();}return NULL;}
60 void SetConversionCuts(const TString cut);
61 void SetConversionCuts(AliConversionPhotonCuts *cuts){fConversionCuts=cuts;}
62 void SetEventCuts(const TString cut);
63 void SetEventCuts(AliConvEventCuts *cuts){fEventCuts=cuts;}
65 void SetUseOwnXYZCalculation(Bool_t flag){fUseOwnXYZCalculation=flag;}
66 void SetUseConstructGamma(Bool_t flag){fUseConstructGamma=flag;}
67 void SetUseAODConversionPhoton(Bool_t b){if(b){cout<<"Setting Outputformat to AliAODConversionPhoton "<<endl;}else{cout<<"Setting Outputformat to AliKFConversionPhoton "<<endl;};kUseAODConversionPhoton=b;}
68 void SetCreateAODs(Bool_t k=kTRUE){fCreateAOD=k;}
69 void SetDeltaAODFilename(TString s){fDeltaAODFilename=s;}
70 void SetDeltaAODBranchName(TString string) { fDeltaAODBranchName = string;AliInfo(Form("Set DeltaAOD BranchName to: %s",fDeltaAODBranchName.Data()));}
71 void RelabelAODs(Bool_t relabel=kTRUE){fRelabelAODs=relabel;}
72 Bool_t AreAODsRelabeled(){return fRelabelAODs;}
73 void RelabelAODPhotonCandidates(AliAODConversionPhoton *PhotonCandidate);
74 TString GetPeriodName(){return fPeriodName;}
75 Int_t GetNumberOfPrimaryTracks(){return fNumberOfPrimaryTracks;}
79 Bool_t ProcessESDV0s();
80 AliKFConversionPhoton *ReconstructV0(AliESDv0* fCurrentV0,Int_t currentV0Index);
82 void FindDeltaAODBranchName();
83 Bool_t GetAODConversionGammas();
87 const AliExternalTrackParam *GetExternalTrackParam(AliESDv0 *fCurrentV0,Int_t &tracklabel,Int_t charge);
88 const AliExternalTrackParam *GetExternalTrackParamP(AliESDv0 *fCurrentV0,Int_t &tracklabel){return GetExternalTrackParam(fCurrentV0,tracklabel,1);};
89 const AliExternalTrackParam *GetExternalTrackParamN(AliESDv0 *fCurrentV0,Int_t &tracklabel){return GetExternalTrackParam(fCurrentV0,tracklabel,-1);};
90 AliKFParticle *GetPositiveKFParticle(AliAODv0 *fCurrentV0,Int_t fTrackLabel[2]);
91 AliKFParticle *GetNegativeKFParticle(AliAODv0 *fCurrentV0,Int_t fTrackLabel[2]);
92 AliKFParticle *GetPositiveKFParticle(AliESDv0 *fCurrentV0,Int_t fTrackLabel[2]);
93 AliKFParticle *GetNegativeKFParticle(AliESDv0 *fCurrentV0,Int_t fTrackLabel[2]);
95 Bool_t GetConversionPoint(const AliExternalTrackParam *pparam,const AliExternalTrackParam *nparam,Double_t convpos[3],Double_t dca[2]);
96 Bool_t GetHelixCenter(const AliExternalTrackParam *track,Double_t center[2]);
97 Double_t GetPsiPair(const AliESDv0* v0, const AliExternalTrackParam *positiveparam,const AliExternalTrackParam *negativeparam) const;
99 AliConversionPhotonCuts *fConversionCuts; // Pointer to the ConversionCut Selection
100 AliConvEventCuts *fEventCuts; // Pointer to the ConversionCut Selection
101 TClonesArray *fConversionGammas; // TClonesArray holding the reconstructed photons
102 Bool_t fUseImprovedVertex; // set flag to improve primary vertex estimation by adding photons
103 Bool_t fUseOwnXYZCalculation; //flag that determines if we use our own calculation of xyz (markus)
104 Bool_t fUseConstructGamma; //flag that determines if we use ConstructGamma method from AliKF
105 Bool_t kUseAODConversionPhoton; // set flag to use AOD instead of KF output format for photons
106 Bool_t fCreateAOD; // set flag for AOD creation
107 TString fDeltaAODBranchName; // File where Gamma Conv AOD is located, if not in default AOD
108 TString fDeltaAODFilename; // set filename for delta/satellite aod
109 Bool_t fRelabelAODs; //
110 Bool_t fEventIsSelected;
111 Int_t fNumberOfPrimaryTracks; // Number of Primary Tracks in AOD or ESD
115 AliV0ReaderV1(AliV0ReaderV1 &original);
116 AliV0ReaderV1 &operator=(const AliV0ReaderV1 &ref);
119 ClassDef(AliV0ReaderV1, 4)
122 inline void AliV0ReaderV1::SetConversionCuts(const TString cut){
123 if(fConversionCuts != NULL){
124 delete fConversionCuts;
125 fConversionCuts=NULL;
127 if(fConversionCuts == NULL){
128 fConversionCuts=new AliConversionPhotonCuts("V0ReaderCuts","V0ReaderCuts");
129 fConversionCuts->InitializeCutsFromCutString(cut.Data());
133 inline void AliV0ReaderV1::SetEventCuts(const TString cut){
134 if(fEventCuts != NULL){
138 if(fEventCuts == NULL){
139 fEventCuts=new AliConvEventCuts("V0ReaderEventCuts","V0ReaderEventCuts");
140 fEventCuts->InitializeCutsFromCutString(cut.Data());