FW: using Gsdk in VMC

From: Al-Turany Dr. Mohammad <M.Al-Turany_at_gsi.de>
Date: Wed, 24 Oct 2007 10:35:56 +0200


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 Received on Wed Oct 24 2007 - 10:36:10 CEST

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