StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StJetEvent.h
1 // -*- mode: c++ -*-
2 
3 //
4 // Pibero Djawotho <pibero@tamu.edu>
5 // Texas A&M University
6 // 1 September 2009
7 //
8 
9 #ifndef ST_JET_EVENT_H
10 #define ST_JET_EVENT_H
11 
12 class TClonesArray;
13 class TVector3;
14 class TLorentzVector;
15 class StJetVertex;
16 class StJetCandidate;
17 class StJetTrack;
18 class StJetTower;
19 class StJetParticle;
20 
21 #include "TObject.h"
22 #include "TDatime.h"
23 #include "TTimeStamp.h"
24 
25 class StJetEvent : public TObject {
26 public:
27  StJetEvent();
28  ~StJetEvent();
29 
30  void Clear(Option_t* option = "");
31 
32  int runId () const { return mRunId; }
33  int eventId() const { return mEventId; }
34 
35  // Event time should really be moved to skim tree
36  const TDatime& dateTime() const { return mDatime; }
37  int year () const { return mDatime.GetYear (); }
38  int month () const { return mDatime.GetMonth (); }
39  int day () const { return mDatime.GetDay (); }
40  int hour () const { return mDatime.GetHour (); }
41  int minute() const { return mDatime.GetMinute(); }
42  int second() const { return mDatime.GetSecond(); }
43  //unsigned int unixTime() const { return mDatime.Convert(); }
44  time_t unixTime() const { TTimeStamp stamp(mDatime.GetYear(), mDatime.GetMonth(), mDatime.GetDay(), mDatime.GetHour(), mDatime.GetMinute(), mDatime.GetSecond()); return stamp.GetSec(); }
45 
46  int numberOfVertices () const;
47  int numberOfJets () const;
48  int numberOfTracks () const;
49  int numberOfTowers () const;
50  int numberOfParticles() const;
51 
52  StJetVertex* vertex(int i = 0) const;
53  StJetCandidate* jet(int i) const;
54  StJetTrack* track(int i) const;
55  StJetTower* tower(int i) const;
56  StJetParticle* particle(int i) const;
57 
58  TClonesArray* vertices () const { return mVertices; }
59  TClonesArray* jets () const { return mJets; }
60  TClonesArray* tracks () const { return mTracks; }
61  TClonesArray* towers () const { return mTowers; }
62  TClonesArray* particles() const { return mParticles; }
63 
64  StJetVertex* newVertex ();
65  StJetCandidate* newJet (const TVector3& vertex, const TLorentzVector& fourMomentum, float area = 0, float area_error = 0);
66  StJetTrack* newTrack ();
67  StJetTower* newTower ();
68  StJetParticle* newParticle();
69 
70 private:
71  friend class StjeJetEventTreeWriter;
72  friend class StJetMaker2009;
73  friend class StJetMaker2012;
74 
75  int mRunId;
76  int mEventId;
77  TDatime mDatime; // Event time should really be moved to skim tree
78 
79  TClonesArray* mVertices;
80  TClonesArray* mJets;
81  TClonesArray* mTracks;
82  TClonesArray* mTowers;
83  TClonesArray* mParticles;
84 
85  ClassDef(StJetEvent,6);
86 };
87 
88 #endif // ST_JET_EVENT_H