Initial version
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Jan 2001 08:49:29 +0000 (08:49 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Jan 2001 08:49:29 +0000 (08:49 +0000)
AliGeant4/AliTrackInformation.cxx [new file with mode: 0644]
AliGeant4/AliTrackInformation.h [new file with mode: 0644]
AliGeant4/AliTrackInformation.icc [new file with mode: 0644]

diff --git a/AliGeant4/AliTrackInformation.cxx b/AliGeant4/AliTrackInformation.cxx
new file mode 100644 (file)
index 0000000..3085db2
--- /dev/null
@@ -0,0 +1,48 @@
+// $Id$
+// Category: event
+//
+// See the class description in the header file.
+
+#include "AliTrackInformation.h"
+
+G4Allocator<AliTrackInformation> trackInfoAllocator;
+
+AliTrackInformation::AliTrackInformation()
+  : G4VUserTrackInformation(),
+    fTrackParticleID(-1),
+    fParentParticleID(-1) 
+{
+//
+}
+
+AliTrackInformation::AliTrackInformation(G4int trackParticleID) 
+  : G4VUserTrackInformation(),
+    fTrackParticleID(trackParticleID),
+    fParentParticleID(-1)
+{
+//
+}    
+
+AliTrackInformation::AliTrackInformation(G4int trackParticleID, 
+                                         G4int parentParticleID)
+  : G4VUserTrackInformation(),
+    fTrackParticleID(trackParticleID),
+    fParentParticleID(parentParticleID)
+{
+//
+}    
+
+AliTrackInformation::~AliTrackInformation(){
+//
+}    
+
+// public methods
+
+void AliTrackInformation::Print() const
+{
+// Prints track information.
+// ---
+
+  G4cout << "TrackParticleID: " << fTrackParticleID << "   "
+         << "ParentParticleID: " << fParentParticleID << G4endl;
+}
diff --git a/AliGeant4/AliTrackInformation.h b/AliGeant4/AliTrackInformation.h
new file mode 100644 (file)
index 0000000..e0ec18b
--- /dev/null
@@ -0,0 +1,48 @@
+// $Id$
+// Category: event
+//
+// Class with additional track information.
+
+#ifndef ALI_TRACK_INFORMATION_H
+#define ALI_TRACK_INFORMATION_H
+
+#include <G4VUserTrackInformation.hh>
+#include <G4Allocator.hh>
+#include <globals.hh>
+
+class AliTrackInformation : public G4VUserTrackInformation
+{
+  public:
+    AliTrackInformation();
+    AliTrackInformation(G4int trackParticleID);
+    AliTrackInformation(G4int trackParticleID, G4int parentParticleID);
+    virtual ~AliTrackInformation();
+   
+    // operators
+    // required by G4
+    inline void *operator new(size_t);
+      // Override "new" for "G4Allocator".
+    inline void operator delete(void *trackInformation);
+      // Override "delete" for "G4Allocator".
+      
+    // methods
+    virtual void Print() const;  
+
+    // set methods
+    void SetTrackParticleID(G4int trackParticleID);
+    void SetParentParticleID(G4int parentParticleID);
+
+    // get methods
+    G4int GetTrackParticleID() const;
+    G4int GetParentParticleID() const;
+
+  private:
+    // data members
+    G4int  fTrackParticleID; //the index of track particle in AliRoot stack
+    G4int  fParentParticleID;//the index of parent track in AliRoot stack
+};
+
+// inline methods
+#include "AliTrackInformation.icc"
+
+#endif //ALI_TRACK_INFORMATION_H
diff --git a/AliGeant4/AliTrackInformation.icc b/AliGeant4/AliTrackInformation.icc
new file mode 100644 (file)
index 0000000..eb1b251
--- /dev/null
@@ -0,0 +1,38 @@
+// $Id$
+// Category: event
+
+// inline operators
+
+extern G4Allocator<AliTrackInformation> trackInfoAllocator;
+
+inline void* AliTrackInformation::operator new(size_t) 
+{
+// Override "new" for "G4Allocator".
+// ---
+
+  void *trackInfo;
+  trackInfo = (void *) trackInfoAllocator.MallocSingle();
+  return trackInfo;
+}
+
+inline void AliTrackInformation::operator delete(void *trackInfo)
+{ 
+// Override "delete" for "G4Allocator".
+// ---
+
+  trackInfoAllocator.FreeSingle((AliTrackInformation *) trackInfo);
+}
+
+// inline methods
+
+inline void AliTrackInformation::SetTrackParticleID(G4int trackParticleID)
+{ fTrackParticleID = trackParticleID; }
+
+inline void AliTrackInformation::SetParentParticleID(G4int parentParticleID)
+{ fParentParticleID = parentParticleID; }
+
+inline G4int AliTrackInformation::GetTrackParticleID() const
+{ return fTrackParticleID; }
+
+inline G4int AliTrackInformation::GetParentParticleID() const
+{ return fParentParticleID; }