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