Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ITTrackingInteractivity Class Reference

#include <ITTrackingInteractivity.hh>

Inheritance diagram for ITTrackingInteractivity:
Collaboration diagram for ITTrackingInteractivity:

Public Member Functions

 ITTrackingInteractivity ()
 
virtual ~ITTrackingInteractivity ()
 
virtual void Initialize ()
 
virtual void StartTracking (G4Track *)
 
virtual void AppendStep (G4Track *track, G4Step *step)
 
virtual void EndTracking (G4Track *)
 
virtual void Finalize ()
 
void SetUserAction (G4UserTrackingAction *)
 
G4UserTrackingActionGetUserTrackingAction ()
 
void SetUserAction (G4UserSteppingAction *)
 
G4UserSteppingActionGetUserSteppingAction ()
 
- Public Member Functions inherited from G4ITTrackingInteractivity
 G4ITTrackingInteractivity (G4VITSteppingVerbose *verbose=0)
 
virtual ~G4ITTrackingInteractivity ()
 
virtual void TrackBanner (G4Track *, const G4String &message="")
 
void SetVerbose (int flag)
 
G4int GetVerboseLevel () const
 
void SetSteppingVerboseLevel (G4int level)
 
G4int GetSteppingVerboseLevel () const
 
G4VITSteppingVerboseGetSteppingVerbose ()
 
void SetSteppingVerbose (G4VITSteppingVerbose *verbose)
 

Additional Inherited Members

- Protected Attributes inherited from G4ITTrackingInteractivity
int fVerboseLevel
 

Detailed Description

Definition at line 49 of file ITTrackingInteractivity.hh.

Constructor & Destructor Documentation

ITTrackingInteractivity::ITTrackingInteractivity ( )

Definition at line 65 of file ITTrackingInteractivity.cc.

66 {
67  fStoreTrajectory = 0;
68  fVerboseLevel = 0;
69 
70  fpUserTrackingAction = 0;
71  fpUserSteppingAction = 0;
72 
74  // In case you want to use same tracking/stepping action
75  // for normal and IT stepping
76  /*
77  fpUserTrackingAction =
78  trackingManager->GetUserTrackingAction();
79  fpUserSteppingAction =
80  G4EventManager::GetEventManager()->GetUserSteppingAction();
81  */
83 }
ITTrackingInteractivity::~ITTrackingInteractivity ( )
virtual

Definition at line 87 of file ITTrackingInteractivity.cc.

88 {
89  G4EventManager* eventManager =
91 
92  if (eventManager)
93  {
94  G4UserTrackingAction* std_trackAct =
95  eventManager->GetUserTrackingAction();
96  if(fpUserTrackingAction != std_trackAct && fpUserTrackingAction)
97  delete fpUserTrackingAction;
98 
99  G4UserSteppingAction* std_stepAct =
100  eventManager->GetUserSteppingAction();
101  if(fpUserSteppingAction != std_stepAct && fpUserSteppingAction)
102  delete fpUserSteppingAction;
103  }
104  else
105  {
106  if(fpUserSteppingAction)
107  {
108  delete fpUserSteppingAction;
109  }
110 
111  if(fpUserTrackingAction)
112  {
113  delete fpUserTrackingAction;
114  }
115  }
116 }
G4UserSteppingAction * GetUserSteppingAction()
G4UserTrackingAction * GetUserTrackingAction()
static G4EventManager * GetEventManager()

Here is the call graph for this function:

Member Function Documentation

void ITTrackingInteractivity::AppendStep ( G4Track track,
G4Step step 
)
virtual

Reimplemented from G4ITTrackingInteractivity.

Definition at line 172 of file ITTrackingInteractivity.cc.

