Message: Re: Optical photon as primary particle/Length absorption problem Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: Optical photon as primary particle/Length absorption problem 

Forum: Processes Involving Optical Photons
Re: Sad Optical photon as primary particle/Length absorption problem (Clément DUPONT)
Re: Idea Re: Optical photon as primary particle/Length absorption problem (Michael H. Kelsey)
Re: Note Re: Optical photon as primary particle/Length absorption problem (Clément DUPONT)
Re: Feedback Re: Optical photon as primary particle/Length absorption problem (Gumplinger Peter)
Date: 20 Jan, 2015
From: Clément DUPONT <Clément DUPONT>

Thank you for your help Gumplinger Peter, I totally forgot the polarization! I change my code of PrimaryGeneratorAction() according to your advice :

PrimaryGeneratorAction::PrimaryGeneratorAction()
{
    G4int n_particle = 1;

    particleGun = new G4ParticleGun(n_particle);

    G4double angle = G4UniformRand() * 360.0*deg;
    G4ThreeVector normal (1., 0., 0.);
    G4ThreeVector kphoton = particleGun->GetParticleMomentumDirection();
    G4ThreeVector product = normal.cross(kphoton);
    G4double modul2       = product*product;

    G4ThreeVector e_perpend (0., 0., 1.);
    if (modul2 > 0.) e_perpend = (1./std::sqrt(modul2))*product;
    G4ThreeVector e_paralle    = e_perpend.cross(kphoton);

    G4ThreeVector polar = std::cos(angle)*e_paralle + std::sin(angle)*e_perpend;

    particleGun->SetParticlePolarization(polar);
    particleGun->SetParticleDefinition(G4OpticalPhoton::OpticalPhotonDefinition());
    particleGun->SetParticleTime(0.0*ns);
    particleGun->SetParticlePosition(G4ThreeVector(1*mm, 0*cm, 0*cm));
    particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
    particleGun->SetParticleEnergy(3*eV);//1.96936
}

For now, my optical photon source is placed inside the world. Enclosed to my post, two screenshot to illustrate my problem. Thank you again.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2015/01/20/13.55-33460-1.png
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2015/01/20/13.55-72574-2.png

 Add Message Add Message
to: "Re: Optical photon as primary particle/Length absorption problem"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews