<commit_before>#ifndef AliAnalysisTaskNetLambdaIdent_h
#define AliAnalysisTaskNetLambdaIdent_h

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

// Analysis task for net-lambda fluctuations analysis
// Author: <NAME> (<EMAIL>)

#include "AliAnalysisTaskSE.h"
//#include "AliNetLambdaHelper.h"
class TList;
class AliESDEvent;
class AliESDtrack;
class AliAODTrack;
//class AliExternalTrackParam;
class AliAnalysisUtils;
class AliPIDResponse;
class TTree;
class TH1;
class TH2;
class TH3;
class TH3F;
class TOBjArray;
class AliVVertex;
class AliAODv0;
class AliESDv0;
class AliEventPoolManager;
class AliLightV0;
//class AliAnalysisTaskWeakDecayVertexer;
#include "AliEventCuts.h"
#include "AliExternalTrackParam.h"
#include "TArrayF.h"

class AliAnalysisTaskNetLambdaIdent : public AliAnalysisTaskSE {
 public:
  AliAnalysisTaskNetLambdaIdent(const char* name="AliAnalysisTaskNetLambdaIdent");
  virtual ~AliAnalysisTaskNetLambdaIdent(){};
  virtual void UserCreateOutputObjects();
  virtual void UserExec(Option_t *option);

  void Tracks2V0vertices(TClonesArray* fv0s, TObjArray* ev1, TObjArray* ev2, Bool_t mixing, AliVVertex *vtxT3D, Double_t b);
  Bool_t TrackCutsForTreeAOD(AliAODTrack* trk);
  Bool_t TrackCutsForTreeESD(AliESDtrack* trk);
  Bool_t V0CutsForTreeAOD(AliAODv0* v0, Double_t* vt);
  Bool_t V0CutsForTreeESD(AliESDv0* v0, Double_t* vt, AliExternalTrackParam* ptrk, AliExternalTrackParam* ntrk, Double_t b);
  Int_t IsGenLambda(Int_t poslabel, Int_t neglabel, Float_t pt, Float_t &mpt, Float_t &meta, Float_t &cascpt, Float_t &casceta);
  Double_t GetDCAV0Dau( AliExternalTrackParam *pt, AliExternalTrackParam *nt, Double_t &xp, Double_t &xn, Double_t b, Double_t lNegMassForTracking, Double_t lPosMassForTracking);
  void GetHelixCenter(const AliExternalTrackParam *track,Double_t center[2], Double_t b);
  void Evaluate(const Double_t *h, Double_t t, Double_t r[3], Double_t g[3], Double_t gg[3]);
  // event cuts
  void SetCentCut(Float_t cut){centcut = cut;};
  // daughter track cuts
  void SetCrossedRowsCut(Float_t rows, Float_t ratio){ncrossedrowscut = rows; crossedrowsclustercut = ratio;};
  void SetImpParamCut(Double_t cut){fDmin = cut;};
  // v0 cuts
  void SetPtMinLambda(Float_t pt){ptminlambda = pt;};
  void SetPtMaxLambda(Float_t pt){ptmaxlambda = pt;};
  void SetEtaCutLambda(Float_t eta){etacutlambda = eta;};
  void SetCosPACut(Double_t cut){fCPAmin = cut;};
  void SetRadiusCuts(Double_t mincut, Double_t maxcut){fRmin = mincut; fRmax = maxcut;};
  void SetDCADaughterCut(Double_t cut){fDCAmax = cut;};
  void SetChi2Cut(Double_t cut){fChi2max = cut;};
  void SetMinPionDCA(Float_t cut){minpiondca = cut;};
  void SetGammaCuts(Float_t cutmass, Float_t cutpt){gammamasscut = cutmass; gammaptcut = cutpt;};
  
  void SetIsMC(Bool_t val){fIsMC = val;};
  Bool_t GetIsMC(){return fIsMC;};
  void SetIsAOD(Bool_t val){fIsAOD = val;};
  Bool_t GetIsAOD(){return fIsAOD;};
  void SetEventSelection(UInt_t val) {fEvSel = val;}
  void MakeLambdaTree(Bool_t val){fLambdaTree = val;};
  void MakeEventMixingTree(Bool_t val){fEventMixingTree = val;};
  void MakeCascadeTree(Bool_t val){fCascadeTree = val;};
  void DoRevertexing(Bool_t val){fRevertex = val;};
  void SetMaxMixTracks(Int_t val){nmaxmixtracks = val;};
  void SetMaxMixEvents(Int_t val){nmaxmixevents = val;};

