+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
#include "AliCallf77.h"
#include "TGeant3.h"
#include "AliRun.h"
extern "C" type_of_call void gtreve_root();
extern "C" type_of_call void glast();
-
extern "C" type_of_call {
//______________________________________________________________________
//
// ------------------------------------------------------------------
//
- TGeant3 *geant3=(TGeant3*)AliMC::GetMC();
+ TGeant3* geant3 = (TGeant3*) gMC;
Int_t ihadr=geant3->Gcphys()->ihadr;
if (ihadr<4) gheish();
else if (ihadr==4) flufin();
//
// ------------------------------------------------------------------
//
-
- Int_t ndet = gAlice->Modules()->GetLast();
- TObjArray &dets = *gAlice->Modules();
- AliModule *module;
- Int_t i;
- for(i=0; i<=ndet; i++)
- if((module = (AliModule*)dets[i]))
- module->FinishEvent();
}
//______________________________________________________________________
//
// ------------------------------------------------------------------
//
- TGeant3 *geant3=(TGeant3*)AliMC::GetMC();
+ TGeant3* geant3 = (TGeant3*) gMC;
Int_t ihadr=geant3->Gcphys()->ihadr;
if (ihadr<4) gpghei();
else if (ihadr==4) fldist();
//
// ------------------------------------------------------------------
//
- TGeant3 *geant3=(TGeant3*)AliMC::GetMC();
+ TGeant3* geant3 = (TGeant3*) gMC;
Int_t ifield=geant3->Gctmed()->ifield;
Float_t fieldm=geant3->Gctmed()->fieldm;
// ******************************************************************
//
- AliMC* pMC = AliMC::GetMC();
- TGeant3 *geant3=(TGeant3*)pMC;
- Float_t x[3];
+ TLorentzVector x;
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
+ TGeant3* geant3 = (TGeant3*) gMC;
if(geant3->Gcflag()->idebug) geant3->Gdebug();
// Stop particle if outside user defined tracking region
- pMC->TrackPosition(x);
+ gMC->TrackPosition(x);
r=TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
if (r > gAlice->TrackingRmax() || TMath::Abs(x[2]) > gAlice->TrackingZmax()) {
- pMC->StopTrack();
+ gMC->StopTrack();
}
// --- Add new created particles
- if (pMC->NSecondaries() > 0) {
- pMC->ProdProcess(chproc);
+ if (gMC->NSecondaries() > 0) {
+ gMC->ProdProcess(chproc);
for (jk = 0; jk < geant3->Gcking()->ngkine; ++jk) {
ipp = Int_t (geant3->Gcking()->gkin[jk][4]+0.5);
// --- Skip neutrinos!
if (ipp != 4) {
- gAlice->SetTrack(1,gAlice->CurrentTrack(),ipp, geant3->Gcking()->gkin[jk],
+ gAlice->SetTrack(1,gAlice->CurrentTrack(),gMC->PDGFromId(ipp), geant3->Gcking()->gkin[jk],
geant3->Gckin3()->gpos[jk], polar,geant3->Gctrak()->tofg, chproc, nt);
}
}
}
-
+ // 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 (!pMC->TrackOut())
+ if (!gMC->IsTrackOut())
if ((id=gAlice->DetFromMate(geant3->Gctmed()->numed)) >= 0) gAlice->StepManager(id);
}