ROOT logo
/**************************************************************************
 AliFemtoSimpleAnalysis - the most basic analysis there is.
 Most others (e.g. AliFemtoVertexAnalysis) wrap this one.
**************************************************************************/

#ifndef ALIFEMTO_SIMPLE_ANALYSIS_H
#define ALIFEMTO_SIMPLE_ANALYSIS_H
//#ifndef StMaker_H
//#include "StMaker.h"
//#endif

#include "AliFemtoAnalysis.h"        // base analysis class
#include "AliFemtoPairCut.h"     
#include "AliFemtoEventCut.h"
#include "AliFemtoParticleCut.h"
#include "AliFemtoCorrFctn.h"
#include "AliFemtoCorrFctnCollection.h"
#include "AliFemtoPicoEventCollection.h"
#include "AliFemtoParticleCollection.h"
#include "AliFemtoPicoEvent.h"
#include "AliFemtoV0SharedDaughterCut.h"

class AliFemtoPicoEventCollectionVectorHideAway;

class AliFemtoSimpleAnalysis : public AliFemtoAnalysis {

  // friend class AliFemtoLikeSignAnalysis;

 public:
  AliFemtoSimpleAnalysis();
  AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& OriginalAnalysis);  // copy constructor
  virtual ~AliFemtoSimpleAnalysis();

  AliFemtoSimpleAnalysis& operator=(const AliFemtoSimpleAnalysis& aAna);

  // Gets and Sets

  virtual AliFemtoPairCut*       PairCut();
  virtual AliFemtoEventCut*      EventCut();
  virtual AliFemtoParticleCut*   FirstParticleCut();
  virtual AliFemtoParticleCut*   SecondParticleCut();

  AliFemtoCorrFctnCollection* CorrFctnCollection();
  virtual AliFemtoCorrFctn* CorrFctn(int n);     // Access to CFs within the collection
  void AddCorrFctn(AliFemtoCorrFctn* AnotherCorrFctn);

  void SetPairCut(AliFemtoPairCut* ThePairCut);
  void SetEventCut(AliFemtoEventCut* TheEventCut);
  void SetFirstParticleCut(AliFemtoParticleCut* TheFirstParticleCut);
  void SetSecondParticleCut(AliFemtoParticleCut* TheSecondParticleCut);

  void SetMinSizePartCollection(unsigned int minSize);

  void SetVerboseMode(Bool_t aVerbose);
  
  void SetV0SharedDaughterCut(Bool_t aPerform);
  bool V0SharedDaughterCut();

  unsigned int NumEventsToMix() const;
  void SetNumEventsToMix(const unsigned int& NumberOfEventsToMix);
  AliFemtoPicoEvent* CurrentPicoEvent();
  AliFemtoPicoEventCollection* MixingBuffer();
  bool MixingBufferFull();

  bool AnalyzeIdenticalParticles() const;
  virtual AliFemtoString Report();       //! returns reports of all cuts applied and correlation functions being done
  virtual TList* ListSettings();         // return list of cut settings for the analysis
  virtual TList* GetOutputList();        // Return a TList of objects to be written as output
  
  virtual void EventBegin(const AliFemtoEvent* TheEventToBegin); // startup for EbyE
  virtual void ProcessEvent(const AliFemtoEvent* EventToProcess);
  virtual void EventEnd(const AliFemtoEvent* TheEventToWrapUp);   // cleanup for EbyE
  int GetNeventsProcessed() const;

  virtual void Finish();

#ifdef __ROOT__
  ClassDef(AliFemtoSimpleAnalysis, 0)
