]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Modifications to allow Cherenkov transport
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Jul 1999 14:45:36 +0000 (14:45 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Jul 1999 14:45:36 +0000 (14:45 +0000)
GEANT321/gtrak/gtreve_root.F
RICH/AliRICH.cxx
STEER/AliRun.cxx
TGeant3/gucode.cxx

index 75c54845bef84ce06385394ff9aa4add27a98049..a41f93a1f05423523d16cc6e6d8f39d566d14727 100644 (file)
@@ -2,6 +2,10 @@
 * $Id$
 *
 * $Log$
 * $Id$
 *
 * $Log$
+* Revision 1.1  1999/06/03 16:38:16  fca
+* First version of gtreve_root, special version of gtreve for AliRoot to be
+* called from gutrev.
+*
 * Revision 1.1.1.1  1999/05/18 15:55:21  fca
 * AliRoot sources
 *
 * Revision 1.1.1.1  1999/05/18 15:55:21  fca
 * AliRoot sources
 *
@@ -29,6 +33,7 @@ C.
 #include "geant321/gcbank.inc"
 #include "geant321/gcflag.inc"
 #include "geant321/gckine.inc"
 #include "geant321/gcbank.inc"
 #include "geant321/gcflag.inc"
 #include "geant321/gckine.inc"
+#include "geant321/gcking.inc"
 #include "geant321/gcnum.inc"
 #include "geant321/gcstak.inc"
 #include "geant321/gctmed.inc"
 #include "geant321/gcnum.inc"
 #include "geant321/gcstak.inc"
 #include "geant321/gctmed.inc"
@@ -38,7 +43,7 @@ C.
       REAL UBUF(2)
       EQUIVALENCE (UBUF(1),WS(1))
       LOGICAL   BTEST
       REAL UBUF(2)
       EQUIVALENCE (UBUF(1),WS(1))
       LOGICAL   BTEST
-      DIMENSION PMOM(3),VPOS(3)
+      DIMENSION PMOM(3),VPOS(3),VPOLA(3)
 C.
 C.    ------------------------------------------------------------------
       NTMSTO = 0
 C.
 C.    ------------------------------------------------------------------
       NTMSTO = 0
@@ -57,7 +62,7 @@ C.    ------------------------------------------------------------------
 *
       MTRACK=-999
  10   MTROLD=MTRACK
 *
       MTRACK=-999
  10   MTROLD=MTRACK
-      CALL RXGTRAK(MTRACK,IPART,PMOM,E,VPOS,TTOF)
+      CALL RXGTRAK(MTRACK,IPART,PMOM,E,VPOS,VPOLA,TTOF)
       IF(MTROLD.LT.0) THEN
          MPRIMA=MTRACK
       ENDIF
       IF(MTROLD.LT.0) THEN
          MPRIMA=MTRACK
       ENDIF
@@ -74,22 +79,40 @@ C --- Output root hits tree only for each primary MTRACK
          ENDIF
       ENDIF
       IF(MTRACK.LE.0) GOTO 999
          ENDIF
       ENDIF
       IF(MTRACK.LE.0) GOTO 999
+      ITRTYP = NINT(Q(LQ(JPART-IPART)+6))
+      IF(ITRTYP.EQ.7) THEN
+* This is a cherenkov photon, more complicated...
+         NGPHOT=1
+         XPHOT(7,1) = SQRT(VPOLA(1)**2+VPOLA(2)**2+VPOLA(3)**2)
+         DO KK=1,3
+            XPHOT(KK  ,1) = VPOS(KK)
+            XPHOT(KK+3,1) = PMOM(KK)/XPHOT(7,1)
+            XPHOT(KK+7,1) = VPOLA(KK)
+         ENDDO
+         XPHOT(11,1) = TTOF
+         CALL GSKPHO(1)
+* Just make sure that the track, whatever that is, is NOT transported
+         IQ(LQ(JKINE-1)) = IBSET(IQ(LQ(JKINE-1)),0)
+      ELSE
 * Set the vertex
 * Set the vertex
-      JV=LQ(JVERTX-1)
-      Q(JV + 1) = VPOS(1)
-      Q(JV + 2) = VPOS(2)
-      Q(JV + 3) = VPOS(3)
-      Q(JV + 4) = TTOF
-      Q(JV + 5) = 0
-      Q(JV + 6) = 0
+         JV=LQ(JVERTX-1)
+         Q(JV + 1) = VPOS(1)
+         Q(JV + 2) = VPOS(2)
+         Q(JV + 3) = VPOS(3)
+         Q(JV + 4) = TTOF
+         Q(JV + 5) = 0
+         Q(JV + 6) = 0
 * Set the track
 * Set the track
-      JK=LQ(JKINE-1)
-      Q(JK + 1) = PMOM(1)
-      Q(JK + 2) = PMOM(2)
-      Q(JK + 3) = PMOM(3)
-      Q(JK + 4) = E
-      Q(JK + 5) = IPART
-      Q(JK + 6) = 1
+         JK=LQ(JKINE-1)
+         Q(JK + 1) = PMOM(1)
+         Q(JK + 2) = PMOM(2)
+         Q(JK + 3) = PMOM(3)
+         Q(JK + 4) = E
+         Q(JK + 5) = IPART
+         Q(JK + 6) = 1
+* Make sure the track IS transported
+         IQ(LQ(JKINE-1)) = IBCLR(IQ(LQ(JKINE-1)),0)
+      ENDIF
 * Now transport
 C      CALL GPVERT(0)
 C      CALL GPKINE(0)
 * Now transport
 C      CALL GPVERT(0)
 C      CALL GPKINE(0)
index a3ae16ba4c6a372833656fd6bf8fa360b7c817eb..0e632026e000c76002fbfb69b7adaade5b90fd0b 100644 (file)
@@ -324,7 +324,6 @@ void AliRICH::StepManager()
   TGeant3 *geant3 = (TGeant3*) gMC;
 
   const Float_t xshift[3] = { 41.3, 0, -41.3 };
   TGeant3 *geant3 = (TGeant3*) gMC;
 
   const Float_t xshift[3] = { 41.3, 0, -41.3 };
-  static Float_t momentum[3];
   const Int_t nrooth = 25;
   
   static Int_t ixold=-1, iyold=-1;
   const Int_t nrooth = 25;
   
   static Int_t ixold=-1, iyold=-1;
@@ -343,7 +342,6 @@ void AliRICH::StepManager()
   //Int_t iprimx;
   Int_t ix, iy;
   Float_t stwght;
   //Int_t iprimx;
   Int_t ix, iy;
   Float_t stwght;
-  Int_t ncher;
   Float_t cophi;
   Float_t dir[3];
   Int_t ihitrak;
   Float_t cophi;
   Float_t dir[3];
   Int_t ihitrak;
@@ -611,27 +609,14 @@ void AliRICH::StepManager()
        sYphit[sNphoton - 1] = 0.;
        stwght = geant3->Gctrak()->upwght;
        geant3->Gctrak()->upwght = (Float_t) sNphoton;
        sYphit[sNphoton - 1] = 0.;
        stwght = geant3->Gctrak()->upwght;
        geant3->Gctrak()->upwght = (Float_t) sNphoton;
-       geant3->Gskpho(i);
-       momentum[0]=geant3->Gckin2()->xphot[i-1][3]*
-         geant3->Gckin2()->xphot[i-1][6];
-       momentum[1]=geant3->Gckin2()->xphot[i-1][4]*
-         geant3->Gckin2()->xphot[i-1][6];
-       momentum[2]=geant3->Gckin2()->xphot[i-1][5]*
-         geant3->Gckin2()->xphot[i-1][6];
-       gAlice->SetTrack(0, gAlice->CurrentTrack(),
-                        gMC->PDGFromId(50), 
-                        momentum, //momentum
-                        geant3->Gckin2()->xphot[i-1],     //position
-                        &geant3->Gckin2()->xphot[i-1][7], //polarisation
-                        geant3->Gckin2()->xphot[i-1][10], //time of flight
-                        "Cherenkov", ncher);
-       sMckov[sNphoton - 1] = ncher;
+       //      geant3->Gskpho(i);
+       sMckov[sNphoton - 1] = gAlice->CurrentTrack()+i;
        geant3->Gctrak()->upwght = stwght;
       }
     } else {
       stwght = geant3->Gctrak()->upwght;
       geant3->Gctrak()->upwght = 0.;
        geant3->Gctrak()->upwght = stwght;
       }
     } else {
       stwght = geant3->Gctrak()->upwght;
       geant3->Gctrak()->upwght = 0.;
-      geant3->Gskpho(0);
+      //      geant3->Gskpho(0);
       geant3->Gctrak()->upwght = stwght;
     }
     
       geant3->Gctrak()->upwght = stwght;
     }
     
@@ -1213,7 +1198,7 @@ void AliRICH::FeedBack(Float_t *source, Float_t qtot)
     } else {
       geant3->Gctrak()->upwght = 5200.;
     }
     } else {
       geant3->Gctrak()->upwght = 5200.;
     }
-    geant3->Gskpho(geant3->Gckin2()->ngphot);
+    //    geant3->Gskpho(geant3->Gckin2()->ngphot);
     geant3->Gctrak()->upwght = supwght;
     
   }
     geant3->Gctrak()->upwght = supwght;
     
   }
index 194e10f12ae03853b2701c42cecd31484fe4fd1a..ce0730aeaafbb78ff92cf3c35a6fdcbce1a3a433 100644 (file)
@@ -1666,7 +1666,8 @@ void AliRun::Streamer(TBuffer &R__b)
 //_____________________________________________________________________________
 
 extern "C" void type_of_call  rxgtrak (Int_t &mtrack, Int_t &ipart, Float_t *pmom, 
 //_____________________________________________________________________________
 
 extern "C" void type_of_call  rxgtrak (Int_t &mtrack, Int_t &ipart, Float_t *pmom, 
-                                      Float_t &e, Float_t *vpos, Float_t &tof)
+                                      Float_t &e, Float_t *vpos, Float_t *polar,
+                                      Float_t &tof)
 {
   //
   //     Fetches next track from the ROOT stack for transport. Called by the
 {
   //
   //     Fetches next track from the ROOT stack for transport. Called by the
@@ -1681,7 +1682,6 @@ extern "C" void type_of_call  rxgtrak (Int_t &mtrack, Int_t &ipart, Float_t *pmo
   //      vpos[3] Particle position
   //      tof     Particle time of flight in seconds
   //
   //      vpos[3] Particle position
   //      tof     Particle time of flight in seconds
   //
-  Float_t polar[3];
   Int_t pdg;
   gAlice->GetNextTrack(mtrack, pdg, pmom, e, vpos, polar, tof);
   ipart = gMC->IdFromPDG(pdg);
   Int_t pdg;
   gAlice->GetNextTrack(mtrack, pdg, pmom, e, vpos, polar, tof);
   ipart = gMC->IdFromPDG(pdg);
index 2bdaf905b36d04c7cefe162e6d4943ffadc8bf8b..b1141ba9793526e5ed5eb05cf57e7fc3846d5fd0 100644 (file)
@@ -467,6 +467,7 @@ void gustep()
   Float_t r;
   Int_t ipp, jk, id, nt;
   Float_t polar[3]={0,0,0};
   Float_t r;
   Int_t ipp, jk, id, nt;
   Float_t polar[3]={0,0,0};
+  Float_t mom[3];
   char chproc[11];
   
   // --- Standard GEANT debug routine 
   char chproc[11];
   
   // --- Standard GEANT debug routine 
@@ -491,7 +492,20 @@ void gustep()
       }
     }
   }
       }
     }
   }
