musrTrackerHit Class Reference

#include <musrTrackerHit.hh>

List of all members.

Public Member Functions

 musrTrackerHit ()
 ~musrTrackerHit ()
 musrTrackerHit (const musrTrackerHit &)
const musrTrackerHitoperator= (const musrTrackerHit &)
G4int operator== (const musrTrackerHit &) const
void * operator new (size_t)
void operator delete (void *)
void Draw ()
void Print ()
void SetParticleName (G4String name)
void SetTrackID (G4int track)
void SetEdep (G4double de)
void SetPos (G4ThreeVector xyz)
void SetPol (G4ThreeVector ijk)
G4String GetParticleName ()
G4int GetTrackID ()
G4double GetEdep ()
G4ThreeVector GetPos ()
G4ThreeVector GetPol ()

Public Attributes

G4double point [4]
G4double B [6]
const G4Field * mfield


Detailed Description

Definition at line 16 of file musrTrackerHit.hh.


Constructor & Destructor Documentation

musrTrackerHit::musrTrackerHit  ) 
 

Definition at line 26 of file musrTrackerHit.cc.

00026 {}

musrTrackerHit::~musrTrackerHit  ) 
 

Definition at line 30 of file musrTrackerHit.cc.

00030 {}

musrTrackerHit::musrTrackerHit const musrTrackerHit  ) 
 

Definition at line 34 of file musrTrackerHit.cc.

References edep, particle_name, pol, pos, and trackID.

00035   : G4VHit()
00036 {
00037   particle_name = right.particle_name;
00038   trackID   = right.trackID;
00039   edep      = right.edep;
00040   pos       = right.pos;
00041   pol       = right.pol;
00042 }


Member Function Documentation

void musrTrackerHit::Draw  ) 
 

Definition at line 65 of file musrTrackerHit.cc.

Referenced by musrTrackerSD::ProcessHits().

00066 {
00067   G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
00068   if(pVVisManager)
00069   {
00070     G4Circle circle(pos);
00071     circle.SetScreenSize(0.04);
00072     circle.SetFillStyle(G4Circle::filled);
00073     G4Colour colour(1.,0.,0.);
00074     G4VisAttributes attribs(colour);
00075     circle.SetVisAttributes(attribs);
00076     pVVisManager->Draw(circle);
00077   }
00078 }

G4double musrTrackerHit::GetEdep  )  [inline]
 

Definition at line 42 of file musrTrackerHit.hh.

00042 { return edep; };      

G4String musrTrackerHit::GetParticleName  )  [inline]
 

Definition at line 40 of file musrTrackerHit.hh.

00040 {return particle_name; };

G4ThreeVector musrTrackerHit::GetPol  )  [inline]
 

Definition at line 44 of file musrTrackerHit.hh.

00044 { return pol; };

G4ThreeVector musrTrackerHit::GetPos  )  [inline]
 

Definition at line 43 of file musrTrackerHit.hh.

00043 { return pos; };

G4int musrTrackerHit::GetTrackID  )  [inline]
 

Definition at line 41 of file musrTrackerHit.hh.

00041 { return trackID; };

void musrTrackerHit::operator delete void *   )  [inline]
 

Definition at line 75 of file musrTrackerHit.hh.

References musrTrackerHitAllocator.

00076 {
00077   musrTrackerHitAllocator.FreeSingle((musrTrackerHit*) aHit);
00078 }

void * musrTrackerHit::operator new size_t   )  [inline]
 

Definition at line 66 of file musrTrackerHit.hh.

References musrTrackerHitAllocator.

00067 {
00068   void *aHit;
00069   aHit = (void *) musrTrackerHitAllocator.MallocSingle();
00070   return aHit;
00071 }

const musrTrackerHit & musrTrackerHit::operator= const musrTrackerHit  ) 
 

Definition at line 46 of file musrTrackerHit.cc.

References edep, particle_name, pol, pos, and trackID.

