17 #include <Geant4/G4LogicalVolume.hh>
18 #include <Geant4/G4NistManager.hh>
19 #include <Geant4/G4Tubs.hh>
20 #include <Geant4/G4SystemOfUnits.hh>
21 #include <Geant4/G4VisAttributes.hh>
22 #include <Geant4/G4PVPlacement.hh>
23 #include <Geant4/G4Transform3D.hh>
24 #include <Geant4/G4RotationMatrix.hh>
25 #include <Geant4/G4ThreeVector.hh>
27 #include <Geant4/G4Track.hh>
28 #include <Geant4/G4Step.hh>
37 G4cout <<
"ExitWindowV2: " <<
fNam << G4endl;
39 G4double
dz = 2.5*meter;
44 G4Tubs *shape =
new G4Tubs(
fNam, radius, radius+thickness, dz/2., 90*deg, 180*deg);
47 G4Material *mat = G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Al");
50 G4LogicalVolume *vol =
new G4LogicalVolume(shape, mat,
fNam);
53 G4VisAttributes *vis =
new G4VisAttributes();
54 vis->SetColor(0, 1, 0, 0.5);
55 vis->SetForceSolid(
true);
56 vol->SetVisAttributes(vis);
59 G4RotationMatrix rot(G4ThreeVector(0, 1, 0), -0.1*
rad);
62 G4ThreeVector
pos(0, 0, zpos);
65 new G4PVPlacement(transform, vol,
fNam, top,
false, 0);
73 G4Track *track = step->GetTrack();
76 if( track->GetParentID() != 0 )
return true;
81 const G4ThreeVector
point = step->GetPostStepPoint()->GetPosition();
89 G4int nsec = 0, nel = 0, npos = 0;
92 const vector<const G4Track*> *sec = step->GetSecondaryInCurrentStep();
93 vector<const G4Track*>::const_iterator i;
94 for(i = sec->begin(); i != sec->end(); i++) {
100 const G4ParticleDefinition *def = (*i)->GetParticleDefinition();
101 G4int
pdg = def->GetPDGEncoding();
105 if(pdg == -11) npos++;
110 if(nsec != 2 || nel != 1 || npos != 1)
return true;
115 const G4ThreeVector cp = step->GetPostStepPoint()->GetPosition();