BLCornerTrackRotation Class Reference

Inheritance diagram for BLCornerTrackRotation:

BLManager::SteppingAction

List of all members.


Detailed Description

class BLCornerTrackRotation implements a track rotation for a BLCMDcorner.

Public Member Functions

 BLCornerTrackRotation (G4String _name, G4VPhysicalVolume *pv, G4RotationMatrix &rot)
 constructor.
void UserSteppingAction (const G4Step *step)
 UserSteppingAction() from BLManager::SteppingAction.

Private Attributes

G4String name
G4VPhysicalVolume * thisVol
G4RotationMatrix rotation

Constructor & Destructor Documentation

BLCornerTrackRotation::BLCornerTrackRotation ( G4String  _name,
G4VPhysicalVolume *  pv,
G4RotationMatrix &  rot 
) [inline]

constructor.

References name, rotation, and thisVol.

00124         { name=_name; thisVol = pv; rotation = rot; }


Member Function Documentation

void BLCornerTrackRotation::UserSteppingAction ( const G4Step *  step  )  [virtual]

UserSteppingAction() from BLManager::SteppingAction.

Implements BLManager::SteppingAction.

References rotation, and thisVol.

00315 {
00316         // process all states
00317 
00318         // get basic physical-volume info
00319         G4StepPoint *prePoint = step->GetPreStepPoint();
00320         if(!prePoint) return;
00321         G4VPhysicalVolume *preVol = prePoint->GetPhysicalVolume();
00322         if(!preVol) return;
00323         G4StepPoint *postPoint = step->GetPostStepPoint();
00324         if(!postPoint) return;
00325         G4VPhysicalVolume *postVol = postPoint->GetPhysicalVolume();
00326         if(!postVol) return;
00327         
00328         // return if not entering thisVol
00329         if(preVol == postVol || postVol != thisVol) return;
00330 
00331         // get more info
00332         G4Track *track = step->GetTrack();
00333 
00334         // rotate the track
00335         G4ThreeVector dir(track->GetMomentumDirection());
00336         dir = rotation * dir;
00337         ((G4Track *)track)->SetMomentumDirection(dir);
00338         postPoint->SetMomentumDirection(dir);
00339         ((G4Step *)step)->UpdateTrack();
00340 }


Member Data Documentation

G4String BLCornerTrackRotation::name [private]

Referenced by BLCornerTrackRotation().

G4VPhysicalVolume* BLCornerTrackRotation::thisVol [private]

G4RotationMatrix BLCornerTrackRotation::rotation [private]


The documentation for this class was generated from the following file:
g4beamline