Message: Sharing copynumber?  Not Logged In (login) 
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::outstd::ios::app); file<<setw(10)<<particlename <<setw(20)<<Energy/eV<<setw(10)<<PostCopyNum<<setw(10)<<EventId<<endl; } if ((particlename =="e")&&(VolumeName!="Shape3")&&(VolumeName1=="Shape3"))//reach shape3 { std::fstream file("shape3.txt", std::ios::outstd::ios::app); file<<setw(10)<<particlename <<setw(20)<<Energy/eV<<setw(10)<<PostCopyNum<<setw(10)<<EventId<<endl; }
However,I got this: detector: e 270.81 15 154 e 271.174 15 1458 e 270.12 15 2585 e 271.163 15 14579 e 270.798 15 22898 e 270.699 15 25045 e 270.838 15 26794 e 270.698 15 29550 e 269.119 15 32584 e 270.812 15 34249 e 270.725 15 37012 e 271.174 15 76952 e 271.2 15 77952 e 270.837 15 83914 e 270.953 15 84582 e 270.81 15 154 e 271.174 15 1458 e 270.12 15 2585 e 271.163 15 14579 e 270.798 15 22898 e 270.699 15 25045 e 270.838 15 26794 e 270.698 15 29550 e 269.119 15 32584 e 270.812 15 34249 e 270.725 15 37012 e 271.174 15 76952 e 271.2 15 77952 e 270.837 15 83914 e 270.953 15 84582
Shape3(All detectors): e 270.81 15 154 e 271.174 15 1458 e 270.12 15 2585 e 271.163 15 14579 e 270.798 15 22898 e 270.699 15 25045 e 270.838 15 26794 e 270.698 15 29550 e 269.119 15 32584 e 270.812 15 34249 e 270.725 15 37012 e 271.174 15 76952 e 271.2 15 77952 e 270.837 15 83914 e 270.953 15 84582 It seems like all detectors sharing the same copynumber. Do you have any suggestions? Thanks Selina

Inline Depth:  Outline Depth:  Add message: 
to: 