]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FEMTOSCOPY/AliFemto/AliFemtoParticleCut.h
Add the possibiloity to save cut settings in the ROOT file
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoParticleCut.h
CommitLineData
67427ff7 1////////////////////////////////////////////////////////////////////////////////
3a74204a 2// //
3// AliFemtoParticleCut - the pure virtual base class for the particle cut //
4// All particle cuts must inherit from this one //
5// //
67427ff7 6////////////////////////////////////////////////////////////////////////////////
7
3a74204a 8#ifndef ALIFEMTOPARTICLECUT_H
9#define ALIFEMTOPARTICLECUT_H
67427ff7 10
d0e92d9a 11#include "AliFemtoTypes.h"
12#include "AliFemtoCutMonitorHandler.h"
3a74204a 13#include <TObjString.h>
14#include <TList.h>
67427ff7 15
16class AliFemtoBaseAnalysis;
17
18class AliFemtoParticleCut : public AliFemtoCutMonitorHandler {
19
20 friend class AliFemtoBaseAnalysis;
21
22public:
0215f606 23 AliFemtoParticleCut(); // default constructor. - Users should write their own
67427ff7 24 AliFemtoParticleCut(const AliFemtoParticleCut&); // copy constructor
25 virtual ~AliFemtoParticleCut(){/* no-op */}; // destructor
0215f606 26 AliFemtoParticleCut& operator=(const AliFemtoParticleCut& aCut);
67427ff7 27
28 virtual AliFemtoString Report() =0; // user-written method to return string describing cuts
3a74204a 29 virtual TList* ListSettings(); // user-written list of settings which is stored in the result file
67427ff7 30
31 double Mass(){return fMass;}; // mass of the particle being selected
32 virtual void SetMass(const double& mass) {fMass = mass;};
33
34 virtual void EventBegin(const AliFemtoEvent* aEvent) { /* no-op */ }
35 virtual void EventEnd(const AliFemtoEvent* aEvent) { /* no-op */ }
36 virtual AliFemtoParticleCut* Clone() { return 0;}
37
38 virtual AliFemtoParticleType Type()=0;
39
40 // the following allows "back-pointing" from the CorrFctn to the "parent" Analysis
41 AliFemtoBaseAnalysis* HbtAnalysis(){return fyAnalysis;};
42 void SetAnalysis(AliFemtoBaseAnalysis*);
43
44protected:
67427ff7 45 AliFemtoBaseAnalysis* fyAnalysis; // Link to the base analysis class
0215f606 46 double fMass;
67427ff7 47
48#ifdef __ROOT__
49 ClassDef(AliFemtoParticleCut, 0)
50#endif
51};
52
0215f606 53inline AliFemtoParticleCut::AliFemtoParticleCut(): AliFemtoCutMonitorHandler(), fyAnalysis(0), fMass(0){}; // default constructor. - Users should write their own
54inline AliFemtoParticleCut::AliFemtoParticleCut(const AliFemtoParticleCut& c): AliFemtoCutMonitorHandler(), fyAnalysis(0), fMass(0) {
67427ff7 55 fMass = c.fMass; fyAnalysis = 0;
56#ifdef STHBTDEBUG
57 cout << " AliFemtoParticleCut::AliFemtoParticleCut(const AliFemtoParticleCut& c) - fMass: " << fMass << endl;
58#endif
59}
60inline void AliFemtoParticleCut::SetAnalysis(AliFemtoBaseAnalysis* analysis) { fyAnalysis = analysis; }
0215f606 61inline AliFemtoParticleCut& AliFemtoParticleCut::operator=(const AliFemtoParticleCut& aCut) { if (this == &aCut) return *this; fyAnalysis = aCut.fyAnalysis; fMass=aCut.fMass; return *this; }
3a74204a 62 inline TList *AliFemtoParticleCut::ListSettings() {
63 TList *tListSetttings = new TList();
64 char buf[100];
65 snprintf(buf, 100, "AliFemtoParticleCut.mass=%lf", fMass);
66 TObjString *str = new TObjString(buf);
67 tListSetttings->Add(str);
68 return tListSetttings;
69 }
70
67427ff7 71#endif