Message: Sharing copynumber? Not Logged In (login)

## Sharing copynumber?

Forum: Event and Track Management
Date: 23 Apr, 2016
From: Selina Chen <Selina Chen>

 Hi all,I ran into some difficulties. I constructed a detector like this ``` G4Tubs* solidShape3= new G4Tubs("Shape3", innerradiusofthetube, outradiusofthetube, heightofthetube, startingleofthetube, spanningangleofthetube); G4LogicalVolume* logicShape3 = new G4LogicalVolume(solidShape3, //its solid shape3_mat, //its material "Shape3"); //its name``` // place crystals within a ring ``` for (G4int icrys = 0; icrys < nb_shape3 ; icrys++) { G4double phi = icrys*dPhi; G4RotationMatrix rotm = G4RotationMatrix(); rotm.rotateY(90*deg); rotm.rotateZ(phi); G4ThreeVector uz = G4ThreeVector(std::cos(phi), std::sin(phi),0.); G4ThreeVector position = (15*mm)*uz; G4Transform3D transform = G4Transform3D(rotm,position);``` ``` new G4PVPlacement(transform, //rotation,position logicShape3, //its logical volume "Shape3", //its name logicWorld, //its mother volume false, //no boolean operation icrys, //copy number checkOverlaps); // checking overlaps ``` } And I want to get the energy of electrons energy arriving each detector,so in SteppingAction,I use this: ` G4double Energy= aStep->GetTrack()->GetKineticEnergy();` ` G4int PostCopyNum = aStep->GetPostStepPoint()->GetTouchableHandle()->GetCopyNumber();` ` const G4VPhysicalVolume* volume = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();` ``` const G4VPhysicalVolume* volume1 = aStep->GetPostStepPoint()->GetTouchableHandle()->GetVolume(); ... ... ... if ((particlename =="e-")&&(VolumeName!="Shape3")&&(VolumeName1=="Shape3")&&(PostCopyNum=16)) { std::fstream file("detector16.txt", std::ios::out|std::ios::app); file<

 Inline Depth: Outline Depth: Add message:

1 Re: Sharing copynumber?   (Artem Zontikov - 23 Apr, 2016)
 to: "Sharing copynumber?"
This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]