Re: using Gsdk in VMC

From: Ivana Hrivnacova <Ivana.Hrivnacova_at_cern.ch>
Date: Wed, 24 Oct 2007 11:09:34 +0200


Hi Mohammad,

In TGeant3::DefineParticle, there is called internally Gspart() function, which sets the Geant3 code to your new particle.
There is also defined a map between this code and the PDG, which is hold in the fPDGCode data member. To access from PDG to geant3 code, there is defined TVirtualMC::IdFromPDG(pdg), which should normally work also for particles added by user.
So there is no need to add the functions to TDatabasePDG which you propose.
Have you tried to use IdFromPDG?
If it fails, could you send me your code where you define your particle & decay, so that I can investigate?

Best regards,

Ivana

Al-Turany Dr. Mohammad wrote:
> Hallo,
>
> I have a small problem with the implementation of TGeant3::DefineParticle and the TDatabasePDG, I would like to add some HyperNuclei with user decay to the vmc. To do this in Geant3 one can use the Gsdk function, which needs the Geant code of the particle and not PDG. In the TGeant3::DefineParticle, user ions or particles are added to TDatabasePDG without Geant code:
>
> if (!TDatabasePDG::Instance()->GetParticle(pdg))
> TDatabasePDG::Instance()->AddParticle(name, name, mass, kTRUE, 0, charge*3,ParticleClass(type).Data(), pdg);
>
> which sets the Anti flag and the TrackingCode to the default values (-1, 0). So when I define my particles I have no access to the Geant code that I need for Gsdk, could this be change please to :
>
> if (!TDatabasePDG::Instance()->GetParticle(pdg))
> TDatabasePDG::Instance()->AddParticle(name, name, mass, kTRUE, 0, charge*3,ParticleClass(type).Data(), pdg, -1, fNG3Particles);
>
> The TParticlePDG has already these integers, so it is only this small change.
>
>
> The second point is the TDatabasePDG, the methods ConvertGeant3ToPdg and ConvertPdgToGeant3 use a switch case for the pdg and geant code, So as it is now I have no access to newly defined particles, what could be done easily is to return a ConvertUserGeant3ToPdg and/or ConvertUserPdgToGeant3 method in the switch default to return the user defined stuff from the TParticlePDG list. i.e:
>
> Int_t TDataBasePDG::ConvertUserPdgToGeant3{Int_t PDGcode)
> {
> if (fParticleList == 0) return 0;
> TParticlePDG *p;
> TObjLink *lnk = fParticleList->FirstLink();
> while (lnk) {
> p = (TParticlePDG*)lnk->GetObject();
> if (p->PdgCode() == PDGcode) return p->TrackingCode();
> lnk = lnk->Next();
> }
> return 0;
> }
>
> and
>
>
> Int_t TDataBasePDG::ConvertUserGeant3ToPdg{Int_t Trkcode)
> {
> if (fParticleList == 0) return 0;
> TParticlePDG *p;
> TObjLink *lnk = fParticleList->FirstLink();
> while (lnk) {
> p = (TParticlePDG*)lnk->GetObject();
> if (p->TrackingCode() == Trkcode) return p->PdgCode();
> lnk = lnk->Next();
> }
> return 0;
> }
>
>
> Thanks,
>
> Mohammad
>
>
>
>
> Dr. Mohammad Al-Turany
> IT-Department
> Gesellschaft für Schwerionenforschung mbH
> Planckstraße 1
> D-64291 Darmstadt
> www.gsi.de
>
> Gesellschaft mit beschränkter Haftung
> Sitz der Gesellschaft: Darmstadt
> Handelsregister: Amtsgericht Darmstadt, HRB 1528
>
> Geschäftsführer: Professor Dr. Horst Stöcker, Dr. Alexander Kurz
>
> Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph,
> Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt
>

-- 
==============================================================
e-mail:  Ivana.Hrivnacova_at_cern.ch
address: Institut Physique Nucleaire, 91406 Orsay, France
phone:   (33) 01 69 15 65 94
==============================================================
Received on Wed Oct 24 2007 - 11:07:22 CEST

This archive was generated by hypermail 2.2.0 : Wed Oct 24 2007 - 17:25:01 CEST