AliRoot Core  3dc7879 (3dc7879)
AliHeader.h
Go to the documentation of this file.
1 #ifndef ALIHEADER_H
2 #define ALIHEADER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 /* $Id$ */
7 
8 //-----------------------------------------------------------------------
9 // Simulation event header class
10 // Collaborates with AliRun, AliStack, and AliGenReaderTreeK classes
11 // Many other classes depend on it
12 //-----------------------------------------------------------------------
13 
14 #include <TObject.h>
15 #include <time.h>
16 
17 class AliStack;
18 class AliGenEventHeader;
20 class TObjArray;
21 
22 class AliHeader : public TObject {
23 public:
24  AliHeader();
25  AliHeader(const AliHeader& head);
26  AliHeader(Int_t run, Int_t event);
27  AliHeader(Int_t run, Int_t eventSerialNr, Int_t evNrInRun);
28  virtual ~AliHeader();
29 
30 
31  virtual void Reset(Int_t run, Int_t event);
32  virtual void Reset(Int_t run, Int_t eventSerialNr, Int_t evNrInRun);
33 
34  virtual void SetRun(Int_t run) {fRun = run;}
35  virtual Int_t GetRun() const {return fRun;}
36 
37  virtual void SetNprimary(Int_t nprimary) {fNprimary = nprimary;}
38  virtual Int_t GetNprimary() const {return fNprimary;}
39  virtual Int_t GetNsecondary() const {return fNtrack-fNprimary;}
40 
41  virtual void SetNvertex(Int_t vertex) {fNvertex = vertex;}
42  virtual Int_t GetNvertex() const {return fNvertex;}
43 
44  virtual void SetNtrack(Int_t ntrack) {fNtrack = ntrack;}
45  virtual Int_t GetNtrack() const {return fNtrack;}
46 
47  virtual void SetEvent(Int_t event) {fEvent = event;}
48  virtual Int_t GetEvent() const {return fEvent;}
49 
50  virtual void SetEventNrInRun(Int_t event) {fEventNrInRun = event;}
51  virtual Int_t GetEventNrInRun() const {return fEventNrInRun;}
52 
53  virtual AliStack* Stack() const;
54  virtual void SetStack(AliStack* stack);
55 
56  virtual void SetGenEventHeader(AliGenEventHeader* header);
57  virtual AliGenEventHeader* GenEventHeader() const;
58 
59  virtual void AddDetectorEventHeader(AliDetectorEventHeader* header);
60  virtual AliDetectorEventHeader* GetDetectorEventHeader(const char *name) const;
61 
62  virtual void SetTimeStamp(time_t timeStamp) {fTimeStamp = timeStamp;}
63  virtual time_t GetTimeStamp() const {return fTimeStamp;}
64 
65  virtual void Print(const char *opt=0) const;
66 
67  Int_t GetSgPerBgEmbedded() const {return fSgPerBgEmbedded;}
70 
71  AliHeader& operator=(const AliHeader& head)
72  {head.Copy(*this); return *this;}
73 
74 protected:
75 
76  void Copy(TObject& head) const;
77 
78  Int_t fRun; //Run number
79  Int_t fNvertex; //Number of vertices
80  Int_t fNprimary; //Number of primary tracks
81  Int_t fNtrack; //Number of tracks
82  Int_t fEvent; //Event number (serial in the file)
83  Int_t fEventNrInRun; //Unique Event number within the run
84  Int_t fSgPerBgEmbedded; // in case this is embedded signal: bg.event repetition factor
85  time_t fTimeStamp; //Event time-stamp
86  AliStack *fStack; //Pointer to stack
87  AliGenEventHeader* fGenHeader; //Event Header for Generator
88  TObjArray* fDetHeaders; //Event Headers for detector specific information
89 
90  ClassDef(AliHeader,5) //Alice event header
91 };
92 
93 #endif
AliStack * fStack
Definition: AliHeader.h:86
void SetSgPerBgEmbedded(int i)
Definition: AliHeader.h:68
AliGenEventHeader * fGenHeader
Definition: AliHeader.h:87
virtual Int_t GetRun() const
Definition: AliHeader.h:35
#define TObjArray
virtual Int_t GetNtrack() const
Definition: AliHeader.h:45
Int_t fNvertex
Definition: AliHeader.h:79
virtual void Print(const char *opt=0) const
Definition: AliHeader.cxx:161
AliHeader & operator=(const AliHeader &head)
Definition: AliHeader.h:71
Int_t fSgPerBgEmbedded
Definition: AliHeader.h:84
virtual void SetRun(Int_t run)
Definition: AliHeader.h:34
Int_t fNtrack
Definition: AliHeader.h:81
Int_t fNprimary
Definition: AliHeader.h:80
Int_t GetSgPerBgEmbedded() const
Definition: AliHeader.h:67
virtual ~AliHeader()
Definition: AliHeader.cxx:115
virtual AliStack * Stack() const
Definition: AliHeader.cxx:180
virtual Int_t GetNvertex() const
Definition: AliHeader.h:42
virtual void SetTimeStamp(time_t timeStamp)
Definition: AliHeader.h:62
virtual void SetEvent(Int_t event)
Definition: AliHeader.h:47
virtual Int_t GetNsecondary() const
Definition: AliHeader.h:39
virtual void SetStack(AliStack *stack)
Definition: AliHeader.cxx:187
virtual void SetNvertex(Int_t vertex)
Definition: AliHeader.h:41
virtual void SetNprimary(Int_t nprimary)
Definition: AliHeader.h:37
void Copy(TObject &head) const
Definition: AliHeader.cxx:251
virtual void SetEventNrInRun(Int_t event)
Definition: AliHeader.h:50
virtual time_t GetTimeStamp() const
Definition: AliHeader.h:63
TObjArray * fDetHeaders
Definition: AliHeader.h:88
virtual void Reset(Int_t run, Int_t event)
Definition: AliHeader.cxx:130
Int_t fEvent
Definition: AliHeader.h:82
virtual AliGenEventHeader * GenEventHeader() const
Definition: AliHeader.cxx:244
virtual Int_t GetEventNrInRun() const
Definition: AliHeader.h:51
virtual void SetNtrack(Int_t ntrack)
Definition: AliHeader.h:44
time_t fTimeStamp
Definition: AliHeader.h:85
Int_t fRun
Definition: AliHeader.h:78
Int_t GetBgReuseID() const
Definition: AliHeader.h:69
virtual Int_t GetNprimary() const
Definition: AliHeader.h:38
virtual void AddDetectorEventHeader(AliDetectorEventHeader *header)
Definition: AliHeader.cxx:200
virtual void SetGenEventHeader(AliGenEventHeader *header)
Definition: AliHeader.cxx:194
virtual AliDetectorEventHeader * GetDetectorEventHeader(const char *name) const
Definition: AliHeader.cxx:230
Int_t fEventNrInRun
Definition: AliHeader.h:83
virtual Int_t GetEvent() const
Definition: AliHeader.h:48