]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TGeant3/TGeant3.cxx
Coding convention correction and warning removal
[u/mrichter/AliRoot.git] / TGeant3 / TGeant3.cxx
index 412c9f96172082ce467267d77e7712ac1aabe235..502dd5c796abf7293103cf2aeb0d888a447ea57e 100644 (file)
 
 /*
 $Log$
+Revision 1.29  2000/07/11 18:24:59  fca
+Coding convention corrections + few minor bug fixes
+
+Revision 1.28  2000/06/29 10:51:55  morsch
+Add some charmed and bottom baryons to the particle list (TDatabasePDG). This
+is needed by Hijing. Should be part of a future review of TDatabasePDG.
+
+Revision 1.27  2000/06/21 17:40:15  fca
+Adding possibility to set ISTRA, PAI model
+
+Revision 1.26  2000/05/16 13:10:41  fca
+New method IsNewTrack and fix for a problem in Father-Daughter relations
+
+Revision 1.25  2000/04/07 11:12:35  fca
+G4 compatibility changes
+
+Revision 1.24  2000/02/28 21:03:57  fca
+Some additions to improve the compatibility with G4
+
+Revision 1.23  2000/02/23 16:25:25  fca
+AliVMC and AliGeant3 classes introduced
+ReadEuclid moved from AliRun to AliModule
+
+Revision 1.22  2000/01/18 15:40:13  morsch
+Interface to GEANT3 routines GFTMAT, GBRELM and GPRELM added
+Define geant particle type 51: Feedback Photon with Cherenkov photon properties.
+
 Revision 1.21  2000/01/17 19:41:17  fca
 Add SetERAN function
 
@@ -102,7 +129,7 @@ Introduction of the Copyright and cvs Log
 # define gsxyz   gsxyz_ 
 # define gtrack  gtrack_ 
 # define gtreve  gtreve_ 
-# define gtreve_root  gtreve_root_ 
+# define gtreveroot  gtreveroot_ 
 # define grndm   grndm_ 
 # define grndmq  grndmq_ 
 # define gdtom   gdtom_ 
@@ -199,7 +226,7 @@ Introduction of the Copyright and cvs Log
 # define gsxyz   GSXYZ 
 # define gtrack  GTRACK 
 # define gtreve  GTREVE 
-# define gtreve_root  GTREVE_ROOT
+# define gtreveroot  GTREVEROOT
 # define grndm   GRNDM
 # define grndmq  GRNDMQ
 # define gdtom   GDTOM 
@@ -327,7 +354,7 @@ extern "C"
 
   void type_of_call gtreve(); 
 
-  void type_of_call gtreve_root(); 
+  void type_of_call gtreveroot(); 
 
   void type_of_call grndm(Float_t *, const Int_t &); 
 
@@ -539,11 +566,11 @@ void TGeant3::DefaultRange()
   //
   // Set range of current drawing pad to 20x20 cm
   //
-  if (!higz) {
+  if (!gHigz) {
     new THIGZ(defSize); 
     gdinit();
   }
-  higz->Range(0,0,20,20);
+  gHigz->Range(0,0,20,20);
 }
 
 //____________________________________________________________________________ 
@@ -552,7 +579,7 @@ void TGeant3::InitHIGZ()
   //
   // Initialise HIGZ
   //
-  if (!higz) {
+  if (!gHigz) {
     new THIGZ(defSize); 
     gdinit();
   }
@@ -584,6 +611,7 @@ void TGeant3::LoadAddress()
   gcomad(PASSCHARD("GCNUM"), (int*&) fGcnum   PASSCHARL("GCNUM"));
   gcomad(PASSCHARD("GCSETS"),(int*&) fGcsets  PASSCHARL("GCSETS"));
   gcomad(PASSCHARD("GCPHYS"),(int*&) fGcphys  PASSCHARL("GCPHYS"));
+  gcomad(PASSCHARD("GCPHLT"),(int*&) fGcphlt  PASSCHARL("GCPHLT"));
   gcomad(PASSCHARD("GCOPTI"),(int*&) fGcopti  PASSCHARL("GCOPTI"));
   gcomad(PASSCHARD("GCTLIT"),(int*&) fGctlit  PASSCHARL("GCTLIT"));
   gcomad(PASSCHARD("GCVDMA"),(int*&) fGcvdma  PASSCHARL("GCVDMA"));
@@ -612,6 +640,13 @@ void TGeant3::GeomIter()
   fNextVol=fGcvolu->nlevel;
 }
 
+//____________________________________________________________________________ 
+void TGeant3::FinishGeometry()
+{
+  //Close the geometry structure
+  Ggclos();
+}
+  
 //____________________________________________________________________________ 
 Int_t TGeant3::NextVolUp(Text_t *name, Int_t &copy)
 {
@@ -632,6 +667,12 @@ Int_t TGeant3::NextVolUp(Text_t *name, Int_t &copy)
   return 0;
 }
 
+//_____________________________________________________________________________
+void TGeant3::BuildPhysics()
+{
+  Gphysi();
+}
+
 //_____________________________________________________________________________
 Int_t TGeant3::CurrentVolID(Int_t &copy) const
 {
@@ -827,8 +868,73 @@ void TGeant3::DefineParticles()
   const Double_t erggev = 1/1.6021773349e-3;
   const Double_t hshgev = hslash*erggev;
   const Double_t yearstosec = 3600*24*365.25;
+//
+// Bottom mesons
+// mass and life-time from PDG
+  pdgDB->AddParticle("B(s)*0","B(s)*0",
+                    5.4163, kTRUE, 0.047, +0.,"Meson",  533);
+
+  pdgDB->AddParticle("B(s)*0 bar","B(s)*0 bar",
+                    5.4163, kTRUE, 0.047, -0.,"Meson", -533);
+
+// Charmed baryons
+// 
+// value for mass used by Hijing
+  pdgDB->AddParticle("Sigma(c)*+","Sigma(c)*+",
+                    2.4536, kTRUE, -1., +1.,"Baryon",  4214);
+
+  pdgDB->AddParticle("Sigma(c)*-","Sigma(c)*-",
+                    2.4536, kTRUE, -1., -1.,"Baryon", -4214);
+// equivalent to 4312 ? Hijing uses m=2.55
+  pdgDB->AddParticle("Xsi(c)0","Xsi(c)0",
+                    2.4703, kTRUE, -1., +0.,"Baryon",  4132);
+
+  pdgDB->AddParticle("Xsi(c)0 bar","Xsi(c)0 bar",
+                    2.4703, kTRUE, -1., -0.,"Baryon", -4132);
+// equivalent to 4322 ? Hijing uses m=2.55
+  pdgDB->AddParticle("Xi(c)+","Xi(c)+",
+                    2.4656, kFALSE, -1., +1.,"Baryon",  4232);
+  
+  pdgDB->AddParticle("Xi(c)-","Xi(c)-",
+                    2.4656, kFALSE, -1., -1.,"Baryon", -4232);
+// mass values from Hijing
+
+  pdgDB->AddParticle("Xsi(c)*0","Xsi(c)*0",
+                    2.63, kTRUE, -1., +0.,"Baryon",  4314);
+
+  pdgDB->AddParticle("Xsi(c)*0 bar","Xsi(c)*0 bar",
+                    2.63, kTRUE, -1., -0.,"Baryon", -4314);
+
+  pdgDB->AddParticle("Xsi(c)*+","Xsi(c)*+",
+                    2.63, kTRUE, -1., +1.,"Baryon",  4324);
 
+  pdgDB->AddParticle("Xsi(c)*-","Xsi(c)*-",
+                    2.63, kTRUE, -1., -1.,"Baryon", -4324);
 
+// pdg mass value, Hijing uses m=2.73.
+  pdgDB->AddParticle("Omega(c)0","Omega(c)0",
+                    2.7040, kFALSE, hshgev/0.064e-12, +0.,"Baryon",  4332);
+  
+  pdgDB->AddParticle("Omega(c)0 bar","Omega(c)0 bar",
+                    2.7040, kFALSE, hshgev/0.064e-12, -0.,"Baryon", -4332);
+// mass value from Hijing
+  pdgDB->AddParticle("Omega(c)*0","Omega(c)*0",
+                    2.8000, kFALSE, -1., +0.,"Baryon",  4334);
+  
+  pdgDB->AddParticle("Omega(c)*0 bar","Omega(c)*0",
+                    2.8000, kFALSE, -1., -0.,"Baryon", -4334);
+
+// Bottom baryons
+//
+// mass value from Hijing
+  pdgDB->AddParticle("Sigma(b)*+","Sigma(b)*+",
+                    5.8100, kFALSE, -1., +1.,"Baryon", 5224);
+
+  pdgDB->AddParticle("Sigma(b)*-","Sigma(b)*-",
+                    5.8100, kFALSE, -1., -1.,"Baryon", -5224);
+//
+//
   pdgDB->AddParticle("Deuteron","Deuteron",2*autogev+8.071e-3,kTRUE,
                     0,1,"Ion",kion+10020);
   fPDGCode[fNPDGCodes++]=kion+10020;   // 45 = Deuteron
@@ -993,7 +1099,7 @@ void TGeant3::DefineParticles()
 }
 
 //_____________________________________________________________________________
-Int_t TGeant3::VolId(Text_t *name) const
+Int_t TGeant3::VolId(const Text_t *name) const
 {
   //
   // Return the unique numeric identifier for volume name
@@ -1021,17 +1127,80 @@ const char* TGeant3::VolName(Int_t id) const
   //
   // Return the volume name given the volume identifier
   //
-  const char name[5]="NULL";
   if(id<1 || id > fGcnum->nvolum || fGclink->jvolum<=0) 
-    return name;
+    return fVolNames[fGcnum->nvolum];
   else
     return fVolNames[id-1];
 }
 
 //_____________________________________________________________________________
-Float_t TGeant3::Xsec(char* reac, Float_t energy, Int_t part, Int_t mate)
+void    TGeant3::SetCut(const char* cutName, Float_t cutValue)
+{
+  if(!strcmp(cutName,"CUTGAM")) 
+    fGccuts->cutgam=cutValue; 
+  else if(!strcmp(cutName,"CUTGAM")) 
+    fGccuts->cutele=cutValue; 
+  else if(!strcmp(cutName,"CUTELE")) 
+    fGccuts->cutneu=cutValue; 
+  else if(!strcmp(cutName,"CUTHAD")) 
+    fGccuts->cuthad=cutValue; 
+  else if(!strcmp(cutName,"CUTMUO")) 
+    fGccuts->cutmuo=cutValue; 
+  else if(!strcmp(cutName,"BCUTE")) 
+    fGccuts->bcute=cutValue; 
+  else if(!strcmp(cutName,"BCUTM")) 
+    fGccuts->bcutm=cutValue; 
+  else if(!strcmp(cutName,"DCUTE")) 
+    fGccuts->dcute=cutValue; 
+  else if(!strcmp(cutName,"DCUTM")) 
+    fGccuts->dcutm=cutValue; 
+  else if(!strcmp(cutName,"PPCUTM")) 
+    fGccuts->ppcutm=cutValue; 
+  else if(!strcmp(cutName,"TOFMAX")) 
+    fGccuts->tofmax=cutValue; 
+  else Warning("SetCut","Cut %s not implemented\n",cutName);
+}
+
+//_____________________________________________________________________________
+void    TGeant3::SetProcess(const char* flagName, Int_t flagValue)
+{
+  if(!strcmp(flagName,"PAIR")) 
+    fGcphys->ipair=flagValue;
+  else if(!strcmp(flagName,"COMP")) 
+    fGcphys->icomp=flagValue;
+  else if(!strcmp(flagName,"PHOT")) 
+    fGcphys->iphot=flagValue;
+  else if(!strcmp(flagName,"PFIS")) 
+    fGcphys->ipfis=flagValue;
+  else if(!strcmp(flagName,"DRAY")) 
+    fGcphys->idray=flagValue;
+  else if(!strcmp(flagName,"ANNI")) 
+    fGcphys->ianni=flagValue;
+  else if(!strcmp(flagName,"BREM")) 
+    fGcphys->ibrem=flagValue;
+  else if(!strcmp(flagName,"HADR")) 
+    fGcphys->ihadr=flagValue;
+  else if(!strcmp(flagName,"MUNU")) 
+    fGcphys->imunu=flagValue;
+  else if(!strcmp(flagName,"DCAY")) 
+    fGcphys->idcay=flagValue;
+  else if(!strcmp(flagName,"LOSS")) 
+    fGcphys->iloss=flagValue;
+  else if(!strcmp(flagName,"MULS")) 
+    fGcphys->imuls=flagValue;
+  else if(!strcmp(flagName,"RAYL")) 
+    fGcphys->irayl=flagValue;
+  else if(!strcmp(flagName,"STRA")) 
+    fGcphlt->istra=flagValue;
+  else if(!strcmp(flagName,"SYNC")) 
+    fGcphlt->isync=flagValue;
+  else  Warning("SetFlag","Flag %s not implemented\n",flagName);
+}
+
+//_____________________________________________________________________________
+Float_t TGeant3::Xsec(char* reac, Float_t /* energy */, 
+                     Int_t part, Int_t /* mate */)
 {
-  Int_t gpart = IdFromPDG(part);
   if(!strcmp(reac,"PHOT"))
   {
     if(part!=22) {
@@ -1122,6 +1291,15 @@ Float_t TGeant3::TrackLength() const
   return fGctrak->sleng;
 }
 
+//_____________________________________________________________________________
+Bool_t TGeant3::IsNewTrack() const
+{
+  //
+  // True if the track is not at the boundary of the current volume
+  //
+  return (fGctrak->sleng>0);
+}
+
 //_____________________________________________________________________________
 Bool_t TGeant3::IsTrackInside() const
 {
@@ -1295,40 +1473,6 @@ Float_t TGeant3::MaxStep() const
   return fGctmed->stemax;
 }
 
-//_____________________________________________________________________________
-void TGeant3::SetColors()
-{
-  //
-  // Set the colors for all the volumes
-  // this is done sequentially for all volumes
-  // based on the number of their medium
-  //
-  Int_t kv, icol;
-  Int_t jvolum=fGclink->jvolum;
-  //Int_t jtmed=fGclink->jtmed;
-  //Int_t jmate=fGclink->jmate;
-  Int_t nvolum=fGcnum->nvolum;
-  char name[5];
-  //
-  //    Now for all the volumes
-  for(kv=1;kv<=nvolum;kv++) {
-    //     Get the tracking medium
-    Int_t itm=Int_t (fZq[fZlq[jvolum-kv]+4]);
-    //     Get the material
-    //Int_t ima=Int_t (fZq[fZlq[jtmed-itm]+6]);
-    //     Get z
-    //Float_t z=fZq[fZlq[jmate-ima]+7];
-    //     Find color number
-    //icol = Int_t(z)%6+2;
-    //icol = 17+Int_t(z*150./92.);
-    //icol = kv%6+2;
-    icol = itm%6+2;
-    strncpy(name,(char*)&fZiq[jvolum+kv],4);
-    name[4]='\0';
-    Gsatt(name,"COLO",icol);
-  }
-}
-
 //_____________________________________________________________________________
 void TGeant3::SetMaxStep(Float_t maxstep)
 {
@@ -1577,9 +1721,9 @@ void  TGeant3::Gpcxyz()
   //
   //    Print track and volume parameters at current point
   //
-  gpcxyz(); 
+    
+    gpcxyz(); 
 } 
 //_____________________________________________________________________________
 void  TGeant3::Ggclos() 
 { 
@@ -1604,12 +1748,13 @@ void  TGeant3::Ggclos()
   //
   ggclos(); 
   // Create internal list of volumes
-  fVolNames = new char[fGcnum->nvolum][5];
+  fVolNames = new char[fGcnum->nvolum+1][5];
   Int_t i;
   for(i=0; i<fGcnum->nvolum; ++i) {
     strncpy(fVolNames[i], (char *) &fZiq[fGclink->jvolum+i+1], 4);
     fVolNames[i][4]='\0';
   }
+  strcpy(fVolNames[fGcnum->nvolum],"NULL");
 } 
  
 //_____________________________________________________________________________
@@ -2130,12 +2275,12 @@ void  TGeant3::Gtreve()
 } 
 
 //_____________________________________________________________________________
-void  TGeant3::Gtreve_root() 
+void  TGeant3::GtreveRoot() 
 { 
   //
   //   Controls tracking of all particles belonging to the current event
   //
-  gtreve_root(); 
+  gtreveroot(); 
 } 
 
 //_____________________________________________________________________________
@@ -2688,7 +2833,7 @@ void TGeant3::Gdopen(Int_t iview)
   //  with solid colours can now be stored in a view bank or in 'PICTURE FILES'
   //
   InitHIGZ();
-  higz->Clear();
+  gHigz->Clear();
   gdopen(iview);
 }
  
