- if (particleDefinition==0) {
- G4cout << "pdgEncoding: " << pdgEncoding << G4endl;
- G4String text =
- "AliPrimaryGeneratorAction::GenerateAliGeneratorPrimaries:\n";
- text = text + " G4ParticleTable::FindParticle() failed.";
- AliGlobals::Exception(text);
- }
-
- // get/create vertex
- G4ThreeVector position
- = G4ThreeVector(particle->Vx()*TG3Units::Length(),
- particle->Vy()*TG3Units::Length(),
- particle->Vz()*TG3Units::Length());
- G4double time = particle->T()*TG3Units::Time();
- G4PrimaryVertex* vertex;
- if ( i==0 || position != previousPosition || time != previousTime ) {
- // create a new vertex
- // in case position and time of gun particle are different from
- // previous values
- // (vertex objects are destroyed in G4EventManager::ProcessOneEvent()
- // when event is deleted)
- vertex = new G4PrimaryVertex(position, time);
- event->AddPrimaryVertex(vertex);
-
- previousVertex = vertex;
- previousPosition = position;
- previousTime = time;
- }
- else
- vertex = previousVertex;
-
- // create a primary particle and add it to the vertex
- // (primaryParticle objects are destroyed in G4EventManager::ProcessOneEvent()
- // when event and then vertex is deleted)
- G4double px = particle->Px()*TG3Units::Energy();
- G4double py = particle->Py()*TG3Units::Energy();
- G4double pz = particle->Pz()*TG3Units::Energy();
- G4PrimaryParticle* primaryParticle
- = new G4PrimaryParticle(particleDefinition, px, py, pz);
-
- // set polarization
- TVector3 polarization;
- particle->GetPolarisation(polarization);
- primaryParticle
- ->SetPolarization(polarization.X(), polarization.Y(), polarization.Z());
+ if (particleDefinition==0) {
+ G4cout << "pdgEncoding: " << pdgEncoding << G4endl;
+ G4String text =
+ "AliPrimaryGeneratorAction::GenerateAliGeneratorPrimaries:\n";
+ text = text + " G4ParticleTable::FindParticle() failed.";
+ AliGlobals::Exception(text);
+ }
+
+ // get/create vertex
+ G4ThreeVector position
+ = G4ThreeVector(particle->Vx()*TG4G3Units::Length(),
+ particle->Vy()*TG4G3Units::Length(),
+ particle->Vz()*TG4G3Units::Length());
+ G4double time = particle->T()*TG4G3Units::Time();
+ G4PrimaryVertex* vertex;
+ if ( i==0 || position != previousPosition || time != previousTime ) {
+ // create a new vertex
+ // in case position and time of gun particle are different from
+ // previous values
+ // (vertex objects are destroyed in G4EventManager::ProcessOneEvent()
+ // when event is deleted)
+ vertex = new G4PrimaryVertex(position, time);
+ event->AddPrimaryVertex(vertex);
+
+ previousVertex = vertex;
+ previousPosition = position;
+ previousTime = time;
+ }
+ else
+ vertex = previousVertex;
+
+ // create a primary particle and add it to the vertex
+ // (primaryParticle objects are destroyed in G4EventManager::ProcessOneEvent()
+ // when event and then vertex is deleted)
+ G4double px = particle->Px()*TG4G3Units::Energy();
+ G4double py = particle->Py()*TG4G3Units::Energy();
+ G4double pz = particle->Pz()*TG4G3Units::Energy();
+ G4PrimaryParticle* primaryParticle
+ = new G4PrimaryParticle(particleDefinition, px, py, pz);
+
+ // set polarization
+ TVector3 polarization;
+ particle->GetPolarisation(polarization);
+ primaryParticle
+ ->SetPolarization(polarization.X(), polarization.Y(), polarization.Z());