#endif 


 protected:

  void AddEventProcessed();
  void MakePairs(const char* type, 
		 AliFemtoParticleCollection* ParticlesPassingCut1,
		 AliFemtoParticleCollection* ParticlesPssingCut2=0);

  AliFemtoPicoEventCollectionVectorHideAway* fPicoEventCollectionVectorHideAway; //! Mixing Buffer used for Analyses which wrap this one 

  AliFemtoPairCut*             fPairCut;             //  cut applied to pairs 
  AliFemtoCorrFctnCollection*  fCorrFctnCollection;  //  correlation functions of this analysis 
  AliFemtoEventCut*            fEventCut;            //  cut to select events 
  AliFemtoParticleCut*         fFirstParticleCut;    //  select particles of type #1 
  AliFemtoParticleCut*         fSecondParticleCut;   //  select particles of type #2 
  AliFemtoPicoEventCollection* fMixingBuffer;        //  mixing buffer used in this simplest analysis 
  AliFemtoPicoEvent*           fPicoEvent;           //! The current event, in the small (pico) form 
  unsigned int fNumEventsToMix;                      //  How many "previous" events get mixed with this one, to make background 
  unsigned int fNeventsProcessed;                    //  How many events processed so far 

  unsigned int fMinSizePartCollection;               //  Don't use event if it has fewer than this many particles passing ParticleCuts default 0

  Bool_t fVerbose;
  Bool_t fPerformSharedDaughterCut;

#ifdef __ROOT__
  ClassDef(AliFemtoSimpleAnalysis, 0)
#endif

    };

// Get's
inline AliFemtoPairCut*              AliFemtoSimpleAnalysis::PairCut() {return fPairCut;}
inline AliFemtoEventCut*             AliFemtoSimpleAnalysis::EventCut() {return fEventCut;}
inline AliFemtoParticleCut*          AliFemtoSimpleAnalysis::FirstParticleCut() {return fFirstParticleCut;}
inline AliFemtoParticleCut*          AliFemtoSimpleAnalysis::SecondParticleCut() {return fSecondParticleCut;}
inline AliFemtoCorrFctnCollection*   AliFemtoSimpleAnalysis::CorrFctnCollection() {return fCorrFctnCollection;}
inline unsigned int                  AliFemtoSimpleAnalysis::NumEventsToMix() const {return fNumEventsToMix;}
inline AliFemtoPicoEvent*            AliFemtoSimpleAnalysis::CurrentPicoEvent() {return fPicoEvent;}

inline AliFemtoPicoEventCollection*  AliFemtoSimpleAnalysis::MixingBuffer() {return fMixingBuffer;}

inline bool AliFemtoSimpleAnalysis::AnalyzeIdenticalParticles() const { return (fFirstParticleCut==fSecondParticleCut); }
inline bool AliFemtoSimpleAnalysis::V0SharedDaughterCut() { return fPerformSharedDaughterCut; }

// Set's
inline void AliFemtoSimpleAnalysis::SetPairCut(AliFemtoPairCut* x) { fPairCut = x; x->SetAnalysis((AliFemtoAnalysis*)this);}
inline void AliFemtoSimpleAnalysis::AddCorrFctn(AliFemtoCorrFctn* cf) {fCorrFctnCollection->push_back(cf); cf->SetAnalysis((AliFemtoAnalysis*)this);}
inline void AliFemtoSimpleAnalysis::SetEventCut(AliFemtoEventCut* x) {fEventCut = x; x->SetAnalysis((AliFemtoAnalysis*)this);}
inline void AliFemtoSimpleAnalysis::SetFirstParticleCut(AliFemtoParticleCut* x) {fFirstParticleCut = x; x->SetAnalysis((AliFemtoAnalysis*)this);}
inline void AliFemtoSimpleAnalysis::SetSecondParticleCut(AliFemtoParticleCut* x) {fSecondParticleCut = x; x->SetAnalysis((AliFemtoAnalysis*)this);}

inline void AliFemtoSimpleAnalysis::SetNumEventsToMix(const unsigned int& nmix){ fNumEventsToMix = nmix;}
inline bool AliFemtoSimpleAnalysis::MixingBufferFull(){return (fMixingBuffer->size() >= fNumEventsToMix);}
inline int AliFemtoSimpleAnalysis::GetNeventsProcessed() const {return fNeventsProcessed;}

