Added a new class for the AOD information
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / AliAnalysisTaskGammaConversion.h
index 68b828eb93e467217fbbfd47ff7c46559ed246ec..286116511fb2f3066da3f211aa1a692da81027b4 100644 (file)
-#ifndef ALIANALYSISTASKGAMMACONVERSION_H\r
-#define ALIANALYSISTASKGAMMACONVERSION_H\r
\r
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- * See cxx source for full Copyright notice                               */\r
-\r
-////////////////////////////////////////////////\r
-//--------------------------------------------- \r
-// Class used to do analysis on conversion pairs\r
-//---------------------------------------------\r
-////////////////////////////////////////////////\r
\r
-#include "AliAnalysisTaskSE.h"\r
-#include <vector>\r
-#include "AliV0Reader.h"\r
-\r
-class TNtuple;\r
-class AliGammaConversionHistograms;\r
-class AliESDv0;\r
-class AliKFParticle;\r
-class AliESDInputHandler;\r
-class AliESDEvent;\r
-class AliAODEvent;\r
-class TList;\r
-class AliStack;\r
-\r
-class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE\r
-{\r
- public:\r
-  AliAnalysisTaskGammaConversion();\r
-  AliAnalysisTaskGammaConversion(const char* name);\r
-  virtual ~AliAnalysisTaskGammaConversion() ;// virtual destructor\r
\r
-  // Implementation of interface methods\r
-  virtual void UserCreateOutputObjects();\r
-  virtual void Init();\r
-  virtual void LocalInit() {Init();}\r
-  virtual void Exec(Option_t *option);\r
-  virtual void Terminate(Option_t *option);\r
-  virtual void ConnectInputData(Option_t *);\r
-       \r
-  void ProcessMCData();\r
-  void ProcessV0sNoCut();\r
-  void ProcessV0s();\r
-  void ProcessGammasForNeutralMesonAnalysis();\r
-  void SetHistograms(AliGammaConversionHistograms *const histograms){fHistograms=histograms;}\r
-  void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;}\r
-  void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;}\r
-  void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;}\r
-  void SetGammaWidth(Double_t gammaWidth){fGammaWidth = gammaWidth;}\r
-  void SetPi0Mass(Double_t pi0Mass){fPi0Mass = pi0Mass;}\r
-  void SetPi0Width(Double_t pi0Width){fPi0Width = pi0Width;}\r
-  void SetEtaMass(Double_t etaMass){fEtaMass = etaMass;}\r
-  void SetEtaWidth(Double_t etaWidth){fEtaWidth = etaWidth;}\r
-  void SetMinOpeningAngleGhostCut(Double_t ghostCut){fMinOpeningAngleGhostCut = ghostCut;}\r
-  void SetV0Reader(AliV0Reader* const reader){fV0Reader=reader;}\r
-  void SetCalculateBackground(Bool_t bg){fCalculateBackground=bg;}\r
-  void CalculateBackground();\r
-  void SetWriteNtuple(Bool_t writeNtuple){fWriteNtuple = writeNtuple;}\r
-  void FillNtuple();\r
-  Double_t GetMCOpeningAngle(TParticle* const daughter0, TParticle* const daughter1) const;\r
-  void CheckV0Efficiency();\r
-\r
-\r
-  //////////////////Chi_c Analysis////////////////////////////\r
-  void GetPID(AliESDtrack *track, Stat_t &pid, Stat_t &weight);        \r
-  double GetSigmaToVertex(AliESDtrack* t);\r
-  void ElectronBackground(TString hBg, vector <TLorentzVector> e);\r
-  void FillAngle(TString histoName,vector <TLorentzVector> tlVeNeg, vector <TLorentzVector> tlVePos);\r
-  void FillElectronInvMass(TString histoName, vector <TLorentzVector> negativeElectron, \r
-       vector <TLorentzVector> positiveElectron);\r
-  void FillGammaElectronInvMass(TString histoMass,TString histoDiff,vector <AliKFParticle> fKFGammas,\r
-        vector <TLorentzVector> tlVeNeg,vector<TLorentzVector> tlVePos);\r
-  void CleanWithAngleCuts(vector <AliESDtrack*> negativeElectrons,\r
-       vector <AliESDtrack*> positiveElectrons, vector <AliKFParticle> gammas);\r
-  vector <TLorentzVector> GetTLorentzVector(vector <AliESDtrack*> esdTrack);   \r
-  void ProcessGammaElectronsForChicAnalysis();\r
-  ///////////////////////////////////////////////////////////////\r
-\r
-\r
-\r
- private:\r
-  AliAnalysisTaskGammaConversion(const AliAnalysisTaskGammaConversion&); // Not implemented\r
-  AliAnalysisTaskGammaConversion& operator=(const AliAnalysisTaskGammaConversion&); // Not implemented\r
-\r
-  AliV0Reader* fV0Reader; // The V0 reader object \r
-\r
-  AliStack * fStack; // pointer to the MC particle stack\r
-  AliESDEvent* fESDEvent; //pointer to the ESDEvent\r
-  TList * fOutputContainer ; // Histogram container\r
-\r
-  AliGammaConversionHistograms *fHistograms; // Pointer to the histogram handling class\r
-\r
-  Bool_t fDoMCTruth; // Flag to switch on/off MC truth \r
-    \r
-  vector<TParticle*> fMCAllGammas; // vector containing all MC gammas\r
-  vector<TParticle*> fMCPi0s; //vector containing all MC Pi0s\r
-  vector<TParticle*> fMCEtas; //vector containing all MC Etas\r
-  vector<TParticle*> fMCGammaChic; //vector containing all MC Chi_c's\r
-\r
-  vector<AliKFParticle> fKFReconstructedGammas; // vector containing all reconstructed gammas\r
-  vector<Bool_t> fIsTrueReconstructedGammas;    // vector containing information if this was a true gamma or not (follows the index of fKFReconstructedGammas)\r
-  vector<Int_t> fElectronv1; // vector containing index of electron 1\r
-  vector<Int_t> fElectronv2; // vector containing index of electron 2\r
-\r
-  ///////Chi_c Analysis///////////////////////////\r
-  vector<AliESDtrack*> fCurrentEventPosElectron;       // comment here\r
-  vector<AliESDtrack*> fPreviousEventPosElectron;      //comment here\r
-  vector<AliESDtrack*> fCurrentEventNegElectron;       //comment here\r
-  vector<AliESDtrack*> fPreviousEventNegElectron;      //comment here\r
-  vector<AliKFParticle> fKFReconstructedGammasCut;     //comment here\r
-  vector<TLorentzVector> fPreviousEventTLVNegElectron; //comment here\r
-  vector<TLorentzVector> fPreviousEventTLVPosElectron; //comment here\r
-  //////////////////////////////////////////////////   \r
-\r
-  //mass defines\r
-  Double_t fElectronMass; //electron mass\r
-  Double_t fGammaMass;    //gamma mass\r
-  Double_t fPi0Mass;      //pi0mass\r
-  Double_t fEtaMass;      //eta mass\r
-\r
-  // width defines\r
-  Double_t fGammaWidth; //gamma width cut\r
-  Double_t fPi0Width;   // pi0 width cut\r
-  Double_t fEtaWidth;   // eta width cut\r
-\r
-  Double_t fMinOpeningAngleGhostCut; // minimum angle cut\r
-\r
-  Bool_t fCalculateBackground; //flag to set backgrount calculation on/off\r
-  Bool_t fWriteNtuple;         // flag to set if writing to ntuple on/off\r
-  TNtuple *fGammaNtuple;       // Ntuple for gamma values\r
-  TNtuple *fNeutralMesonNtuple;// NTuple for mesons\r
-\r
-  Int_t fTotalNumberOfAddedNtupleEntries; // number of added ntuple entries\r
-\r
-  ClassDef(AliAnalysisTaskGammaConversion, 3); // Analysis task for gamma conversions\r
-};\r
\r
-#endif //ALIANALYSISTASKGAMMA_H\r
+#ifndef ALIANALYSISTASKGAMMACONVERSION_H
+#define ALIANALYSISTASKGAMMACONVERSION_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+////////////////////////////////////////////////
+//--------------------------------------------- 
+// Class used to do analysis on conversion pairs
+//---------------------------------------------
+////////////////////////////////////////////////
+#include "AliAnalysisTaskSE.h"
+#include <vector>
+#include "AliV0Reader.h"
+#include "AliGammaConversionAODObject.h"
+
+class TNtuple;
+class AliGammaConversionHistograms;
+class AliESDv0;
+class AliKFParticle;
+class AliESDInputHandler;
+class AliESDEvent;
+class AliAODEvent;
+class TList;
+class AliStack;
+class AliESDtrackCuts;
+
+
+class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
+{
+ public:
+  AliAnalysisTaskGammaConversion();
+  AliAnalysisTaskGammaConversion(const char* name);
+  virtual ~AliAnalysisTaskGammaConversion() ;// virtual destructor
+  // Implementation of interface methods
+  virtual void UserCreateOutputObjects();
+  virtual void Init();
+  virtual void LocalInit() {Init();}
+  virtual void Exec(Option_t *option);
+  virtual void Terminate(Option_t *option);
+  virtual void ConnectInputData(Option_t *);
+       
+  void ProcessMCData();
+  void ProcessV0sNoCut();
+  void ProcessV0s();
+  void ProcessGammasForNeutralMesonAnalysis();
+
+  // AOD
+  TString GetAODBranchName() const {return  fAODBranchName;}
+  void SetAODBranchName(TString name)  {fAODBranchName = name ;}       
+  void FillAODWithConversionGammas();
+  // end AOD
+
+
+ // for GammaJetAnalysis
+  void ProcessGammasForGammaJetAnalysis();
+  void CreateListOfChargedParticles();
+  Double_t GetMinimumDistanceToCharge(Int_t);
+  void CalculateJetCone(Int_t,Int_t);
+  Int_t GetIndexHighestPtGamma();
+  void SetESDtrackCuts();
+  // end of Gamma Jet
+
+  void SetMinPtForGammaJet(Double_t minPtForGammaJet){fMinPtForGammaJet=minPtForGammaJet;}
+  void SetMinIsoConeSize(Double_t minIsoConeSize){fMinIsoConeSize=minIsoConeSize;}
+  void SetMinPtIsoCone(Double_t minPtIsoCone){fMinPtIsoCone=minPtIsoCone;}
+  void SetMinPtGamChargedCorr(Double_t minPtGamChargedCorr){fMinPtGamChargedCorr=minPtGamChargedCorr;}
+  void SetMinPtJetCone(Double_t minPtJetCone){fMinPtJetCone=minPtJetCone;}
+
+  void SetHistograms(AliGammaConversionHistograms *const histograms){fHistograms=histograms;}
+  void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;}
+  void SetDoNeutralMeson(Bool_t flag){fDoNeutralMeson=flag;}
+  void SetDoJet(Bool_t flag){fDoJet=flag;}
+  void SetDoChic(Bool_t flag){fDoChic=flag;}
+
+  void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;}
+  void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;}
+  void SetGammaWidth(Double_t gammaWidth){fGammaWidth = gammaWidth;}
+  void SetPi0Mass(Double_t pi0Mass){fPi0Mass = pi0Mass;}
+  void SetPi0Width(Double_t pi0Width){fPi0Width = pi0Width;}
+  void SetEtaMass(Double_t etaMass){fEtaMass = etaMass;}
+  void SetEtaWidth(Double_t etaWidth){fEtaWidth = etaWidth;}
+  void SetMinOpeningAngleGhostCut(Double_t ghostCut){fMinOpeningAngleGhostCut = ghostCut;}
+  void SetV0Reader(AliV0Reader* const reader){fV0Reader=reader;}
+  void SetCalculateBackground(Bool_t bg){fCalculateBackground=bg;}
+  void CalculateBackground();
+  void SetWriteNtuple(Bool_t writeNtuple){fWriteNtuple = writeNtuple;}
+  void FillNtuple();
+  Double_t GetMCOpeningAngle(TParticle* const daughter0, TParticle* const daughter1) const;
+  void CheckV0Efficiency();
+
+
+  //////////////////Chi_c Analysis////////////////////////////
+  void GetPID(AliESDtrack *track, Stat_t &pid, Stat_t &weight);        
+  double GetSigmaToVertex(AliESDtrack* t);
+  void ElectronBackground(TString hBg, vector <TLorentzVector> e);
+  void FillAngle(TString histoName,vector <TLorentzVector> tlVeNeg, vector <TLorentzVector> tlVePos);
+  void FillElectronInvMass(TString histoName, vector <TLorentzVector> negativeElectron, 
+       vector <TLorentzVector> positiveElectron);
+  void FillGammaElectronInvMass(TString histoMass,TString histoDiff,vector <AliKFParticle> fKFGammas,
+        vector <TLorentzVector> tlVeNeg,vector<TLorentzVector> tlVePos);
+  void CleanWithAngleCuts(vector <AliESDtrack*> negativeElectrons,
+       vector <AliESDtrack*> positiveElectrons, vector <AliKFParticle> gammas);
+  vector <TLorentzVector> GetTLorentzVector(vector <AliESDtrack*> esdTrack);   
+  void ProcessGammaElectronsForChicAnalysis();
+  ///////////////////////////////////////////////////////////////
+
+
+
+ private:
+  AliAnalysisTaskGammaConversion(const AliAnalysisTaskGammaConversion&); // Not implemented
+  AliAnalysisTaskGammaConversion& operator=(const AliAnalysisTaskGammaConversion&); // Not implemented
+
+  AliV0Reader* fV0Reader; // The V0 reader object 
+
+  AliStack * fStack; // pointer to the MC particle stack
+  AliESDEvent* fESDEvent; //pointer to the ESDEvent
+  TList * fOutputContainer ; // Histogram container
+
+  AliGammaConversionHistograms *fHistograms; // Pointer to the histogram handling class
+
+  Bool_t fDoMCTruth; // Flag to switch on/off MC truth 
+  Bool_t fDoNeutralMeson;
+  Bool_t fDoJet;
+  Bool_t fDoChic;
+    
+  vector<TParticle*> fMCAllGammas; // vector containing all MC gammas
+  vector<TParticle*> fMCPi0s; //vector containing all MC Pi0s
+  vector<TParticle*> fMCEtas; //vector containing all MC Etas
+  vector<TParticle*> fMCGammaChic; //vector containing all MC Chi_c's
+
+  vector<AliKFParticle> fKFReconstructedGammas; // vector containing all reconstructed gammas
+  vector<Bool_t> fIsTrueReconstructedGammas;    // vector containing information if this was a true gamma or not (follows the index of fKFReconstructedGammas)
+  vector<Int_t> fElectronv1; // vector containing index of electron 1
+  vector<Int_t> fElectronv2; // vector containing index of electron 2
+
+  ///////Chi_c Analysis///////////////////////////
+  vector<AliESDtrack*> fCurrentEventPosElectron;       // comment here
+  vector<AliESDtrack*> fPreviousEventPosElectron;      //comment here
+  vector<AliESDtrack*> fCurrentEventNegElectron;       //comment here
+  vector<AliESDtrack*> fPreviousEventNegElectron;      //comment here
+  vector<AliKFParticle> fKFReconstructedGammasCut;     //comment here
+  vector<TLorentzVector> fPreviousEventTLVNegElectron; //comment here
+  vector<TLorentzVector> fPreviousEventTLVPosElectron; //comment here
+  //////////////////////////////////////////////////   
+
+  //mass defines
+  Double_t fElectronMass; //electron mass
+  Double_t fGammaMass;    //gamma mass
+  Double_t fPi0Mass;      //pi0mass
+  Double_t fEtaMass;      //eta mass
+
+  // width defines
+  Double_t fGammaWidth; //gamma width cut
+  Double_t fPi0Width;   // pi0 width cut
+  Double_t fEtaWidth;   // eta width cut
+
+  Double_t fMinOpeningAngleGhostCut; // minimum angle cut
+
+  AliESDtrackCuts* fEsdTrackCuts;           // Object containing the parameters of the esd track cuts
+
+  Bool_t fCalculateBackground; //flag to set backgrount calculation on/off
+  Bool_t fWriteNtuple;         // flag to set if writing to ntuple on/off
+  TNtuple *fGammaNtuple;       // Ntuple for gamma values
+  TNtuple *fNeutralMesonNtuple;// NTuple for mesons
+
+  Int_t fTotalNumberOfAddedNtupleEntries; // number of added ntuple entries
+
+  vector<AliESDtrack*> fChargedParticles;
+  vector<Int_t> fChargedParticlesId;
+
+  Double_t fGammaPtHighest;
+  Double_t fMinPtForGammaJet;
+  Double_t fMinIsoConeSize;
+  Double_t fMinPtIsoCone;
+  Double_t fMinPtGamChargedCorr;
+  Double_t fMinPtJetCone;
+  Int_t    fLeadingChargedIndex;
+
+  TClonesArray* fAODBranch ;        //! selected particles branch
+  TString fAODBranchName; // New AOD branch name
+  
+  vector<AliGammaConversionAODObject> fAODObjects;
+
+  ClassDef(AliAnalysisTaskGammaConversion, 4); // Analysis task for gamma conversions
+};
+#endif //ALIANALYSISTASKGAMMA_H