#include <AliMC.h> //StepManager()
#include <AliRun.h> //CreateMaterials()
#include <AliMagF.h> //CreateMaterials()
+#include "AliGeomManager.h" //AddAlignableVolumes()
+#include <AliCDBEntry.h> //CreateMaterials()
+#include <AliCDBManager.h> //CreateMaterials()
#include <TF1.h> //DefineOpticalProperties()
#include <TF2.h> //DefineOpticalProperties()
-#include <TLorentzVector.h> //IsLostByFresnel()
-#include <AliCDBManager.h> //CreateMaterials()
-#include <AliCDBEntry.h> //CreateMaterials()
+#include <TGeoGlobalMagField.h>
#include <TGeoPhysicalNode.h> //AddAlignableVolumes()
-#include "AliGeomManager.h" //AddAlignableVolumes()
+#include <TLorentzVector.h> //IsLostByFresnel()
ClassImp(AliHMPIDv2)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Int_t matId=0; //tmp material id number
Int_t unsens = 0, sens=1; //sensitive or unsensitive medium
- Int_t itgfld = gAlice->Field()->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z
- Float_t maxfld = gAlice->Field()->Max(); //max field value
+ Int_t itgfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z
+ Float_t maxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); //max field value
Float_t tmaxfd = -10.0; //max deflection angle due to magnetic field in one step
Float_t deemax = - 0.2; //max fractional energy loss in one step
Float_t stemax = - 0.1; //max step allowed [cm]
gMC->GetRandom()->RndmArray(2,ranf); //Sample direction
cthf=ranf[0]*2-1.0;
if(cthf<0) continue;
- sthf = TMath::Sqrt((1 - cthf) * (1 + cthf));
+ sthf = TMath::Sqrt((1. - cthf) * (1. + cthf));
phif = ranf[1] * 2 * TMath::Pi();
if(Double_t randomNumber=gMC->GetRandom()->Rndm()<=0.57)
//FORMULAE FROM HANDBOOK OF OPTICS, 33.23 OR
//W.R. HUNTER, J.O.S.A. 54 (1964),15 , J.O.S.A. 55(1965),1197
- Float_t sinin=TMath::Sqrt(1-pdoti*pdoti);
+ Float_t sinin=TMath::Sqrt((1.-pdoti)*(1.+pdoti));
Float_t tanin=sinin/pdoti;
Float_t c1=cn*cn-ck*ck-sinin*sinin;