@@ -2793,7 +2938,7 @@ void TGeant3::Gdraw(const char *name,Float_t theta, Float_t phi, Float_t psi,
   //  string for the NAME of the volume can be found using the command DTREE).
   //
   InitHIGZ();
-  higz->Clear();
+  gHigz->Clear();
   char vname[5];
   Vname(name,vname);
   if (fGcvdma->raytra != 1) {
@@ -2824,7 +2969,7 @@ void TGeant3::Gdrawc(const char *name,Int_t axis, Float_t cut,Float_t u0,
   //  the CVOL/BOX function.
   //  
   InitHIGZ();
-  higz->Clear();
+  gHigz->Clear();
   char vname[5];
   Vname(name,vname);
   gdrawc(PASSCHARD(vname), axis,cut,u0,v0,ul,vl PASSCHARL(vname)); 
@@ -2853,7 +2998,7 @@ void TGeant3::Gdrawx(const char *name,Float_t cutthe, Float_t cutphi,
   //  The resulting picture is seen from the viewing angles theta,phi.
   //
   InitHIGZ();
-  higz->Clear();
+  gHigz->Clear();
   char vname[5];
   Vname(name,vname);
   gdrawx(PASSCHARD(vname), cutthe,cutphi,cutval,theta,phi,u0,v0,ul,vl
@@ -2924,7 +3069,7 @@ void TGeant3::Gdspec(const char *name)
   //  volume.
   //  
   InitHIGZ();
-  higz->Clear();
+  gHigz->Clear();
   char vname[5];
   Vname(name,vname);
   gdspec(PASSCHARD(vname) PASSCHARL(vname)); 
@@ -2937,11 +3082,11 @@ void TGeant3::DrawOneSpec(const char *name)
   //  Function called when one double-clicks on a volume name
   //  in a TPavelabel drawn by Gdtree.
   //
-  THIGZ *higzSave = higz;
+  THIGZ *higzSave = gHigz;
   higzSave->SetName("higzSave");
   THIGZ *higzSpec = (THIGZ*)gROOT->FindObject("higzSpec");
-  //printf("DrawOneSpec, higz=%x, higzSpec=%x\n",higz,higzSpec);
-  if (higzSpec) higz     = higzSpec;
+  //printf("DrawOneSpec, gHigz=%x, higzSpec=%x\n",gHigz,higzSpec);
+  if (higzSpec) gHigz     = higzSpec;
   else          higzSpec = new THIGZ(defSize);
   higzSpec->SetName("higzSpec");
   higzSpec->cd();
@@ -2952,7 +3097,7 @@ void TGeant3::DrawOneSpec(const char *name)
   higzSpec->Update();
   higzSave->cd();
   higzSave->SetName("higz");
-  higz = higzSave;
+  gHigz = higzSave;
 } 
 
 //_____________________________________________________________________________
@@ -2972,11 +3117,11 @@ void TGeant3::Gdtree(const char *name,Int_t levmax, Int_t isel)
   //    - drawing tree of parent
   //  
   InitHIGZ();
-  higz->Clear();
+  gHigz->Clear();
   char vname[5];
   Vname(name,vname);
   gdtree(PASSCHARD(vname), levmax, isel PASSCHARL(vname)); 
-  higz->fPname = "";
+  gHigz->fPname = "";
 } 
 
 //_____________________________________________________________________________
@@ -2990,7 +3135,7 @@ void TGeant3::GdtreeParent(const char *name,Int_t levmax, Int_t isel)
   //  This function draws the logical tree of the parent of name.
   //  
   InitHIGZ();
-  higz->Clear();
+  gHigz->Clear();
   // Scan list of volumes in JVOLUM
   char vname[5];
   Int_t gname, i, jvo, in, nin, jin, num;
@@ -3006,7 +3151,7 @@ void TGeant3::GdtreeParent(const char *name,Int_t levmax, Int_t isel)
        strncpy(vname,(char*)&fZiq[fGclink->jvolum+i],4);
        vname[4] = 0;           
        gdtree(PASSCHARD(vname), levmax, isel PASSCHARL(vname)); 
-       higz->fPname = "";
+       gHigz->fPname = "";
        return;
       }
     }
@@ -3381,6 +3526,18 @@ void TGeant3::SetRAYL(Int_t par)
   fGcphys->irayl = par;
 }
  
+//_____________________________________________________________________________
+void TGeant3::SetSTRA(Int_t par)
+{
+  //
+  //  To control energy loss fluctuations
+  //  with the PhotoAbsorption Ionisation model.
+  //   par =0 no Straggling.
+  //       =1 Straggling yes => no Delta rays.
+  //  
+  fGcphlt->istra = par;
+}
 //_____________________________________________________________________________
 void TGeant3::SetSWIT(Int_t sw, Int_t val)
 {