StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StarGenEvent.h
1 #ifndef __StarGenEvent_h__
2 #define __StarGenEvent_h__
3 #include "TString.h"
4 #include <vector>
5 #include "TObjArray.h"
6 #include "TClonesArray.h"
7 #include "TCollection.h"
8 #include "TObject.h"
9 
10 class TClonesArray;
11 class StarGenParticle;
12 
81 class StarGenEvent : public TObject
82 {
83  public:
84 
86  StarGenEvent( const Char_t *name="event", const Char_t *title="" );
88  ~StarGenEvent();
89 
91  void SetGeneratorId( Int_t id ) { mGeneratorId = id; }
93  Int_t GetGeneratorId(){ return mGeneratorId; }
95  void SetProcessId( Int_t id ){ mProcessId = id; }
97  Int_t GetProcessId(){ return mProcessId; }
99  void SetOffset( Int_t o ){ mOffset = o; }
101  Int_t GetOffset(){ return mOffset; }
102 
104  Int_t operator++(){ return ++mEventNumber; }
106  Int_t operator++(Int_t){ return mEventNumber++; }
108  Int_t GetEventNumber(){ return mEventNumber; }
109 
111  void SetRunNumber( Int_t run ){ mRunNumber = run; }
113  Int_t GetRunNumber(){ return mRunNumber; }
115  void SetDaqRunNumber( Int_t run ){ mDaqRunNumber= run; }
117  Int_t GetDaqRunNumber(){ return mDaqRunNumber; }
119  void SetDaqFileNumber( Int_t fnum ){ mDaqFileNumber= fnum; }
121  Int_t GetDaqFileNumber(){ return mDaqFileNumber; }
122 
124  void SetBlue( Int_t id ) { mBlueId = id; }
126  Int_t GetBlue(){ return mBlueId; }
128  void SetYell( Int_t id ){ mYellId = id; }
130  Int_t GetYell(){ return mYellId; }
132  void SetRootS( Double_t rs ){ mCmsEnergy = rs; }
134  Double_t GetRootS(){ return mCmsEnergy; }
135 
139 
157  StarGenParticle *AddParticle( Int_t status, Int_t pdg, Int_t m1, Int_t m2, Int_t d1, Int_t d2,
158  Double_t px, Double_t py, Double_t pz, Double_t E, Double_t M,
159  Double_t vx, Double_t vy, Double_t vz, Double_t vt );
160 
161 
166 
169  void Print( const Option_t *opts="head" ) const;
170 
173  TIter IterAll( Bool_t dir=kIterForward ){
174  return TIter( mParticles, dir );
175  }
176 
178  virtual void Clear( const Option_t *opts="part,data" );
179 
182  StarGenParticle *operator[]( Int_t idx ){
183  return (StarGenParticle *)(*mParticles)[idx];
184  }
185 
188 
191  {
192  kUnknown = 0, // Result not specified.
193  kAccept = 0x0001, // The event is accepted
194  kReject = 0x0002, // The event is rejected
195  kFlag = 0x0004 // The event will be simulated regardless of accept/reject decision
196  };
197 
199  void SetFilterResult( UInt_t result ){ mFilterResult =result; }
200 
203  void AddFilterResult( UInt_t result ){ mFilterResult|=result; }
204 
206  UInt_t GetFilterResult(){ return mFilterResult; }
207 
209  void AddUserWeight( double w ){ mWeights.push_back(w); }
210 
212  const std::vector<double>& GetUserWeights() { return mWeights; }
214  const std::vector<double>& GetUserWeights() const { return mWeights; }
215 
216  private:
218  StarGenEvent( const StarGenEvent &other );
220  StarGenEvent &operator=( const StarGenEvent &other );
221 
222  protected:
223 
224  TString mName;
225  TString mTitle;
226 
227  TClonesArray *mParticles;
228 
229  Int_t mGeneratorId;
230  Int_t mProcessId;
231  Int_t mOffset;
232 
233  Int_t mEventNumber;
234  Int_t mRunNumber;
237 
238  Int_t mBlueId;
239  Int_t mYellId;
240 
241  Double_t mCmsEnergy;
242 
243  Int_t mNumRejected[3];
244  UInt_t mFilterResult;
245 
246  std::vector<Double_t> mWeights;
247 
249 
251  void InitArrays();
252 
253  ClassDef(StarGenEvent,1);
254 };
255 
256 
257 
258 #endif
Int_t GetYell()
Get the yellow beam ID.
Definition: StarGenEvent.h:130
void SetFilterResult(UInt_t result)
Sets the filter result.
Definition: StarGenEvent.h:199
Int_t operator++(Int_t)
Postfix increment operator increases event number.
Definition: StarGenEvent.h:106
~StarGenEvent()
Destructor.
StarGenParticle * operator[](Int_t idx)
Definition: StarGenEvent.h:182
void SetGeneratorId(Int_t id)
Set the generator ID.
Definition: StarGenEvent.h:91
StarGenEvent(const Char_t *name="event", const Char_t *title="")
Constructor.
Int_t GetNumberOfParticles()
Obtain the number of particles in the event record.
Definition: StarGenEvent.h:187
Int_t operator++()
Prefix increment operator increases event number.
Definition: StarGenEvent.h:104
Int_t mBlueId
PDG for blue beam.
Definition: StarGenEvent.h:238
void AddFilterResult(UInt_t result)
Definition: StarGenEvent.h:203
Int_t mEventNumber
Event number.
Definition: StarGenEvent.h:233
Int_t mProcessId
Event generator process ID.
Definition: StarGenEvent.h:230
void Print(const Option_t *opts="head") const
Int_t GetDaqFileNumber()
Get the file number in an embedding job.
Definition: StarGenEvent.h:121
void SetOffset(Int_t o)
Set the particle index offset for this event.
Definition: StarGenEvent.h:99
UInt_t mFilterResult
Result of filter.
Definition: StarGenEvent.h:244
Yet another particle class.
const std::vector< double > & GetUserWeights()
Retrieve the user weights vector.
Definition: StarGenEvent.h:212
void SetDaqFileNumber(Int_t fnum)
Set the file number in an embedding job.
Definition: StarGenEvent.h:119
Int_t GetDaqRunNumber()
Get the run number for the DAQ file in this event.
Definition: StarGenEvent.h:117
virtual void Clear(const Option_t *opts="part,data")
Clear the event.
Int_t GetEventNumber()
Get the event number.
Definition: StarGenEvent.h:108
void SetRootS(Double_t rs)
Set the sqrt(s) of the collision.
Definition: StarGenEvent.h:132
const std::vector< double > & GetUserWeights() const
Retrieve the user weights vector.
Definition: StarGenEvent.h:214
std::vector< Double_t > mWeights
User weights.
Definition: StarGenEvent.h:246
void AddUserWeight(double w)
Attach a user-weight to the event.
Definition: StarGenEvent.h:209
Int_t GetBlue()
Get the blue beam ID.
Definition: StarGenEvent.h:126
void SetBlue(Int_t id)
Set the blue beam ID.
Definition: StarGenEvent.h:124
Int_t mOffset
Event generator offset.
Definition: StarGenEvent.h:231
void InitArrays()
Initialize clowns arrays.
Double_t mCmsEnergy
aka sqrt(s)
Definition: StarGenEvent.h:241
Int_t GetProcessId()
Get the process ID for this event.
Definition: StarGenEvent.h:97
Int_t mGeneratorId
Generator Id.
Definition: StarGenEvent.h:229
Base class for event records.
Definition: StarGenEvent.h:81
Int_t mYellId
PDG for yellow beam.
Definition: StarGenEvent.h:239
void SetYell(Int_t id)
Set the yellow beam ID.
Definition: StarGenEvent.h:128
TIter IterAll(Bool_t dir=kIterForward)
Definition: StarGenEvent.h:173
Int_t GetOffset()
Get the particle index offset for this event.
Definition: StarGenEvent.h:101
Double_t GetRootS()
Get the sqrt(s) of the collision.
Definition: StarGenEvent.h:134
UInt_t GetFilterResult()
Returns the filter result.
Definition: StarGenEvent.h:206
void SetDaqRunNumber(Int_t run)
Set the run number for the DAQ file in an embedding job.
Definition: StarGenEvent.h:115
void SetProcessId(Int_t id)
Set the process ID for this event.
Definition: StarGenEvent.h:95
Int_t mDaqFileNumber
File number (for embedding)
Definition: StarGenEvent.h:236
Int_t mNumRejected[3]
0=total, 1=EG, 2=filter
Definition: StarGenEvent.h:243
TClonesArray * mParticles
Array of particles.
Definition: StarGenEvent.h:227
Int_t mNumParticles
Number of particles in the record.
Definition: StarGenEvent.h:248
Int_t mRunNumber
Monte Carlo run number.
Definition: StarGenEvent.h:234
FilterResult
Filter result enumeration.
Definition: StarGenEvent.h:190
Int_t mDaqRunNumber
DAQ run number (for embedding)
Definition: StarGenEvent.h:235
StarGenParticle * AddParticle()
Int_t GetRunNumber()
Get the run number for this event.
Definition: StarGenEvent.h:113
void SetRunNumber(Int_t run)
Set the run number for this event.
Definition: StarGenEvent.h:111
Int_t GetGeneratorId()
Returns the generator ID.
Definition: StarGenEvent.h:93