 protected:
  AliAnalysisTaskNetLambdaIdent(const  AliAnalysisTaskNetLambdaIdent &task);
  AliAnalysisTaskNetLambdaIdent& operator=(const  AliAnalysisTaskNetLambdaIdent &task);
  
  AliESDEvent* fESD;
  AliAODEvent* fAOD;
  //AliAnalysisUtils* fUtils;   //! analysis utils to detect pileup
  AliPIDResponse* fPIDResponse; // points to class for PID
  AliEventCuts fEventCuts;      /// Event cuts
  TList* fListOfHistos;         //! list of output histograms
  TTree* fTree;                 //! output tree

  TH1I*  hEventStatistics;      //! cut-by-cut counter of events

  AliEventPoolManager*     fPoolMgr;         // event pool manager
  
  TH1F* hGenPt;
  TH1F* hGenPhi;
  TH1F* hGenEta;
  TH1F* hTrackPt;
  TH1F* hTrackPhi;
  TH1F* hTrackEta;
  TH1F* hNTracksEsd;
  TH2F* hNSigmaProton;
  TH2F* hArmPod;

  TH2F* hVxVy;
      
  TH1F*  hLambdaPtGen;
  TH1F*  hAntiLambdaPtGen;
  TH1F*  hLambdaPtReco;
  TH1F*  hAntiLambdaPtReco;
  
  TH2F*  hInvMassLambda;
  TH2F*  hInvMassAntiLambda;
  TH2F*  hInvMassLambdaOnTheFly;
  TH2F*  hInvMassAntiLambdaOnTheFly;
  TH2F*  hInvMassLambdaReco;
  TH2F*  hInvMassAntiLambdaReco;
  TH2F*  hInvMassLambdaSecFromMaterial;
  TH2F*  hInvMassAntiLambdaSecFromMaterial;
  TH2F*  hInvMassLambdaSecFromWeakDecay;
  TH2F*  hInvMassAntiLambdaSecFromWeakDecay;
  TH2F*  hInvMassLike;
  TH2F*  hInvMassLambdaK0S;
  TH2F*  hInvMassAntiLambdaK0S;
  TH2F*  hInvMassLambdaConversions;
  TH2F*  hInvMassAntiLambdaConversions;
  //TH3F*  hInvMassPtPidLambda;
  //TH3F*  hInvMassPtPidAntiLambda;

  TH3F* hXiPlus;
  TH3F* hXiMinus;
  TH3F* hXiZero;
  TH3F* hXiZeroAnti;

  TH2F* hPtResLambda;
  TH2F* hPtResAntiLambda;
  TH2F* hPtResLambdaPrim;
  TH2F* hPtResAntiLambdaPrim;
  
  // kinematic cuts
  Float_t centcut;
  Float_t ptminlambda;
  Float_t ptmaxlambda;
  Float_t etacutlambda;
  Float_t ncrossedrowscut;
  Float_t crossedrowsclustercut;

  Float_t fCentV0M;
  Float_t fCentCL1;
  Float_t fMultV0M;
  Float_t fNtracksTPCout;
  Double_t fVtxZ;
  Int_t fRunNumber;
  TClonesArray *fAcceptV0; //!
  //TClonesArray *fAcceptV0test; //!
  TClonesArray *fAcceptCascade;
  TClonesArray *fGenLambda; //!
  TClonesArray *fGenCascade; //!
  TClonesArray *fMixV0; //!

  Bool_t fIsMC;
  Bool_t fIsAOD;
  UInt_t fEvSel;
  Bool_t fLambdaTree;
  Bool_t fEventMixingTree;
  Bool_t fCascadeTree;
  Bool_t fRevertex;
  Int_t nmaxmixtracks;
  Int_t nmaxmixevents;

