Initial check-in of the model classes
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / Analysis / AliFemtoAnalysis.h
1 /**************************************************************************
2  AliFemtoAnalysis - the most basic analysis there is.
3  Most others (e.g. AliFemtoVertexAnalysis) wrap this one.
4 **************************************************************************/
5
6 #ifndef AliFemtoAnalysis_hh
7 #define AliFemtoAnalysis_hh
8 //#ifndef StMaker_H
9 //#include "StMaker.h"
10 //#endif
11
12 #include "Base/AliFemtoBaseAnalysis.h"        // base analysis class
13 #include "Base/AliFemtoPairCut.h"     
14 #include "Base/AliFemtoEventCut.h"
15 #include "Base/AliFemtoParticleCut.h"
16 #include "Base/AliFemtoCorrFctn.h"
17 #include "Infrastructure/AliFemtoCorrFctnCollection.h"
18 #include "Infrastructure/AliFemtoPicoEventCollection.h"
19 #include "Infrastructure/AliFemtoParticleCollection.h"
20 #include "Infrastructure/AliFemtoPicoEvent.h"
21
22 class AliFemtoPicoEventCollectionVectorHideAway;
23
24
25 class AliFemtoAnalysis : public AliFemtoBaseAnalysis {
26
27  friend class AliFemtoLikeSignAnalysis;
28
29  public:
30   AliFemtoAnalysis();
31   AliFemtoAnalysis(const AliFemtoAnalysis& OriginalAnalysis);  // copy constructor
32   virtual ~AliFemtoAnalysis();
33
34   AliFemtoAnalysis& operator=(const AliFemtoAnalysis& aAna);
35
36   // Gets and Sets
37
38   virtual AliFemtoPairCut*       PairCut();
39   virtual AliFemtoEventCut*      EventCut();
40   virtual AliFemtoParticleCut*   FirstParticleCut();
41   virtual AliFemtoParticleCut*   SecondParticleCut();
42
43   AliFemtoCorrFctnCollection* CorrFctnCollection();
44   virtual AliFemtoCorrFctn* CorrFctn(int n);     // Access to CFs within the collection
45   void AddCorrFctn(AliFemtoCorrFctn* AnotherCorrFctn);
46
47   void SetPairCut(AliFemtoPairCut* ThePairCut);
48   void SetEventCut(AliFemtoEventCut* TheEventCut);
49   void SetFirstParticleCut(AliFemtoParticleCut* TheFirstParticleCut);
50   void SetSecondParticleCut(AliFemtoParticleCut* TheSecondParticleCut);
51
52   void SetMinSizePartCollection(unsigned int minSize);
53
54   unsigned int NumEventsToMix();
55   void SetNumEventsToMix(const unsigned int& NumberOfEventsToMix);
56   AliFemtoPicoEvent* CurrentPicoEvent();
57   AliFemtoPicoEventCollection* MixingBuffer();
58   bool MixingBufferFull();
59
60   bool AnalyzeIdenticalParticles();
61   virtual AliFemtoString Report();       //! returns reports of all cuts applied and correlation functions being done
62
63   virtual void EventBegin(const AliFemtoEvent* TheEventToBegin); // startup for EbyE
64   virtual void ProcessEvent(const AliFemtoEvent* EventToProcess);
65   virtual void EventEnd(const AliFemtoEvent* TheEventToWrapUp);   // cleanup for EbyE
66   int GetNeventsProcessed();
67
68   virtual void Finish();
69
70  protected:
71
72   void AddEventProcessed();
73   void MakePairs(const char* type, 
74                  AliFemtoParticleCollection* ParticlesPassingCut1,
75                  AliFemtoParticleCollection* ParticlesPssingCut2=0);
76
77   AliFemtoPicoEventCollectionVectorHideAway* fPicoEventCollectionVectorHideAway;  /* Mixing Buffer used for Analyses which wrap this one */
78
79   AliFemtoPairCut*             fPairCut;             /* cut applied to pairs */
80   AliFemtoCorrFctnCollection*  fCorrFctnCollection;  /* correlation functions of this analysis */
81   AliFemtoEventCut*            fEventCut;            /* cut to select events */
82   AliFemtoParticleCut*         fFirstParticleCut;    /* select particles of type #1 */
83   AliFemtoParticleCut*         fSecondParticleCut;   /* select particles of type #2 */
84   AliFemtoPicoEventCollection* fMixingBuffer;        /* mixing buffer used in this simplest analysis */
85   AliFemtoPicoEvent*           fPicoEvent;           /* The current event, in the small (pico) form */
86   unsigned int fNumEventsToMix;                      /* How many "previous" events get mixed with this one, to make background */
87   unsigned int fNeventsProcessed;                    /* How many events processed so far */
88
89   unsigned int fMinSizePartCollection;               /* Don't use event if it has fewer than this many particles passing ParticleCuts default 0*/
90
91 #ifdef __ROOT__
92   ClassDef(AliFemtoAnalysis, 0)
93 #endif
94
95     };
96
97 // Get's
98 inline AliFemtoPairCut*             AliFemtoAnalysis::PairCut() {return fPairCut;}
99 inline AliFemtoEventCut*            AliFemtoAnalysis::EventCut() {return fEventCut;}
100 inline AliFemtoParticleCut*         AliFemtoAnalysis::FirstParticleCut() {return fFirstParticleCut;}
101 inline AliFemtoParticleCut*         AliFemtoAnalysis::SecondParticleCut() {return fSecondParticleCut;}
102 inline AliFemtoCorrFctnCollection*  AliFemtoAnalysis::CorrFctnCollection() {return fCorrFctnCollection;}
103 inline unsigned int              AliFemtoAnalysis::NumEventsToMix(){return fNumEventsToMix;}
104 inline AliFemtoPicoEvent*           AliFemtoAnalysis::CurrentPicoEvent() {return fPicoEvent;}
105
106 inline AliFemtoPicoEventCollection*  AliFemtoAnalysis::MixingBuffer() {return fMixingBuffer;}
107
108 // Set's
109 inline bool AliFemtoAnalysis::AnalyzeIdenticalParticles(){return (fFirstParticleCut==fSecondParticleCut);}
110 inline void AliFemtoAnalysis::SetPairCut(AliFemtoPairCut* x) { fPairCut = x; x->SetAnalysis((AliFemtoBaseAnalysis*)this);}
111 inline void AliFemtoAnalysis::AddCorrFctn(AliFemtoCorrFctn* cf) {fCorrFctnCollection->push_back(cf); cf->SetAnalysis((AliFemtoBaseAnalysis*)this);}
112 inline void AliFemtoAnalysis::SetEventCut(AliFemtoEventCut* x) {fEventCut = x; x->SetAnalysis((AliFemtoBaseAnalysis*)this);}
113 inline void AliFemtoAnalysis::SetFirstParticleCut(AliFemtoParticleCut* x) {fFirstParticleCut = x; x->SetAnalysis((AliFemtoBaseAnalysis*)this);}
114 inline void AliFemtoAnalysis::SetSecondParticleCut(AliFemtoParticleCut* x) {fSecondParticleCut = x; x->SetAnalysis((AliFemtoBaseAnalysis*)this);}
115
116 inline void AliFemtoAnalysis::SetNumEventsToMix(const unsigned int& nmix){ fNumEventsToMix = nmix;}
117 inline bool AliFemtoAnalysis::MixingBufferFull(){return (fMixingBuffer->size() >= fNumEventsToMix);}
118 inline int AliFemtoAnalysis::GetNeventsProcessed() {return fNeventsProcessed;}
119
120 inline void AliFemtoAnalysis::SetMinSizePartCollection(unsigned int minSize){fMinSizePartCollection = minSize;}
121
122 #endif