source: ELYSE/tags/v1r1/ELYSE/TrackInformation.hh @ 421

Last change on this file since 421 was 286, checked in by campagne, 17 years ago

ELYSE sauvegarde provisoire (JEC)

File size: 2.1 KB
Line 
1#ifndef ELYSETrackInformation_h
2#define ELYSETrackInformation_h 1
3
4
5#include "globals.hh"
6#include "G4Track.hh"
7#include "G4Allocator.hh"
8#include "G4VUserTrackInformation.hh"
9
10namespace ELYSE {
11
12enum TrackStatus { active=1, hitProduced=2, absorbed=4, boundaryAbsorbed=8,
13                    inactive=14};
14
15/*
16  TrackStatus:
17  active: still being tracked
18  hitProduced: being detected in the Tyvek
19  absorbed: stopped by being absorbed with G4OpAbsorbtion
20  boundaryAbsorbed: stopped by being aborbed with G4OpAbsorbtion
21  inactive: track is stopped for some reason
22   -This is the sum of all stopped flags so can be used to remove stopped flags 
23 
24   JEC 13/2/07: see if "absorbed" and "boundaryAbsorbed" are similar? see LXe example
25*/
26
27class TrackInformation : public G4VUserTrackInformation {
28
29public:
30  TrackInformation(): saveit(false), drawit(false), status(active) {}
31  TrackInformation(const G4Track*);
32  virtual ~TrackInformation() {}
33 
34  inline void *operator new(size_t);
35  inline void operator delete(void *aTrackInfo);
36  inline int operator ==(const TrackInformation& right) const
37  {return (this==&right);}
38
39 
40  //Sets the track status to s (does not check validity of flags)
41  void SetTrackStatusFlags(G4int s){status=s;}
42  //Does a smart add of track status flags (disabling old flags that conflict)
43  //If s conflicts with itself it will not be detected
44  void AddTrackStatusFlag(G4int s);
45  int GetTrackStatus()  {return status;}
46
47  void SetDrawOption(G4bool b) {drawit = b;}
48  G4bool GetDrawOption() {return drawit;}
49
50  void SetSaveOption(G4bool b) {saveit = b;}
51  G4bool GetSaveOption() {return saveit;}
52
53  void Print() const;
54
55
56private:
57  G4bool saveit; 
58  G4bool drawit;
59  G4int  status; 
60
61};
62}
63
64namespace ELYSE {
65  extern G4Allocator<TrackInformation> aTrackInfoAllocator;
66}
67
68inline void* ELYSE::TrackInformation::operator new(size_t) { 
69  void* aTrackInfo;
70  aTrackInfo = (void*)ELYSE::aTrackInfoAllocator.MallocSingle();
71  return aTrackInfo;
72}
73
74inline void ELYSE::TrackInformation::operator delete(void *aTrackInfo){ 
75  ELYSE::aTrackInfoAllocator.FreeSingle((ELYSE::TrackInformation*)aTrackInfo);
76}
77
78
79#endif
Note: See TracBrowser for help on using the repository browser.