173 {
175  // If you want to use sensitive detector
176  /*
177  G4VPhysicalVolume* currentVolume =
178  step->GetPreStepPoint()->GetPhysicalVolume();
179  G4SteppingControl stepControlFlag = step->GetControlFlag();
180 
181  if( currentVolume != 0 && stepControlFlag != AvoidHitInvocation)
182  {
183  G4VSensitiveDetector* sensitive = step->GetPreStepPoint()->
184  GetSensitiveDetector();
185  if( sensitive != 0 )
186  {
187  sensitive->Hit(fpStep);
188  }
189  }
190  */
192 
193  if(fpUserSteppingAction)
194  fpUserSteppingAction->UserSteppingAction(step);
195 
197  // If you want to use regional stepping action
198  /*
199  G4UserSteppingAction* regionalAction
200  = fpStep->GetPreStepPoint()->GetPhysicalVolume()->
201  GetLogicalVolume()->GetRegion()->
202  GetRegionalSteppingAction();
203  if( regionalAction ) regionalAction->UserSteppingAction(fpStep);
204  */
206 
207  if(fStoreTrajectory)
208  {
209  G4TrackingInformation* trackingInfo =
210  GetIT(track)->GetTrackingInfo();
211  G4Trajectory_Lock* trajectory_lock =
212  trackingInfo->GetTrajectory_Lock();
213  trajectory_lock->fpTrajectory->AppendStep(step);
214  }
215 }
virtual void UserSteppingAction(const G4Step *)
G4IT * GetIT(const G4Track *track)
Definition: G4IT.cc:49
G4TrackingInformation * GetTrackingInfo()
Definition: G4IT.hh:144
virtual void AppendStep(const G4Step *aStep)=0
G4Trajectory_Lock * GetTrajectory_Lock()

Here is the call graph for this function:

void ITTrackingInteractivity::EndTracking ( G4Track track)
virtual

Reimplemented from G4ITTrackingInteractivity.

Definition at line 219 of file ITTrackingInteractivity.cc.

220 {
221 #ifdef G4VERBOSE
222  if(fVerboseLevel)
223  {
224  TrackBanner(track, "G4ITTrackingManager::EndTracking : ");
225  }
226 #endif
227  // Post tracking user intervention process.
228  if( fpUserTrackingAction != 0 ) {
229  fpUserTrackingAction->PostUserTrackingAction(track);
230  }
231 
232 //#ifdef G4_STORE_TRAJECTORY
233  G4TrackingInformation* trackingInfo =
234  GetIT(track)->GetTrackingInfo();
235  G4Trajectory_Lock* trajectory_lock =
236  trackingInfo->GetTrajectory_Lock();
237 
238  if(trajectory_lock)
239  {
240  G4VTrajectory*& trajectory = trajectory_lock->fpTrajectory;
241 
242  if(fStoreTrajectory && trajectory)
243  {
244 
245 #ifdef G4VERBOSE
246  if(fVerboseLevel>10) trajectory->ShowTrajectory();
247 #endif
248  G4TrackStatus istop = track->GetTrackStatus();
249 
250  if (trajectory && (istop != fStopButAlive) && (istop != fSuspend))
251  {
252  G4Event* currentEvent = G4EventManager::GetEventManager()
254 
255  if (currentEvent)
256  {
257  G4TrajectoryContainer* trajectoryContainer = currentEvent
259 
260  if (!trajectoryContainer)
261  {
262  trajectoryContainer = new G4TrajectoryContainer;
263  currentEvent->SetTrajectoryContainer(trajectoryContainer);
264  }
265  trajectoryContainer->insert(trajectory);
266  }
267  else
268  {
269  fTrajectories.push_back(trajectory);
270  }
271  }
272  }
273  // Destruct the trajectory if it was created
274  else if( (!fStoreTrajectory)&&trajectory ) {
275  delete trajectory;
276  trajectory = 0;
277  }
278  delete trajectory_lock;
279  trackingInfo->SetTrajectory_Lock(0);
280  }
281 //#endif
282 }
G4TrackStatus GetTrackStatus() const
G4TrajectoryContainer * GetTrajectoryContainer() const
Definition: G4Event.hh:189
void SetTrajectory_Lock(G4Trajectory_Lock *trajLock)
G4Event * GetNonconstCurrentEvent()
G4IT * GetIT(const G4Track *track)
Definition: G4IT.cc:49
virtual void TrackBanner(G4Track *, const G4String &message="")
G4bool insert(G4VTrajectory *p)
G4TrackingInformation * GetTrackingInfo()
Definition: G4IT.hh:144
virtual void PostUserTrackingAction(const G4Track *)
static G4EventManager * GetEventManager()
G4Trajectory_Lock * GetTrajectory_Lock()
void SetTrajectoryContainer(G4TrajectoryContainer *value)
Definition: G4Event.hh:121
virtual void ShowTrajectory(std::ostream &os=G4cout) const
G4TrackStatus