  Double_t fChi2max;      //max chi2
  Double_t fDmin;//0.05;  //min imp parameter for the 1st daughter
  Double_t fDCAmax;//1.5; //max DCA between the daughter tracks
  Double_t fCPAmin;//0.9; //min cosine of V0's pointing angle
  Double_t fRmin;         //min radius of the fiducial volume<commit_msg>Bugfix<commit_after>#ifndef AliAnalysisTaskNetLambdaIdent_h
#define AliAnalysisTaskNetLambdaIdent_h

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

// Analysis task for net-lambda fluctuations analysis
// Author: <NAME> (<EMAIL>)

#include "AliAnalysisTaskSE.h"
//#include "AliNetLambdaHelper.h"
class TList;
class AliESDEvent;
class AliESDtrack;
class AliAODTrack;
//class AliExternalTrackParam;
class AliAnalysisUtils;
class AliPIDResponse;
class TTree;
class TH1;
class TH2;
class TH3;
class TH3F;
class TOBjArray;
class AliVVertex;
class AliAODv0;
class AliESDv0;
class AliEventPoolManager;
class AliLightV0;
//class AliAnalysisTaskWeakDecayVertexer;
#include "AliEventCuts.h"
#include "AliExternalTrackParam.h"
#include "TArrayF.h"

class AliAnalysisTaskNetLambdaIdent : public AliAnalysisTaskSE {
 public:
  AliAnalysisTaskNetLambdaIdent(const char* name="AliAnalysisTaskNetLambdaIdent");
  virtual ~AliAnalysisTaskNetLambdaIdent(){};
  virtual void UserCreateOutputObjects();
  virtual void UserExec(Option_t *option);

  void Tracks2V0vertices(TClonesArray* fv0s, TObjArray* ev1, TObjArray* ev2, Bool_t mixing, AliVVertex *vtxT3D, Double_t b);
  Bool_t TrackCutsForTreeAOD(AliAODTrack* trk);
  Bool_t TrackCutsForTreeESD(AliESDtrack* trk);
  Bool_t V0CutsForTreeAOD(AliAODv0* v0, Double_t* vt);
  Bool_t V0CutsForTreeESD(AliESDv0* v0, Double_t* vt, AliExternalTrackParam* ptrk, AliExternalTrackParam* ntrk, Double_t b);
  Int_t IsGenLambda(Int_t poslabel, Int_t neglabel, Float_t pt, Float_t &mpt, Float_t &meta, Float_t &cascpt, Float_t &casceta);
  Double_t GetDCAV0Dau( AliExternalTrackParam *pt, AliExternalTrackParam *nt, Double_t &xp, Double_t &xn, Double_t b, Double_t lNegMassForTracking, Double_t lPosMassForTracking);
  void GetHelixCenter(const AliExternalTrackParam *track,Double_t center[2], Double_t b);
  void Evaluate(const Double_t *h, Double_t t, Double_t r[3], Double_t g[3], Double_t gg[3]);
  // event cuts
  void SetCentCut(Float_t cut){centcut = cut;};
  // daughter track cuts
  void SetCrossedRowsCut(Float_t rows, Float_t ratio){ncrossedrowscut = rows; crossedrowsclustercut = ratio;};
  void SetImpParamCut(Double_t cut){fDmin = cut;};
  // v0 cuts
  void SetPtMinLambda(Float_t pt){ptminlambda = pt;};
  void SetPtMaxLambda(Float_t pt){ptmaxlambda = pt;};
  void SetEtaCutLambda(Float_t eta){etacutlambda = eta;};
  void SetCosPACut(Double_t cut){fCPAmin = cut;};
  void SetRadiusCuts(Double_t mincut, Double_t maxcut){fRmin = mincut; fRmax = maxcut;};
  void SetDCADaughterCut(Double_t cut){fDCAmax = cut;};
  void SetChi2Cut(Double_t cut){fChi2max = cut;};
  void SetMinPionDCA(Float_t cut){minpiondca = cut;};
  void SetGammaCuts(Float_t cutmass, Float_t cutpt){gammamasscut = cutmass; gammaptcut = cutpt;};
  
  void SetIsMC(Bool_t val){fIsMC = val;};
  Bool_t GetIsMC(){return fIsMC;};
  void SetIsAOD(Bool_t val){fIsAOD = val;};
  Bool_t GetIsAOD(){return fIsAOD;};
  void SetEventSelection(UInt_t val) {fEvSel = val;}
  void MakeLambdaTree(Bool_t val){fLambdaTree = val;};
  void MakeEventMixingTree(Bool_t val){fEventMixingTree = val;};
  void MakeCascadeTree(Bool_t val){fCascadeTree = val;};
  void DoRevertexing(Bool_t val){fRevertex = val;};
  void SetMaxMixTracks(Int_t val){nmaxmixtracks = val;};
  void SetMaxMixEvents(Int_t val){nmaxmixevents = val;};

