/home/cern/BDSIM_new/src/BDSDumpSD.cc

00001 //  
00002 //   BDSIM, (C) 2001-2007
00003 //    
00004 //   version 0.4 
00005 //   last modified : 11 Oct 2007 by malton@pp.rhul.ac.uk
00006 //  
00007 
00008 
00009 //
00010 //    beam dumper/reader for online exchange - Sensitive Detector
00011 //
00012 
00013 const int DEBUG = 0;
00014 
00015 #include "BDSGlobalConstants.hh" // must be first in include list
00016 
00017 #include "BDSDumpSD.hh"
00018 #include "BDSSamplerHit.hh"
00019 #include "G4VPhysicalVolume.hh"
00020 #include "G4LogicalVolume.hh"
00021 #include "G4Track.hh"
00022 #include "G4Step.hh"
00023 #include "G4ParticleDefinition.hh"
00024 #include "G4VTouchable.hh"
00025 #include "G4TouchableHistory.hh"
00026 #include "G4ios.hh"
00027 #include "G4RotationMatrix.hh"
00028 #include "G4ThreeVector.hh"
00029 
00030 #include "G4Navigator.hh"
00031 #include "G4AffineTransform.hh"
00032 
00033 #include "G4RunManager.hh"
00034 #include <vector>
00035 
00036 #include "G4SDManager.hh"
00037 
00038 extern G4double initial_x,initial_xp,initial_y,initial_yp,initial_z,initial_E;
00039 
00040 
00041 BDSDumpSD::BDSDumpSD(G4String name, G4String type)
00042   :G4VSensitiveDetector(name),StoreHit(true),itsType(type)
00043 {
00044   //itsCollectionName="Dump_"+type;
00045   //collectionName.insert(itsCollectionName);  
00046 }
00047 
00048 BDSDumpSD::~BDSDumpSD()
00049 {;}
00050 
00051 void BDSDumpSD::Initialize(G4HCofThisEvent*HCE)
00052 {
00053   //DumpCollection = 
00054   //  new BDSDumpHitsCollection(SensitiveDetectorName,itsCollectionName);
00055 }
00056 
00057 G4bool BDSDumpSD::ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist)
00058 {
00059   G4Track* theTrack=aStep->GetTrack();
00060  
00061   // postpone the track
00062   if(theTrack->GetParentID() == 0){
00063     if(DEBUG) G4cout<<"Dump: postponing track..."<<G4endl;
00064     BDSGlobals->setWaitingForDump(true);
00065     theTrack->SetTrackStatus(fPostponeToNextEvent);
00066 
00067     G4AffineTransform tf(aStep->GetPreStepPoint()->GetTouchable()->
00068                                 GetHistory()->GetTopTransform().Inverse());
00069     BDSGlobals->SetDumpTransform(tf);
00070   }
00071   return true;
00072 }
00073 
00074 void BDSDumpSD::EndOfEvent(G4HCofThisEvent*HCE)
00075 {
00076 
00077 }
00078 
00079 void BDSDumpSD::clear(){} 
00080 
00081 void BDSDumpSD::DrawAll(){} 
00082 
00083 void BDSDumpSD::PrintAll(){} 
00084 

Generated on Wed Mar 5 17:25:22 2008 for BDSIM by  doxygen 1.5.3