inline void AliFemtoSimpleAnalysis::SetMinSizePartCollection(unsigned int minSize){fMinSizePartCollection = minSize;}

inline void AliFemtoSimpleAnalysis::SetVerboseMode(Bool_t aVerbose){fVerbose = aVerbose;}
inline void AliFemtoSimpleAnalysis::SetV0SharedDaughterCut(Bool_t aPerform) { fPerformSharedDaughterCut = aPerform; }

#endif
 AliFemtoSimpleAnalysis.h:1
 AliFemtoSimpleAnalysis.h:2
 AliFemtoSimpleAnalysis.h:3
 AliFemtoSimpleAnalysis.h:4
 AliFemtoSimpleAnalysis.h:5
 AliFemtoSimpleAnalysis.h:6
 AliFemtoSimpleAnalysis.h:7
 AliFemtoSimpleAnalysis.h:8
 AliFemtoSimpleAnalysis.h:9
 AliFemtoSimpleAnalysis.h:10
 AliFemtoSimpleAnalysis.h:11
 AliFemtoSimpleAnalysis.h:12
 AliFemtoSimpleAnalysis.h:13
 AliFemtoSimpleAnalysis.h:14
 AliFemtoSimpleAnalysis.h:15
 AliFemtoSimpleAnalysis.h:16
 AliFemtoSimpleAnalysis.h:17
 AliFemtoSimpleAnalysis.h:18
 AliFemtoSimpleAnalysis.h:19
 AliFemtoSimpleAnalysis.h:20
 AliFemtoSimpleAnalysis.h:21
 AliFemtoSimpleAnalysis.h:22
 AliFemtoSimpleAnalysis.h:23
 AliFemtoSimpleAnalysis.h:24
 AliFemtoSimpleAnalysis.h:25
 AliFemtoSimpleAnalysis.h:26
 AliFemtoSimpleAnalysis.h:27
 AliFemtoSimpleAnalysis.h:28
 AliFemtoSimpleAnalysis.h:29
 AliFemtoSimpleAnalysis.h:30
 AliFemtoSimpleAnalysis.h:31
 AliFemtoSimpleAnalysis.h:32
 AliFemtoSimpleAnalysis.h:33
 AliFemtoSimpleAnalysis.h:34
 AliFemtoSimpleAnalysis.h:35
 AliFemtoSimpleAnalysis.h:36
 AliFemtoSimpleAnalysis.h:37
 AliFemtoSimpleAnalysis.h:38
 AliFemtoSimpleAnalysis.h:39
 AliFemtoSimpleAnalysis.h:40
 AliFemtoSimpleAnalysis.h:41
 AliFemtoSimpleAnalysis.h:42
 AliFemtoSimpleAnalysis.h:43
 AliFemtoSimpleAnalysis.h:44
 AliFemtoSimpleAnalysis.h:45
 AliFemtoSimpleAnalysis.h:46
 AliFemtoSimpleAnalysis.h:47
 AliFemtoSimpleAnalysis.h:48
 AliFemtoSimpleAnalysis.h:49
 AliFemtoSimpleAnalysis.h:50
 AliFemtoSimpleAnalysis.h:51
 AliFemtoSimpleAnalysis.h:52
 AliFemtoSimpleAnalysis.h:53
 AliFemtoSimpleAnalysis.h:54
 AliFemtoSimpleAnalysis.h:55
 AliFemtoSimpleAnalysis.h:56
 AliFemtoSimpleAnalysis.h:57
 AliFemtoSimpleAnalysis.h:58
 AliFemtoSimpleAnalysis.h:59
 AliFemtoSimpleAnalysis.h:60
 AliFemtoSimpleAnalysis.h:61
 AliFemtoSimpleAnalysis.h:62
 AliFemtoSimpleAnalysis.h:63
 AliFemtoSimpleAnalysis.h:64
 AliFemtoSimpleAnalysis.h:65
 AliFemtoSimpleAnalysis.h:66
 AliFemtoSimpleAnalysis.h:67
 AliFemtoSimpleAnalysis.h:68
 AliFemtoSimpleAnalysis.h:69
 AliFemtoSimpleAnalysis.h:70
 AliFemtoSimpleAnalysis.h:71
 AliFemtoSimpleAnalysis.h:72
 AliFemtoSimpleAnalysis.h:73
 AliFemtoSimpleAnalysis.h:74
 AliFemtoSimpleAnalysis.h:75
 AliFemtoSimpleAnalysis.h:76
 AliFemtoSimpleAnalysis.h:77
 AliFemtoSimpleAnalysis.h:78
 AliFemtoSimpleAnalysis.h:79
 AliFemtoSimpleAnalysis.h:80
 AliFemtoSimpleAnalysis.h:81
 AliFemtoSimpleAnalysis.h:82
 AliFemtoSimpleAnalysis.h:83
 AliFemtoSimpleAnalysis.h:84
 AliFemtoSimpleAnalysis.h:85
 AliFemtoSimpleAnalysis.h:86
 AliFemtoSimpleAnalysis.h:87
 AliFemtoSimpleAnalysis.h:88
 AliFemtoSimpleAnalysis.h:89
 AliFemtoSimpleAnalysis.h:90
 AliFemtoSimpleAnalysis.h:91
 AliFemtoSimpleAnalysis.h:92
 AliFemtoSimpleAnalysis.h:93
 AliFemtoSimpleAnalysis.h:94
 AliFemtoSimpleAnalysis.h:95
 AliFemtoSimpleAnalysis.h:96
 AliFemtoSimpleAnalysis.h:97
 AliFemtoSimpleAnalysis.h:98
 AliFemtoSimpleAnalysis.h:99
 AliFemtoSimpleAnalysis.h:100
 AliFemtoSimpleAnalysis.h:101
 AliFemtoSimpleAnalysis.h:102
 AliFemtoSimpleAnalysis.h:103
 AliFemtoSimpleAnalysis.h:104
 AliFemtoSimpleAnalysis.h:105
 AliFemtoSimpleAnalysis.h:106
 AliFemtoSimpleAnalysis.h:107
 AliFemtoSimpleAnalysis.h:108
 AliFemtoSimpleAnalysis.h:109
 AliFemtoSimpleAnalysis.h:110
 AliFemtoSimpleAnalysis.h:111
 AliFemtoSimpleAnalysis.h:112
 AliFemtoSimpleAnalysis.h:113
 AliFemtoSimpleAnalysis.h:114
 AliFemtoSimpleAnalysis.h:115
 AliFemtoSimpleAnalysis.h:116
 AliFemtoSimpleAnalysis.h:117
 AliFemtoSimpleAnalysis.h:118
 AliFemtoSimpleAnalysis.h:119
 AliFemtoSimpleAnalysis.h:120
 AliFemtoSimpleAnalysis.h:121
 AliFemtoSimpleAnalysis.h:122
 AliFemtoSimpleAnalysis.h:123
 AliFemtoSimpleAnalysis.h:124
 AliFemtoSimpleAnalysis.h:125
 AliFemtoSimpleAnalysis.h:126
 AliFemtoSimpleAnalysis.h:127
 AliFemtoSimpleAnalysis.h:128
 AliFemtoSimpleAnalysis.h:129
 AliFemtoSimpleAnalysis.h:130
 AliFemtoSimpleAnalysis.h:131
 AliFemtoSimpleAnalysis.h:132
 AliFemtoSimpleAnalysis.h:133
 AliFemtoSimpleAnalysis.h:134
 AliFemtoSimpleAnalysis.h:135
 AliFemtoSimpleAnalysis.h:136
 AliFemtoSimpleAnalysis.h:137
 AliFemtoSimpleAnalysis.h:138
 AliFemtoSimpleAnalysis.h:139
 AliFemtoSimpleAnalysis.h:140
 AliFemtoSimpleAnalysis.h:141
 AliFemtoSimpleAnalysis.h:142