StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtAnalysis.h
1 /***************************************************************************
2  *
3  * $Id: StHbtAnalysis.h,v 1.17 2002/11/03 16:38:54 magestro Exp $
4  *
5  * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * This is the Class for Analysis objects. Each of the simultaneous
10  * Analyses running should have one of these instantiated. They link
11  * into the Manager in an Analysis Collection.
12  *
13  ***************************************************************************
14  *
15  * $Log: StHbtAnalysis.h,v $
16  * Revision 1.17 2002/11/03 16:38:54 magestro
17  * New MakePairs() method, new StHbtPicoEventCollectionVectorHideAway data member
18  *
19  * Revision 1.16 2002/06/22 17:53:32 lisa
20  * implemented switch to allow user to require minimum number of particles in First and Second ParticleCollections - default value is zero so if user does not Set this value then behaviour is like before
21  *
22  * Revision 1.15 2001/04/05 21:57:45 laue
23  * current pico-event becomes a member of the analysis (mPicoEvent) and gets
24  * an access-function (CurrentPicoEvent)
25  *
26  * Revision 1.14 2000/08/31 22:31:30 laue
27  * StHbtAnalysis: output changed (a little bit less)
28  * StHbtEvent: new version, members for reference mult added
29  * StHbtIOBinary: new IO for new StHbtEvent version
30  * StHbtTypes: TTree typedef to StHbtTTree added
31  * StHbtVertexAnalysis: overflow and underflow added
32  *
33  * Revision 1.13 2000/08/11 16:35:41 rcwells
34  * Added number of events processed to each HBT analysis
35  *
36  * Revision 1.12 2000/06/15 18:54:08 willson
37  * Methods to access cuts and correlation functions moved to derived analysis
38  * classes.
39  *
40  * Revision 1.11 2000/05/11 21:18:56 willson
41  * Removed StHbtThreeParticleCorrFctn's...put methods in StHbtCorrFctn
42  * Some methods in derived analysis classes moved to base analysis class
43  *
44  * Revision 1.10 2000/04/03 16:21:50 laue
45  * some include files changed
46  * Multi track cut added
47  *
48  * Revision 1.9 2000/03/17 17:23:05 laue
49  * Roberts new three particle correlations implemented.
50  *
51  * Revision 1.8 2000/03/16 02:07:04 laue
52  * Copy constructor added to StHbtAnalysis (only known cuts, corrfctn).
53  *
54  * StHbtBinaryReader can now derive filename from StIOMaker and read a list
55  * of files.
56  *
57  * StHbtManager now holds a collection of StHbtEventWriters (multiple writes
58  * possible now)
59  *
60  * Revision 1.7 2000/02/13 17:17:12 laue
61  * Calls to the EventBegin() and EventEnd() functions implemented
62  * The actual analysis is moved from StHbtManager to StHbtAnalysis
63  *
64  * Revision 1.6 2000/01/25 17:35:17 laue
65  * I. In order to run the stand alone version of the StHbtMaker the following
66  * changes have been done:
67  * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
68  * b) unnecessary includes of StMaker.h have been removed
69  * c) the subdirectory StHbtMaker/doc/Make has been created including everything
70  * needed for the stand alone version
71  *
72  * II. To reduce the amount of compiler warning
73  * a) some variables have been type casted
74  * b) some destructors have been declared as virtual
75  *
76  * Revision 1.5 1999/12/03 22:24:36 lisa
77  * (1) make Cuts and CorrFctns point back to parent Analysis (as well as other way). (2) Accommodate new PidTraits mechanism
78  *
79  * Revision 1.4 1999/10/15 01:57:23 lisa
80  * Important enhancement of StHbtMaker - implement Franks CutMonitors
81  * ----------------------------------------------------------
82  * This means 3 new files in Infrastructure area (CutMonitor),
83  * several specific CutMonitor classes in the Cut area
84  * and a new base class in the Base area (StHbtCutMonitor).
85  * This means also changing all Cut Base class header files from .hh to .h
86  * so we have access to CutMonitor methods from Cint command line.
87  * This last means
88  * 1) files which include these header files are slightly modified
89  * 2) a side benefit: the TrackCuts and V0Cuts no longer need
90  * a SetMass() implementation in each Cut class, which was stupid.
91  * Also:
92  * -----
93  * Include Franks StHbtAssociationReader
94  * ** None of these changes should affect any user **
95  *
96  * Revision 1.3 1999/10/04 15:38:56 lisa
97  * include Franks new accessor methods StHbtAnalysis::CorrFctn and StHbtManager::Analysis as well as McEvent example macro
98  *
99  * Revision 1.2 1999/07/06 22:33:22 lisa
100  * Adjusted all to work in pro and new - dev itself is broken
101  *
102  * Revision 1.1.1.1 1999/06/29 16:02:57 lisa
103  * Installation of StHbtMaker
104  *
105  **************************************************************************/
106 
107 #ifndef StHbtAnalysis_hh
108 #define StHbtAnalysis_hh
109 //#ifndef StMaker_H
110 //#include "StMaker.h"
111 //#endif
112 
113 #include "StHbtMaker/Base/StHbtBaseAnalysis.h" // base analysis class
114 #include "StHbtMaker/Base/StHbtPairCut.h"
115 #include "StHbtMaker/Base/StHbtEventCut.h"
116 #include "StHbtMaker/Base/StHbtParticleCut.h"
117 #include "StHbtMaker/Base/StHbtCorrFctn.hh"
118 #include "StHbtMaker/Infrastructure/StHbtCorrFctnCollection.hh"
119 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollection.hh"
120 #include "StHbtMaker/Infrastructure/StHbtParticleCollection.hh"
121 #include "StHbtMaker/Infrastructure/StHbtPicoEvent.hh"
122 
124 
125 
127 
128 public:
129 
130  StHbtAnalysis();
131  StHbtAnalysis(const StHbtAnalysis&); // copy constructor
132  virtual ~StHbtAnalysis();
133 
134  // Gets and Sets
135 
136  virtual StHbtPairCut* PairCut();
137  virtual StHbtEventCut* EventCut();
138  virtual StHbtParticleCut* FirstParticleCut();
139  virtual StHbtParticleCut* SecondParticleCut();
140 
141  StHbtCorrFctnCollection* CorrFctnCollection();
142  virtual StHbtCorrFctn* CorrFctn(int n); // Access to CFs within the collection
143  void AddCorrFctn(StHbtCorrFctn*);
144 
145  void SetPairCut(StHbtPairCut*);
146  void SetEventCut(StHbtEventCut*);
147  void SetFirstParticleCut(StHbtParticleCut*);
148  void SetSecondParticleCut(StHbtParticleCut*);
149 
150  void SetMinSizePartCollection(unsigned int minSize);
151 
152 
153  unsigned int NumEventsToMix();
154  void SetNumEventsToMix(const unsigned int&);
155  StHbtPicoEvent* CurrentPicoEvent();
156  StHbtPicoEventCollection* MixingBuffer();
157  bool MixingBufferFull();
158 
159  bool AnalyzeIdenticalParticles();
160  virtual StHbtString Report();
161 
162  virtual void ProcessEvent(const StHbtEvent*);
163  virtual void EventBegin(const StHbtEvent*); // startup for EbyE
164  virtual void EventEnd(const StHbtEvent*); // cleanup for EbyE
165  int GetNeventsProcessed();
166 
167  virtual void Finish();
168 
169  friend class StHbtLikeSignAnalysis;
170 
171 protected:
172 
173  void AddEventProcessed();
174  void MakePairs(const char* type,StHbtParticleCollection*,StHbtParticleCollection* p2=0);
175 
176  StHbtPicoEventCollectionVectorHideAway* mPicoEventCollectionVectorHideAway;
177 
178  StHbtPairCut* mPairCut;
179  StHbtCorrFctnCollection* mCorrFctnCollection;
180  StHbtEventCut* mEventCut;
181  StHbtParticleCut* mFirstParticleCut;
182  StHbtParticleCut* mSecondParticleCut;
183  StHbtPicoEventCollection* mMixingBuffer;
184  StHbtPicoEvent* mPicoEvent;
185  unsigned int mNumEventsToMix;
186  unsigned int mNeventsProcessed;
187 
188  unsigned int mMinSizePartCollection; // minimum # particles in ParticleCollection
189 
190 
191 #ifdef __ROOT__
192  ClassDef(StHbtAnalysis, 0)
193 #endif
194 
195 };
196 
197 // Get's
198 inline StHbtPairCut* StHbtAnalysis::PairCut() {return mPairCut;}
199 inline StHbtEventCut* StHbtAnalysis::EventCut() {return mEventCut;}
200 inline StHbtParticleCut* StHbtAnalysis::FirstParticleCut() {return mFirstParticleCut;}
201 inline StHbtParticleCut* StHbtAnalysis::SecondParticleCut() {return mSecondParticleCut;}
202 inline StHbtCorrFctnCollection* StHbtAnalysis::CorrFctnCollection() {return mCorrFctnCollection;}
203 inline unsigned int StHbtAnalysis::NumEventsToMix(){return mNumEventsToMix;}
204 inline StHbtPicoEvent* StHbtAnalysis::CurrentPicoEvent() {return mPicoEvent;}
205 
206 inline StHbtPicoEventCollection* StHbtAnalysis::MixingBuffer() {return mMixingBuffer;}
207 
208 // Set's
209 inline bool StHbtAnalysis::AnalyzeIdenticalParticles(){return (mFirstParticleCut==mSecondParticleCut);}
210 inline void StHbtAnalysis::SetPairCut(StHbtPairCut* x) { mPairCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
211 inline void StHbtAnalysis::AddCorrFctn(StHbtCorrFctn* cf) {mCorrFctnCollection->push_back(cf); cf->SetAnalysis((StHbtBaseAnalysis*)this);}
212 inline void StHbtAnalysis::SetEventCut(StHbtEventCut* x) {mEventCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
213 inline void StHbtAnalysis::SetFirstParticleCut(StHbtParticleCut* x) {mFirstParticleCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
214 inline void StHbtAnalysis::SetSecondParticleCut(StHbtParticleCut* x) {mSecondParticleCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
215 
216 inline void StHbtAnalysis::SetNumEventsToMix(const unsigned int& nmix){ mNumEventsToMix = nmix;}
217 inline bool StHbtAnalysis::MixingBufferFull(){return (mMixingBuffer->size() >= mNumEventsToMix);}
218 inline int StHbtAnalysis::GetNeventsProcessed() {return mNeventsProcessed;}
219 
220 inline void StHbtAnalysis::SetMinSizePartCollection(unsigned int minSize){mMinSizePartCollection = minSize;}
221 
222 #endif
virtual void ProcessEvent(const StHbtEvent *)
returns reports of all cuts applied and correlation functions being done