Problem 910 - THe weight of the primary vertex is not correctly passed to the first track of an event.
Summary: THe weight of the primary vertex is not correctly passed to the first track o...
Status: RESOLVED WONTFIX
Alias: None
Product: Geant4
Classification: Unclassified
Component: event (show other problems)
Version: 8.1
Hardware: PC Linux
: P1 critical
Assignee: Makoto.Asai
URL:
Depends on:
Blocks:
 
Reported: 2006-11-27 02:53 CET by desorgher
Modified: 2006-11-28 10:28 CET (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description desorgher 2006-11-27 02:53:52 CET
In Geant4.8.1 if the user set the weight of a generated particle in the
PrimaraGeneratorAction, this weight is not correctly passed to the first
track of an event.


To illustrate this I did modify the novice example 03 by adding:
a) at the end of  void ExN03PrimaryGeneratorAction::GeneratePrimaries(G4Event*
anEvent) the following two lines:
  anEvent->GetPrimaryVertex()->SetWeight(1000.);
   G4cout<<"Primary Weight "<<anEvent->GetPrimaryVertex()->SetWeight(1000.);

b)at the end of void ExN03SteppingAction::UserSteppingAction(const G4Step* aStep)

   G4cout<<"Track Weight "<< aStep->GetTrack()->GetWeight()<<std::endl;

When tracking a geantino in the geometry I get the print out reproduced at the
end of this message.
It is clear that the primary weight is not correctly passed to the
first track.

I think that the problem comes form the G4PrimaryTransformer.hh class.
Indeed in one of my code where I use my  own EventManager,  by
copying the G4PrimaryTransformer in a new class called MYPrimaryTransformer
wihout changing anything in the class, and by using thius new class instead of
G4PrimaryTransformer in my EventManager the problem is removed.


Best Regards


Laurent Desorgher







### Run 0 start.
Start Run processing.
Primary Weight 1000

---> Begin of event: 0

--------- Ranecu engine status ---------
 Initial seed (index) = 0
 Current couple of seeds = 9876, 54321
----------------------------------------

********************************************************************************
*************************
* G4Track Information:   Particle = geantino,   Track ID = 1,   Parent ID = 0
********************************************************************************
*************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng
Volume     Process
    0     -9 cm      0 fm      0 fm    300 MeV     0 eV      0 fm      0 fm
   World    initStep
    1   -7.5 cm      0 fm      0 fm    300 MeV     0 eV    1.5 cm    1.5 cm
   World  Transportation
Track Weight 1
    2   -6.5 cm      0 fm      0 fm    300 MeV     0 eV      1 cm    2.5 cm
    Lead  Transportation
Track Weight 1
    3     -6 cm      0 fm      0 fm    300 MeV     0 eV      5 mm      3 cm   li
quidArgon  Transportation
Track Weight 1
    4     -5 cm      0 fm      0 fm    300 MeV     0 eV      1 cm      4 cm
    Lead  Transportation
Track Weight 1
    5   -4.5 cm      0 fm      0 fm    300 MeV     0 eV      5 mm    4.5 cm   li
quidArgon  Transportation
Track Weight 1
    6   -3.5 cm      0 fm      0 fm    300 MeV     0 eV      1 cm    5.5 cm
    Lead  Transportation
Track Weight 1
    7     -3 cm      0 fm      0 fm    300 MeV     0 eV      5 mm      6 cm   li
quidArgon  Transportation
Track Weight 1
    8     -2 cm      0 fm      0 fm    300 MeV     0 eV      1 cm      7 cm
    Lead  Transportation
Track Weight 1
    9   -1.5 cm      0 fm      0 fm    300 MeV     0 eV      5 mm    7.5 cm   li
quidArgon  Transportation
Track Weight 1
   10     -5 mm      0 fm      0 fm    300 MeV     0 eV      1 cm    8.5 cm
    Lead  Transportation
Track Weight 1
   11      0 fm      0 fm      0 fm    300 MeV     0 eV      5 mm      9 cm   li
quidArgon  Transportation
Track Weight 1
   12      1 cm      0 fm      0 fm    300 MeV     0 eV      1 cm     10 cm
    Lead  Transportation
Track Weight 1
   13    1.5 cm      0 fm      0 fm    300 MeV     0 eV      5 mm   10.5 cm   li
quidArgon  Transportation
Track Weight 1
   14    2.5 cm      0 fm      0 fm    300 MeV     0 eV      1 cm   11.5 cm
    Lead  Transportation
Track Weight 1
   15      3 cm      0 fm      0 fm    300 MeV     0 eV      5 mm     12 cm   li
quidArgon  Transportation
Track Weight 1
   16      4 cm      0 fm      0 fm    300 MeV     0 eV      1 cm     13 cm
    Lead  Transportation
Track Weight 1
   17    4.5 cm      0 fm      0 fm    300 MeV     0 eV      5 mm   13.5 cm   li
quidArgon  Transportation
Track Weight 1
   18    5.5 cm      0 fm      0 fm    300 MeV     0 eV      1 cm   14.5 cm
    Lead  Transportation
Track Weight 1
   19      6 cm      0 fm      0 fm    300 MeV     0 eV      5 mm     15 cm   li
quidArgon  Transportation
Track Weight 1
   20      7 cm      0 fm      0 fm    300 MeV     0 eV      1 cm     16 cm
    Lead  Transportation
Track Weight 1
   21    7.5 cm      0 fm      0 fm    300 MeV     0 eV      5 mm   16.5 cm   li
quidArgon  Transportation
Track Weight 1
   22      9 cm      0 fm      0 fm    300 MeV     0 eV    1.5 cm     18 cm   Ou
tOfWorld  Transportation
Track Weight 1.0000002
---> End of event: 0
   Absorber: total energy:       0 eV        total track length:       0 fm
        Gap: total energy:       0 eV        total track length:       0 fm
Run terminated.
Run Summary
  Number of events processed : 1
  User=0s Real=0s Sys=0s
Comment 1 asai 2006-11-27 09:19:59 CET
The weight for an event is supposed to be multiplier for the weights of tracks.
It means, in your stepping action, you have to multiply the event weight to
the track weight. It is just a matter of design and it is our design decision.
Comment 2 desorgher 2006-11-28 05:35:59 CET
Dear Makoto,

Contrary to what you seem to say in your last comment, the first track of an
event received in Geant4  the weight of the primary vertex.

Anyway,the problem that I did encounter was due to my Geant4 installation.
When installing Geant4.8.1  I did copy all the  include files in one directory.
Altough by running Configure.sh for the installation of  the patches 1 and 2  I
did choose  to copy the include files
  in one directory, it seems that  the  new include files were not correctly copied.
 By removing the include directory  ( and therefore by using  the include files
directly from the source  tree) the problem is solved.


In conclusion I do agree also that the problem is resolved.

Thank you for your help


Best regards


Laurent
Comment 3 Gabriele Cosmo 2006-11-28 10:28:59 CET
> When installing Geant4.8.1  I did copy all the  include files in one directory.
> Altough by running Configure.sh for the installation of  the patches 1 and 2
> I did choose  to copy the include files in one directory, it seems that  the
>  new include files were not correctly copied.

If you choose to install all headers in a single directory through Configure, you
should remember to execute all the installation steps:
 $ ./Configure -build
 $ ./Configure -install     <-- here the headers get installed !!
 $ ./Configure                 <-- to generate the configuration scripts to source afterwards