-
+  // Cherenkov photons here
+  if ( geant3->Gckin2()->ngphot ) {
+    for (jk = 0; jk < geant3->Gckin2()->ngphot; ++jk) {
+      mom[0]=geant3->Gckin2()->xphot[jk][3]*geant3->Gckin2()->xphot[jk][6];
+      mom[1]=geant3->Gckin2()->xphot[jk][4]*geant3->Gckin2()->xphot[jk][6];
+      mom[2]=geant3->Gckin2()->xphot[jk][5]*geant3->Gckin2()->xphot[jk][6];
+      gAlice->SetTrack(1, gAlice->CurrentTrack(), gMC->PDGFromId(50),
+                      mom,                             //momentum
+                      geant3->Gckin2()->xphot[jk],     //position
+                      &geant3->Gckin2()->xphot[jk][7], //polarisation
+                      geant3->Gckin2()->xphot[jk][10], //time of flight
+                      "Cherenkov", nt);
+      }
+  }
   // --- Particle leaving the setup ?
   if (!gMC->IsTrackOut()) 
     if ((id=gAlice->DetFromMate(geant3->Gctmed()->numed)) >= 0) gAlice->StepManager(id);
   // --- Particle leaving the setup ?
   if (!gMC->IsTrackOut()) 
     if ((id=gAlice->DetFromMate(geant3->Gctmed()->numed)) >= 0) gAlice->StepManager(id);