#include <AliMC.h> //StepManager()
#include <AliRun.h> //CreateMaterials()
#include <AliMagF.h> //CreateMaterials()
-#include <TGeoManager.h> //CreateGeometry()
+//#include <TGeoManager.h> //CreateGeometry()
+#include <AliCDBEntry.h> //CreateMaterials()
+#include <AliCDBManager.h> //CreateMaterials()
#include <TF1.h> //DefineOpticalProperties()
#include <TF2.h> //DefineOpticalProperties()
+#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h> //IsLostByFresnel()
-#include <AliCDBManager.h> //CreateMaterials()
-#include <AliCDBEntry.h> //CreateMaterials()
+#include <TTree.h>
ClassImp(AliHMPIDv1)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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; //mas 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;
AliHMPIDRawStream stream(pRR);
while(stream.Next())
{
- UInt_t ddl=stream.GetDDLNumber(); //returns 0,1,2 ... 13
- for(Int_t row = 1; row <=AliHMPIDRawStream::kNRows; row++){
- for(Int_t dil = 1; dil <= AliHMPIDRawStream::kNDILOGICAdd; dil++){
- for(Int_t pad = 0; pad < AliHMPIDRawStream::kNPadAdd; pad++){
- if(stream.GetCharge(ddl,row,dil,pad)<1) continue;
- AliHMPIDDigit sdi(stream.GetPad(ddl,row,dil,pad),stream.GetCharge(ddl,row,dil,pad));
- new((*pSdiLst)[iSdiCnt++]) AliHMPIDDigit(sdi); //add this digit to the tmp list
- }//pad
- }//dil
- }//row
+ for(Int_t iPad=0;iPad<stream.GetNPads();iPad++) {
+ AliHMPIDDigit sdi(stream.GetPadArray()[iPad],stream.GetChargeArray()[iPad]);
+ new((*pSdiLst)[iSdiCnt++]) AliHMPIDDigit(sdi); //add this digit to the tmp list
+ }
}
GetLoader()->TreeS()->Fill(); GetLoader()->WriteSDigits("OVERWRITE");//write out sdigits
}
TString flag="fanny combination";
- if(gMC->IsTrackAlive())
- if(gMC->IsTrackEntering()) flag="enters to";
- else if(gMC->IsTrackExiting()) flag="exits from";
- else if(gMC->IsTrackInside()) flag="inside";
- else
- if(gMC->IsTrackStop()) flag="stoped in";
+ if(gMC->IsTrackAlive()) {
+ if(gMC->IsTrackEntering()) flag="enters to";
+ else if(gMC->IsTrackExiting()) flag="exits from";
+ else if(gMC->IsTrackInside()) flag="inside";
+ } else {
+ if(gMC->IsTrackStop()) flag="stopped in";
+ }
Int_t vid=0,copy=0;
TString path=gMC->CurrentVolName(); path.Prepend("-");path.Prepend(gMC->CurrentVolOffName(1));//current volume and his mother are always there
Int_t pid= gMC->TrackPid(); //take PID
Float_t etot= gMC->Etot(); //total hpoton energy, [GeV]
Double_t x[3]; gMC->TrackPosition(x[0],x[1],x[2]); //take MARS position at entrance to PC
+ Float_t hitTime=(Float_t)gMC->TrackTime(); //hit formation time
Float_t xl,yl; AliHMPIDParam::Instance()->Mars2Lors(copy,x,xl,yl); //take LORS position
- new((*fHits)[fNhits++])AliHMPIDHit(copy,etot,pid,tid,xl,yl,x); //HIT for photon, position at P, etot will be set to Q
+ new((*fHits)[fNhits++])AliHMPIDHit(copy,etot,pid,tid,xl,yl,hitTime,x); //HIT for photon, position at P, etot will be set to Q
GenFee(etot); //generate feedback photons etot is modified in hit ctor to Q of hit
}//photon hit PC and DE >0
}//photon hit PC
Int_t tid= gMC->GetStack()->GetCurrentTrackNumber(); //take TID
Int_t pid= gMC->TrackPid(); //take PID
Double_t out[3]; gMC->TrackPosition(out[0],out[1],out[2]); //take MARS position at exit
+ Float_t hitTime= (Float_t)gMC->TrackTime(); //hit formation time
out[0]=0.5*(out[0]+in[0]); //>
out[1]=0.5*(out[1]+in[1]); //take hit position at the anod plane
out[2]=0.5*(out[2]+in[2]); //>
Float_t xl,yl;AliHMPIDParam::Instance()->Mars2Lors(copy,out,xl,yl); //take LORS position
- new((*fHits)[fNhits++])AliHMPIDHit(copy,eloss,pid,tid,xl,yl,out); //HIT for MIP, position near anod plane, eloss will be set to Q
+ new((*fHits)[fNhits++])AliHMPIDHit(copy,eloss,pid,tid,xl,yl,hitTime,out); //HIT for MIP, position near anod plane, eloss will be set to Q
GenFee(eloss); //generate feedback photons
}else //just going inside
eloss += gMC->Edep(); //collect this step eloss