00047 {
00048   particle_name = right.particle_name;
00049   trackID   = right.trackID;
00050   edep      = right.edep;
00051   pos       = right.pos;
00052   pol       = right.pol;
00053   return *this;
00054 }

G4int musrTrackerHit::operator== const musrTrackerHit  )  const
 

Definition at line 58 of file musrTrackerHit.cc.

00059 {
00060   return (this==&right) ? 1 : 0;
00061 }

void musrTrackerHit::Print  ) 
 

Definition at line 82 of file musrTrackerHit.cc.

References B, mfield, and point.

Referenced by musrTrackerSD::ProcessHits().

00083 {
00084 
00085   if (trackID==1)
00086     {
00087 
00088         G4FieldManager *fMgr=G4TransportationManager::GetTransportationManager()->GetFieldManager();
00089 
00090 
00091           point[0]=0.;
00092           point[1]=0.;
00093           point[2]=0.;
00094 
00095           B[2]=0.0;
00096               
00097 
00098       if(!fMgr->DoesFieldChangeEnergy())//then we have a magnetic field
00099         {
00100           mfield = fMgr->GetDetectorField();
00101           mfield->GetFieldValue(point,B);
00102           B[0]=B[0]*1000;
00103           B[1]=B[1]*1000;
00104           B[2]=B[2]*1000;
00105           //          G4cout <<"Magnetic field at origin B ="<< B[2] << " T"<<G4endl;
00106 }
00107       else{
00108         //          G4cout <<"Magnetic field at origin B = 0 T" << G4endl;
00109       }
00110 
00111 
00112   ofstream mufile1;
00113   mufile1.open ("muposition.dat", ios::out | ios::app);
00114   mufile1 << fabs(B[2]) <<" "<< pos.x()/cm<<" "<<pos.y()/cm <<" "<< pos.z()/cm  << G4endl;
00115   mufile1.close();
00116 
00117     ofstream mufile2;
00118     mufile2.open ("mupol.dat", ios::out | ios::app);
00119   mufile2 << pos.x()/m<<" "<<pos.y()/m <<" "<< pos.z()/m<<" " 
00120           << pol.x()<<" "<<pol.y()<<" "<< pol.z() <<G4endl;
00121   mufile2.close();
00122     }
00123 }

void musrTrackerHit::SetEdep G4double  de  )  [inline]
 

Definition at line 36 of file musrTrackerHit.hh.

Referenced by musrTrackerSD::ProcessHits().

00036 { edep = de; };

void musrTrackerHit::SetParticleName G4String  name  )  [inline]
 

Definition at line 34 of file musrTrackerHit.hh.

Referenced by musrTrackerSD::ProcessHits().

00034 {particle_name = name; };

void musrTrackerHit::SetPol G4ThreeVector  ijk  )  [inline]
 

Definition at line 38 of file musrTrackerHit.hh.

Referenced by musrTrackerSD::ProcessHits().

00038 {pol = ijk;};

void musrTrackerHit::SetPos G4ThreeVector  xyz  )  [inline]
 

Definition at line 37 of file musrTrackerHit.hh.

Referenced by musrTrackerSD::ProcessHits().

00037 { pos = xyz; };

void musrTrackerHit::SetTrackID G4int  track  )  [inline]
 

Definition at line 35 of file musrTrackerHit.hh.

Referenced by musrTrackerSD::ProcessHits().

00035 { trackID = track; };


Member Data Documentation

G4double musrTrackerHit::B[6]
 

Definition at line 46 of file musrTrackerHit.hh.

Referenced by Print().

const G4Field* musrTrackerHit::mfield
 

Definition at line 47 of file musrTrackerHit.hh.

Referenced by Print().

G4double musrTrackerHit::point[4]
 

Definition at line 44 of file musrTrackerHit.hh.

Referenced by Print().


The documentation for this class was generated from the following files:
Generated on Mon Mar 27 12:19:54 2006 for MUSR by  doxygen 1.4.6