 protected:
  AliAnalysisTaskNetLambdaIdent(const  AliAnalysisTaskNetLambdaIdent &task);
  AliAnalysisTaskNetLambdaIdent& operator=(const  AliAnalysisTaskNetLambdaIdent &task);
  
  AliESDEvent* fESD;
  AliAODEvent* fAOD;
  //AliAnalysisUtils* fUtils;   //! analysis utils to detect pileup
  AliPIDResponse* fPIDResponse; // points to class for PID
  AliEventCuts fEventCuts;      /// Event cuts
  TList* fListOfHistos;         //! list of output histograms
  TTree* fTree;                 //! output tree

  TH1I*  hEventStatistics;      //! cut-by-cut counter of events

  AliEventPoolManager*     fPoolMgr;         // event pool manager
  
  TH1F* hGenPt;
  TH1F* hGenPhi;
  TH1F* hGenEta;
  TH1F* hTrackPt;
  TH1F* hTrackPhi;
  TH1F* hTrackEta;
  TH1F* hNTracksEsd;
  TH2F* hNSigmaProton;
  TH2F* hArmPod;

  TH2F* hVxVy;
      
  TH1F*  hLambdaPtGen;
  TH1F*  hAntiLambdaPtGen;
  TH1F*  hLambdaPtReco;
  TH1F*  hAntiLambdaPtReco;
  
  TH2F*  hInvMassLambda;
  TH2F*  hInvMassAntiLambda;
  TH2F*  hInvMassLambdaOnTheFly;
  TH2F*  hInvMassAntiLambdaOnTheFly;
  TH2F*  hInvMassLambdaReco;
  TH2F*  hInvMassAntiLambdaReco;
  TH2F*  hInvMassLambdaSecFromMaterial;
  TH2F*  hInvMassAntiLambdaSecFromMaterial;
  TH2F*  hInvMassLambdaSecFromWeakDecay;
  TH2F*  hInvMassAntiLambdaSecFromWeakDecay;
  TH2F*  hInvMassLike;
  TH2F*  hInvMassLambdaK0S;
  TH2F*  hInvMassAntiLambdaK0S;
  TH2F*  hInvMassLambdaConversions;
  TH2F*  hInvMassAntiLambdaConversions;
  //TH3F*  hInvMassPtPidLambda;
  //TH3F*  hInvMassPtPidAntiLambda;

  TH3F* hXiPlus;
  TH3F* hXiMinus;
  TH3F* hXiZero;
  TH3F* hXiZeroAnti;

  TH2F* hPtResLambda;
  TH2F* hPtResAntiLambda;
  TH2F* hPtResLambdaPrim;
  TH2F* hPtResAntiLambdaPrim;
  
  // kinematic cuts
  Float_t centcut;
  Float_t ptminlambda;
  Float_t ptmaxlambda;
  Float_t etacutlambda;
  Float_t ncrossedrowscut;
  Float_t crossedrowsclustercut;

  Float_t fCentV0M;
  Float_t fCentCL1;
  Float_t fMultV0M;
  Float_t fNtracksTPCout;
  Double_t fVtxZ;
  Int_t fRunNumber;
  TClonesArray *fAcceptV0; //!
  //TClonesArray *fAcceptV0test; //!
  TClonesArray *fAcceptCascade; //!
  TClonesArray *fGenLambda; //!
  TClonesArray *fGenCascade; //!
  TClonesArray *fMixV0; //!

  Bool_t fIsMC;
  Bool_t fIsAOD;
  UInt_t fEvSel;
  Bool_t fLambdaTree;
  Bool_t fEventMixingTree;
  Bool_t fCascadeTree;
  Bool_t fRevertex;
  Int_t nmaxmixtracks;
  Int_t nmaxmixevents;

  Double_t fChi2max;      //max chi2
  Double_t fDmin;//0.05;  //min imp parameter for the 1st daughter
  Double_t fDCAmax;//1.5; //max DCA between the daughter tracks
  Double_t fCPAmin;//0.9; //min cosine of V0's pointing angle
  Double_t fRmin;         //min radius of the fiducial volume
{'fraction_non_alphanumeric': 0.09353699597602036, 'fraction_numerical': 0.01543894226821056, 'mean_word_length': 4.8491834774255524, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3013418', 'n_tokens_mistral': 4858, 'n_tokens_neox': 4706, 'n_words': 1021}