Here is the call graph for this function:

void ITTrackingInteractivity::Finalize ( )
virtual

Reimplemented from G4ITTrackingInteractivity.

Definition at line 284 of file ITTrackingInteractivity.cc.

285 {
286  for (std::vector<G4VTrajectory*>::iterator it = fTrajectories.begin();
287  it != fTrajectories.end(); it++)
288  {
290  }
291 }
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
static G4VVisManager * GetConcreteInstance()

Here is the call graph for this function:

G4UserSteppingAction * ITTrackingInteractivity::GetUserSteppingAction ( )
inline

Definition at line 86 of file ITTrackingInteractivity.hh.

87 {
88  return fpUserSteppingAction;
89 }
G4UserTrackingAction * ITTrackingInteractivity::GetUserTrackingAction ( )
inline

Definition at line 92 of file ITTrackingInteractivity.hh.

93 {
94  return fpUserTrackingAction;
95 }
void ITTrackingInteractivity::Initialize ( )
virtual

Reimplemented from G4ITTrackingInteractivity.

Definition at line 120 of file ITTrackingInteractivity.cc.

121 {
122  G4TrackingManager* trackingManager =
124  fStoreTrajectory = trackingManager->GetStoreTrajectory();
125  fVerboseLevel = trackingManager->GetVerboseLevel();
126 }
G4TrackingManager * GetTrackingManager() const
static G4EventManager * GetEventManager()
G4int GetStoreTrajectory() const
G4int GetVerboseLevel() const

Here is the call graph for this function:

void ITTrackingInteractivity::SetUserAction ( G4UserTrackingAction trackAct)
inline

Definition at line 74 of file ITTrackingInteractivity.hh.

75 {
76  fpUserTrackingAction = trackAct;
77 }
void ITTrackingInteractivity::SetUserAction ( G4UserSteppingAction stepAct)
inline

Definition at line 80 of file ITTrackingInteractivity.hh.

81 {
82  fpUserSteppingAction = stepAct;
83 }
void ITTrackingInteractivity::StartTracking ( G4Track track)
virtual

Reimplemented from G4ITTrackingInteractivity.

Definition at line 130 of file ITTrackingInteractivity.cc.

131 {
132 #ifdef G4VERBOSE
133  if(fVerboseLevel)
134  {
135  TrackBanner(track, "G4ITTrackingManager::StartTracking : ");
136  }
137 #endif
138 
140  TrackBanner(track);
141 
142  // Pre tracking user intervention process.
143  if( fpUserTrackingAction != 0 ) {
144  fpUserTrackingAction->PreUserTrackingAction(track);
145  }
146 //#ifdef G4_STORE_TRAJECTORY
147  G4TrackingInformation* trackingInfo = GetIT(track)->GetTrackingInfo();
148  G4Trajectory_Lock* trajectory_lock =
149  trackingInfo->GetTrajectory_Lock();
150 
151  // Construct a trajectory if it is requested
152  if(fStoreTrajectory&&(!trajectory_lock))
153  {
154  trajectory_lock = new G4Trajectory_Lock();
155  trackingInfo->SetTrajectory_Lock(trajectory_lock);
156  G4VTrajectory* trajectory = 0;
157  // default trajectory concrete class object
158  switch (fStoreTrajectory) {
159  default:
160  case 1: trajectory = new G4Trajectory(track); break;
161  case 2: trajectory = new G4SmoothTrajectory(track); break;
162  case 3: trajectory = new G4RichTrajectory(track); break;
163  }
164  trajectory_lock->fpTrajectory = trajectory;
165  }
166 //#endif
167 }
void SetTrajectory_Lock(G4Trajectory_Lock *trajLock)
G4IT * GetIT(const G4Track *track)
Definition: G4IT.cc:49
virtual void TrackBanner(G4Track *, const G4String &message="")
static G4int GetSilent()
G4TrackingInformation * GetTrackingInfo()
Definition: G4IT.hh:144
G4Trajectory_Lock * GetTrajectory_Lock()
virtual void PreUserTrackingAction(const G4Track *)

Here is the call graph for this function:


The documentation for this class was generated from the following files: