//
Float_t hits[3];
- Int_t copy,vol[1];
+ Int_t i,copy,vol[1];
TClonesArray &lhits = *fHits;
+ TLorentzVector p;
- gMC->CurrentVol(0, copy);
+ gMC->CurrentVolID(copy);
vol[0] = copy;
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(p);
+ for(i=0;i<3;++i) hits[i]=p[i];
new(lhits[fNhits++]) AliFMDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
Int_t copy, id;
Float_t hits[7];
Int_t vol[3];
- Float_t position[3];
- Float_t momentum[4];
+ TLorentzVector position;
+ TLorentzVector momentum;
TClonesArray &lhits = *fHits;
//
if(gMC->TrackCharge() && gMC->Edep()) {
//
// Only entering charged tracks
- if((id=gMC->CurrentVol(0,copy))==fIdSens1) {
+ if((id=gMC->CurrentVolID(copy))==fIdSens1) {
vol[0]=1;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy);
+ id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
} else if(id==fIdSens2) {
vol[0]=2;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy);
+ id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
} else if(id==fIdSens3) {
vol[0]=3;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else if(id==fIdSens4) {
vol[0]=4;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else if(id==fIdSens5) {
vol[0]=5;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else if(id==fIdSens6) {
vol[0]=6;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else return;
gMC->TrackPosition(position);
hits[0]=position[0];
hits[1]=position[1];
hits[2]=position[2];
- hits[3]=momentum[0]*momentum[3];
- hits[4]=momentum[1]*momentum[3];
- hits[5]=momentum[2]*momentum[3];
+ hits[3]=momentum[0];
+ hits[4]=momentum[1];
+ hits[5]=momentum[2];
hits[6]=gMC->Edep();
new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
Int_t copy, id;
Float_t hits[7];
Int_t vol[3];
- Float_t position[3];
- Float_t momentum[4];
+ TLorentzVector position, momentum;
TClonesArray &lhits = *fHits;
//
if(gMC->TrackCharge() && gMC->Edep()) {
//
// Only entering charged tracks
- if((id=gMC->CurrentVol(0,copy))==fIdSens1) {
+ if((id=gMC->CurrentVolID(copy))==fIdSens1) {
vol[0]=1;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy);
+ id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
} else if(id==fIdSens2) {
vol[0]=2;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy);
+ id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
} else if(id==fIdSens3) {
vol[0]=3;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else if(id==fIdSens4) {
vol[0]=4;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else if(id==fIdSens5) {
vol[0]=5;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else if(id==fIdSens6) {
vol[0]=6;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else return;
gMC->TrackPosition(position);
hits[0]=position[0];
hits[1]=position[1];
hits[2]=position[2];
- hits[3]=momentum[0]*momentum[3];
- hits[4]=momentum[1]*momentum[3];
- hits[5]=momentum[2]*momentum[3];
+ hits[3]=momentum[0];
+ hits[4]=momentum[1];
+ hits[5]=momentum[2];
hits[6]=gMC->Edep();
new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
Int_t copy, id;
Float_t hits[7];
Int_t vol[3];
- Float_t position[3];
- Float_t momentum[4];
+ TLorentzVector position, momentum;
TClonesArray &lhits = *fHits;
//
if(gMC->TrackCharge() && gMC->Edep()) {
//
// Only entering charged tracks
- if((id=gMC->CurrentVol(0,copy))==fIdSens1) {
+ if((id=gMC->CurrentVolID(copy))==fIdSens1) {
vol[0]=1;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy);
+ id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
} else if(id==fIdSens2) {
vol[0]=2;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy);
+ id=gMC->CurrentVolOffID(2,copy);
vol[2]=copy;
} else if(id==fIdSens3) {
vol[0]=3;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else if(id==fIdSens4) {
vol[0]=4;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else if(id==fIdSens5) {
vol[0]=5;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else if(id==fIdSens6) {
vol[0]=6;
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
} else return;
gMC->TrackPosition(position);
hits[0]=position[0];
hits[1]=position[1];
hits[2]=position[2];
- hits[3]=momentum[0]*momentum[3];
- hits[4]=momentum[1]*momentum[3];
- hits[5]=momentum[2]*momentum[3];
+ hits[3]=momentum[0];
+ hits[4]=momentum[1];
+ hits[5]=momentum[2];
hits[6]=gMC->Edep();
new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
hits[0]=position[0];
hits[1]=position[1];
hits[2]=position[2];
- hits[3]=momentum[0]*momentum[3];
- hits[4]=momentum[1]*momentum[3];
- hits[5]=momentum[2]*momentum[3];
+ hits[3]=momentum[0];
+ hits[4]=momentum[1];
+ hits[5]=momentum[2];
hits[6]=gMC->Edep();
new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
#include "AliRun.h"
#include "stdlib.h"
#include "TSystem.h"
-#include "TGeant3.h"
ClassImp(AliITSv5)
Int_t copy1,copy2;
Float_t hits[7];
Int_t vol[3];
- Float_t position[3];
- Float_t momentum[4];
+ TLorentzVector position, momentum;
TClonesArray &lhits = *fHits;
//
if(gMC->TrackCharge() && gMC->Edep()) {
//
// Only entering charged tracks
- if((id=gMC->CurrentVol(0,copy))==fIdSens1) {
+ if((id=gMC->CurrentVolID(copy))==fIdSens1) {
vol[0]=1;
- id=gMC->CurrentVolOff(0,0,copy); //detector copy in the ladder = 1<->4 (ITS1)
+ id=gMC->CurrentVolOffID(0,copy); //detector copy in the ladder = 1<->4 (ITS1)
vol[1]=copy;
- gMC->CurrentVolOff(1,0,copy1); //ladder copy in the module = 1<->2 (I186)
- gMC->CurrentVolOff(2,0,copy2); //module copy in the layer = 1<->10 (I132)
+ gMC->CurrentVolOffID(1,copy1); //ladder copy in the module = 1<->2 (I186)
+ gMC->CurrentVolOffID(2,copy2); //module copy in the layer = 1<->10 (I132)
vol[2]=copy1+(copy2-1)*2; //# of ladders in one module = 2
} else if(id==fIdSens2) {
vol[0]=2;
- id=gMC->CurrentVolOff(0,0,copy); //detector copy in the ladder = 1<->4 (ITS2)
+ id=gMC->CurrentVolOffID(0,copy); //detector copy in the ladder = 1<->4 (ITS2)
vol[1]=copy;
- gMC->CurrentVolOff(1,0,copy1); //ladder copy in the module = 1<->4 (I131)
- gMC->CurrentVolOff(2,0,copy2); //module copy in the layer = 1<->10 (I132)
+ gMC->CurrentVolOffID(1,copy1); //ladder copy in the module = 1<->4 (I131)
+ gMC->CurrentVolOffID(2,copy2); //module copy in the layer = 1<->10 (I132)
vol[2]=copy1+(copy2-1)*4; //# of ladders in one module = 4
} else if(id==fIdSens3) {
vol[0]=3;
- id=gMC->CurrentVolOff(1,0,copy); //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
+ id=gMC->CurrentVolOffID(1,copy); //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy); //ladder copy in the layer = 1<->12 (I316)
+ id=gMC->CurrentVolOffID(2,copy); //ladder copy in the layer = 1<->12 (I316)
vol[2]=copy;
} else if(id==fIdSens4) {
vol[0]=4;
- id=gMC->CurrentVolOff(1,0,copy); //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
+ id=gMC->CurrentVolOffID(1,copy); //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy); //ladder copy in the layer = 1<->22 (I417)
+ id=gMC->CurrentVolOffID(2,copy); //ladder copy in the layer = 1<->22 (I417)
vol[2]=copy;
} else if(id==fIdSens5) {
vol[0]=5;
- id=gMC->CurrentVolOff(1,0,copy); //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
+ id=gMC->CurrentVolOffID(1,copy); //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy); //ladder copy in the layer = 1<->34 (I565)
+ id=gMC->CurrentVolOffID(2,copy); //ladder copy in the layer = 1<->34 (I565)
vol[2]=copy;
} else if(id==fIdSens6) {
vol[0]=6;
- id=gMC->CurrentVolOff(1,0,copy); //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
+ id=gMC->CurrentVolOffID(1,copy); //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
vol[1]=copy;
- id=gMC->CurrentVolOff(2,0,copy); //ladder copy in the layer = 1<->38 (I569)
+ id=gMC->CurrentVolOffID(2,copy); //ladder copy in the layer = 1<->38 (I569)
vol[2]=copy;
} else return;
gMC->TrackPosition(position);
hits[0]=position[0];
hits[1]=position[1];
hits[2]=position[2];
- hits[3]=momentum[0]*momentum[3];
- hits[4]=momentum[1]*momentum[3];
- hits[5]=momentum[2]*momentum[3];
+ hits[3]=momentum[0];
+ hits[4]=momentum[1];
+ hits[5]=momentum[2];
hits[6]=gMC->Edep();
new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
static Int_t vol[2];
Int_t ipart;
static Float_t hits[10];
- Float_t pos[3];
- Float_t mom[4];
- Float_t theta,phi;
Float_t destep, step;
static Float_t eloss, xhit, yhit, tlength;
const Float_t big=1.e10;
+ TLorentzVector pos, mom;
TClonesArray &lhits = *fHits;
// Only gas gap inside chamber
// Tag chambers and record hits when track enters
idvol=-1;
- id=gMC->CurrentVol(0,copy);
+ id=gMC->CurrentVolID(copy);
for (Int_t i=1; i<=NCH; i++) {
if(id==((AliMUONchamber*)(*fChambers)[i-1])->GetGid()){
//
// record hits when track enters ...
- if( gMC->TrackEntering()) {
+ if( gMC->IsTrackEntering()) {
gMC->SetMaxStep(fMaxStepGas);
- Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
- Double_t rt = TMath::Sqrt(tc);
- theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
- phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
+ // Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
+ //Double_t rt = TMath::Sqrt(tc);
+ //theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
+ //phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
hits[0] = Float_t(ipart); // Geant3 particle type
hits[1] = pos[0]; // X-position for hit
hits[2] = pos[1]; // Y-position for hit
hits[3] = pos[2]; // Z-position for hit
- hits[4] = theta; // theta angle of incidence
- hits[5] = phi; // phi angle of incidence
+ hits[4] = mom.Theta()*kRaddeg; // theta angle of incidence
+ hits[5] = mom.Phi()*kRaddeg; // phi angle of incidence
hits[8] = (Float_t) fNclusters; // first padhit
hits[9] = -1; // last pad hit
// phi angle of incidence
// Calculate the charge induced on a pad (disintegration) in case
//
// Mip left chamber ...
- if( gMC->TrackExiting() || gMC->TrackStop() || gMC->TrackDisappear()){
+ if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
gMC->SetMaxStep(big);
eloss += destep;
tlength += step;
{
TClonesArray &lhits = *fHits;
+ TLorentzVector p;
Int_t copy, i;
Int_t vol[5];
Float_t hits[4];
- if(gMC->CurrentVol(0,copy) == fIdSens) {
+ if(gMC->CurrentVolID(copy) == fIdSens) {
//
//We are in the sensitive volume
for(i=0;i<4;i++) {
- gMC->CurrentVolOff(i+1,0,copy);
+ gMC->CurrentVolOffID(i+1,copy);
vol[4-i]=copy;
}
- gMC->CurrentVolOff(7,0,copy);
+ gMC->CurrentVolOffID(7,copy);
vol[0]=copy;
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(p);
+ for(i=0;i<3;++i) hits[i]=p[i];
hits[3]=gMC->Edep();
new(lhits[fNhits++]) AliPHOShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
int cradle_number, cell_Z, cell_Phi; // Variables that describe cell position.
- if( gMC->GetMedium() == GetPHOS_IDTMED_PIN() && (gMC->TrackInside() || gMC->TrackExiting()==2) && inwold && gMC->TrackCharge()!=0 )
+ if( gMC->GetMedium() == GetPHOS_IDTMED_PIN() && (gMC->IsTrackInside() || gMC->IsTrackExiting()==2) && inwold && gMC->TrackCharge()!=0 )
{
// GEANT particle just have entered into PIN diode.
AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
- gMC->CurrentVolOff(4,0,copy);
+ gMC->CurrentVolOffID(4,copy);
cradle_number = copy-1;
- gMC->CurrentVolOff(1,0,copy);
+ gMC->CurrentVolOffID(1,copy);
cell_Z = copy-1;
- gMC->CurrentVolOff(2,0,copy);
+ gMC->CurrentVolOffID(2,copy);
cell_Phi = copy-1;
/*
cradle_number = cvolu->number[cvolu->nlevel-5]-1;
AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
- gMC->CurrentVolOff(5,0,copy);
+ gMC->CurrentVolOffID(5,copy);
cradle_number = copy-1;
- gMC->CurrentVolOff(2,0,copy);
+ gMC->CurrentVolOffID(2,copy);
cell_Z = copy-1;
- gMC->CurrentVolOff(3,0,copy);
+ gMC->CurrentVolOffID(3,copy);
cell_Phi = copy-1;
/*
cradle_number = cvolu->number[cvolu->nlevel-6]-1;
//////////////////////////////////////////////////////////////////////////////
- if( gMC->GetMedium()==GetPHOS_IDTMED_CPV() && (gMC->TrackInside() || gMC->TrackExiting()) && inwold )
+ if( gMC->GetMedium()==GetPHOS_IDTMED_CPV() && (gMC->IsTrackInside() || gMC->IsTrackExiting()) && inwold )
{
// GEANT particle just have entered into CPV detector.
AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
- gMC->CurrentVolOff(1,0,cradle_number);
+ gMC->CurrentVolOffID(1,cradle_number);
cradle_number--;
// cradle_number = cvolu->number[cvolu->nlevel-2]-1;
AliPHOSCradle &cradle = PHOS.GetCradle(cradle_number);
- Float_t xyz[3];
+ TLorentzVector xyz;
+ TVector3 v;
gMC->TrackPosition(xyz);
- TVector3 p(xyz[0],xyz[1],xyz[2]),v;
float x,y,l;
float R = cradle.GetRadius() - cradle.GetCPV_PHOS_Distance() - cradle.GetCPV_Thikness();
- cradle.GetXY(p,v,R,x,y,l);
+ cradle.GetXY(xyz.Vect(),v,R,x,y,l);
if( PHOS.fDebugLevel>0 )
if( l<0 )
printf("PHOS_STEP: warning: negative distance to CPV!! %f\n", l);
// Store current particle in the list of Cradle particles.
- Float_t pmom[4];
+ TLorentzVector pmom;
gMC->TrackMomentum(pmom);
- float Px = pmom[0] * pmom[3],
- Py = pmom[1] * pmom[3],
- Pz = pmom[2] * pmom[3];
+ float Px = pmom[0],
+ Py = pmom[1],
+ Pz = pmom[2];
Int_t Ipart = gMC->TrackPid();
// TClonesArray &P=cradle.GetParticles();
cradle.AddCPVHit(x,y);
}
- inwold=gMC->TrackEntering(); // Save current status of GEANT variable.
+ inwold=gMC->IsTrackEntering(); // Save current status of GEANT variable.
}
gMC->TrackPosition(xyze);
xyze[3]=gMC->Edep();
- gMC->CurrentVolOff(3, (Text_t*)NULL, blrc[0]);
+ gMC->CurrentVolOffID(3, blrc[0]);
blrc[1]=1; // CPV corresponds to layer 1
- gMC->CurrentVolOff(2, (Text_t*)NULL, blrc[2]);
- gMC->CurrentVolOff(1, (Text_t*)NULL, blrc[3]);
+ gMC->CurrentVolOffID(2, blrc[2]);
+ gMC->CurrentVolOffID(1, blrc[3]);
AddHit(gAlice->CurrentTrack(), blrc, xyze);
gMC->TrackPosition(xyze);
xyze[3]=gMC->Edep();
- gMC->CurrentVolOff(9, (Text_t*)NULL, blrc[0]);
+ gMC->CurrentVolOffID(9, blrc[0]);
blrc[1]=2; // PWO crystals correspond to layer 2
- gMC->CurrentVolOff(4, (Text_t*)NULL, blrc[2]);
- gMC->CurrentVolOff(3, (Text_t*)NULL, blrc[3]);
+ gMC->CurrentVolOffID(4, blrc[2]);
+ gMC->CurrentVolOffID(3, blrc[3]);
AddHit(gAlice->CurrentTrack(), blrc, xyze);
int cradle_number, cell_Z, cell_Phi; // Variables that describe cell position.
- if( gMC->GetMedium()==GetPHOS_IDTMED_PIN() && gMC->TrackEntering() && gMC->TrackCharge()!=0 )
+ if( gMC->GetMedium()==GetPHOS_IDTMED_PIN() && gMC->IsTrackEntering() && gMC->TrackCharge()!=0 )
{
// GEANT particle just have entered into PIN diode.
AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
- gMC->CurrentVolOff(4,0,copy);
+ gMC->CurrentVolOffID(4,copy);
cradle_number = copy-1;
- gMC->CurrentVolOff(1,0,copy);
+ gMC->CurrentVolOffID(1,copy);
cell_Z = copy-1;
- gMC->CurrentVolOff(2,0,copy);
+ gMC->CurrentVolOffID(2,copy);
cell_Phi = copy-1;
TH2S &h = PHOS.GetCradle(cradle_number).fChargedTracksInPIN;
AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
- gMC->CurrentVolOff(5,0,copy);
+ gMC->CurrentVolOffID(5,copy);
cradle_number = copy-1;
- gMC->CurrentVolOff(2,0,copy);
+ gMC->CurrentVolOffID(2,copy);
cell_Z = copy-1;
- gMC->CurrentVolOff(3,0,copy);
+ gMC->CurrentVolOffID(3,copy);
cell_Phi = copy-1;
TH2F &h = PHOS.GetCradle(cradle_number).fCellEnergy;
//////////////////////////////////////////////////////////////////////////////
- if( gMC->GetMedium()==GetPHOS_IDTMED_CPV() && gMC->TrackEntering() )
+ if( gMC->GetMedium()==GetPHOS_IDTMED_CPV() && gMC->IsTrackEntering() )
{
// GEANT particle just have entered into CPV detector.
AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
- gMC->CurrentVolOff(1,0,cradle_number);
+ gMC->CurrentVolOffID(1,cradle_number);
cradle_number--;
// Save CPV x,y hits position of charged particles.
AliPHOSCradle &cradle = PHOS.GetCradle(cradle_number);
- Float_t xyz[3];
- gMC->TrackPosition(xyz);
- TVector3 p(xyz[0],xyz[1],xyz[2]),v;
+ TLorentzVector p;
+ gMC->TrackPosition(p);
+ TVector3 v;
float x,y,l;
float R = cradle.GetRadius() - cradle.GetCPV_PHOS_Distance() - cradle.GetCPV_Thikness();
- cradle.GetXY(p,v,R,x,y,l);
+ cradle.GetXY(p.Vect(),v,R,x,y,l);
if( PHOS.fDebugLevel>0 )
if( l<0 )
printf("PHOS_STEP: warning: negative distance to CPV!! %f\n", l);
// Store current particle in the list of Cradle particles.
- Float_t pmom[4];
+ TLorentzVector pmom;
gMC->TrackMomentum(pmom);
- Float_t Px = pmom[0] * pmom[3],
- Py = pmom[1] * pmom[3],
- Pz = pmom[2] * pmom[3];
- Float_t Getot = gMC->Etot();
+ Float_t Px = pmom[0],
+ Py = pmom[1],
+ Pz = pmom[2];
+ Float_t Getot = pmom[3];
Int_t Ipart = gMC->TrackPid();
cradle.GetParticles().Add(new AliPHOSgamma(x,y,Getot,Px,Py,Pz,Ipart));
}
- inwold=gMC->TrackEntering(); // Save current status of GEANT variable.
+ inwold=gMC->IsTrackEntering(); // Save current status of GEANT variable.
}
Float_t hits[4], destep;
Float_t center[3] = {0,0,0};
Int_t vol[5];
- Text_t namep[5];
+ const char* namep;
if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
- gMC->CurrentVol(namep, copy);
+ gMC->CurrentVolID(copy);
vol[0]=copy;
- gMC->CurrentVolOff(1,namep,copy);
+ gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
- gMC->CurrentVolOff(2,namep,copy);
+ gMC->CurrentVolOffID(2,copy);
+ namep=gMC->CurrentVolOffName(2);
vol[2]=copy;
if(strncmp(namep,"DW11",4))vol[2]=1;
if(strncmp(namep,"DV11",4))vol[2]=2;
- gMC->CurrentVolOff(3,namep,copy);
+ gMC->CurrentVolOffID(3,copy);
vol[3]=copy;
- gMC->CurrentVolOff(4,namep,copy);
+ gMC->CurrentVolOffID(4,copy);
vol[4]=copy;
gMC->Gdtom(center,hits,1);
hits[3] = destep*1e9; //Number in eV
Float_t hits[4], destep;
Float_t center[3] = {0,0,0};
Int_t vol[5];
- Text_t namep[5];
+ // char *namep;
if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
-// gMC->CurrentVol(0, copy);
- gMC->CurrentVol(namep, copy);
-// printf("Current vol is %s \n",namep);
+ gMC->CurrentVolID(copy);
+// namep=gMC->CurrentVolName();
+// printf("Current vol is %s \n",namep);
vol[0]=copy;
-// gMC->CurrentVolOff(1,0,copy);
- gMC->CurrentVolOff(1,namep,copy);
-// printf("Current vol 11 is %s \n",namep);
+ gMC->CurrentVolOffID(1,copy);
+// namep=gMC->CurrentVolOffName(1);
+// printf("Current vol 11 is %s \n",namep);
vol[1]=copy;
-// gMC->CurrentVolOff(2,0,copy);
- gMC->CurrentVolOff(2,namep,copy);
-// printf("Current vol 22 is %s \n",namep);
+ gMC->CurrentVolOffID(2,copy);
+// namep=gMC->CurrentVolOffName(2);
+// printf("Current vol 22 is %s \n",namep);
vol[2]=copy;
// if(strncmp(namep,"DW11",4))vol[2]=1;
-// gMC->CurrentVolOff(3,0,copy);
- gMC->CurrentVolOff(3,namep,copy);
-// printf("Current vol 33 is %s \n",namep);
+ gMC->CurrentVolOffID(3,copy);
+// namep=gMC->CurrentVolOffName(3);
+// printf("Current vol 33 is %s \n",namep);
vol[3]=copy;
- gMC->CurrentVolOff(4,namep,copy);
-// printf("Current vol 44 is %s \n",namep);
+ gMC->CurrentVolOffID(4,copy);
+// namep=gMC->CurrentVolOffName(4);
+// printf("Current vol 44 is %s \n",namep);
vol[4]=copy;
// printf("volume number %d,%d,%d,%d,%d \n",vol[0],vol[1],vol[2],vol[3],vol[4]);
gMC->Gdtom(center,hits,1);
Float_t hits[4], destep;
Float_t center[3] = {0,0,0};
Int_t vol[5];
- Text_t namep[5];
+ const char *namep;
if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
- gMC->CurrentVol(namep, copy);
+ gMC->CurrentVolID(copy);
vol[0]=copy;
- gMC->CurrentVolOff(1,namep,copy);
+ gMC->CurrentVolOffID(1,copy);
vol[1]=copy;
- gMC->CurrentVolOff(2,namep,copy);
+ gMC->CurrentVolOffID(2,copy);
+ namep=gMC->CurrentVolOffName(2);
vol[2]=copy;
if(strncmp(namep,"DW11",4))vol[2]=1;
if(strncmp(namep,"DV11",4))vol[2]=2;
- gMC->CurrentVolOff(3,namep,copy);
+ gMC->CurrentVolOffID(3,copy);
vol[3]=copy;
- gMC->CurrentVolOff(4,namep,copy);
+ gMC->CurrentVolOffID(4,copy);
vol[4]=copy;
gMC->Gdtom(center,hits,1);
hits[3] = destep*1e9; //Number in eV
#include <TMath.h>
-static const Double_t kPI = TMath::Pi();
static const Double_t k2PI = 2*kPI;
static const Double_t kDegrad = kPI/180;
static const Double_t kRaddeg = 180/kPI;
Float_t t, tt;
Float_t a,z,dens,radl,absl;
+ Int_t i;
Float_t step = gMC->TrackStep();
- Float_t vect[3], pmom[4];
- gMC->TrackPosition(vect);
- gMC->TrackMomentum(pmom);
+ Float_t vect[3], dir[3];
+ TLorentzVector pos, mom;
+
+ gMC->TrackPosition(pos);
+ gMC->TrackMomentum(mom);
gMC->CurrentMaterial(a,z,dens,radl,absl);
if (z < 1) return;
// --- See if we have to stop now
- if (TMath::Abs(vect[2]) > fZMax ||
- vect[0]*vect[0] +vect[1]*vect[1] > fRadMax*fRadMax) {
+ if (TMath::Abs(pos[2]) > fZMax ||
+ pos[0]*pos[0] +pos[1]*pos[1] > fRadMax*fRadMax) {
gMC->StopEvent();
} else {
// --- See how long we have to go
- t = PropagateCylinder(vect,pmom,fRadMax,fZMax);
+ for(i=0;i<3;++i) {
+ vect[i]=pos[i];
+ dir[i]=mom[i];
+ }
+ t = PropagateCylinder(vect,dir,fRadMax,fZMax);
tt = TMath::Min(step,t);
fTotAbso += tt/absl;
///////////////////////////////////////////////////////////////////////////////
#include <TNamed.h>
+#include <TLorentzVector.h>
class AliMC : public TNamed
{
static inline AliMC* GetMC() {return fgMC;}
//
virtual Int_t CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl) const =0;
- virtual Int_t CurrentVol(Text_t*, Int_t&) const =0;
- virtual Int_t CurrentVolOff(Int_t, Text_t*, Int_t& ) const =0;
+ virtual Int_t CurrentVolID(Int_t&) const =0;
+ virtual Int_t CurrentVolOffID(Int_t, Int_t& ) const =0;
+ virtual const char* CurrentVolName() const =0;
+ virtual const char* CurrentVolOffName(Int_t) const =0;
virtual Int_t NofVolumes() const =0;
virtual Int_t VolId(Text_t*) const =0;
virtual Int_t IdFromPDG(Int_t) const =0;
virtual Int_t PDGFromId(Int_t) const =0;
virtual void DefineParticles() = 0;
- virtual void TrackPosition(Float_t*) const =0;
- virtual void TrackMomentum(Float_t*) const =0;
+ virtual void TrackPosition(TLorentzVector&) const =0;
+ virtual void TrackMomentum(TLorentzVector&) const =0;
virtual Float_t TrackCharge() const =0;
virtual Float_t TrackMass() const =0;
virtual Float_t TrackStep() const =0;
virtual Int_t TrackPid() const =0;
- virtual Bool_t TrackInside() const =0;
- virtual Bool_t TrackEntering() const =0;
- virtual Bool_t TrackExiting() const =0;
- virtual Bool_t TrackOut() const =0;
- virtual Bool_t TrackDisappear() const =0;
- virtual Bool_t TrackStop() const =0;
+ virtual Bool_t IsTrackInside() const =0;
+ virtual Bool_t IsTrackEntering() const =0;
+ virtual Bool_t IsTrackExiting() const =0;
+ virtual Bool_t IsTrackOut() const =0;
+ virtual Bool_t IsTrackDisappeared() const =0;
+ virtual Bool_t IsTrackStop() const =0;
virtual Float_t TrackLength() const =0;
virtual Float_t TrackTime() const =0;
- virtual Bool_t TrackAlive() const=0;
+ virtual Bool_t IsTrackAlive() const=0;
virtual Int_t NSecondaries() const=0;
virtual Int_t CurrentEvent() const=0;
virtual void ProdProcess(char*) const=0;
return;
}
//Update energy deposition tables
- sEventEnergy[gMC->CurrentVol(0,copy)]+=gMC->Edep();
+ sEventEnergy[gMC->CurrentVolID(copy)]+=gMC->Edep();
//Call the appropriate stepping routine;
AliModule *det = (AliModule*)fModules->At(id);
}
//_____________________________________________________________________________
-Int_t TGeant3::CurrentVol(Text_t *name, Int_t ©) const
+Int_t TGeant3::CurrentVolID(Int_t ©) const
{
//
- // Returns the current volume ID, name and copy number
- // if name=0 no name is returned
+ // Returns the current volume ID and copy number
//
Int_t i, gname;
if( (i=fGcvolu->nlevel-1) < 0 ) {
- printf("CurrentVol: stack depth %d\n",fGcvolu->nlevel);
+ Warning("CurrentVolID","Stack depth only %d\n",fGcvolu->nlevel);
} else {
gname=fGcvolu->names[i];
- if(name) {
- strncpy(name,(char *) &gname, 4);
- name[4]='\0';
- }
copy=fGcvolu->number[i];
i=fGcvolu->lvolum[i];
if(gname == fZiq[fGclink->jvolum+i]) return i;
- else printf("CurrentVol: Volume %s not found in bank\n",name);
+ else Warning("CurrentVolID","Volume %4s not found\n",(char*)&gname);
}
return 0;
}
//_____________________________________________________________________________
-Int_t TGeant3::CurrentVolOff(Int_t off, Text_t *name, Int_t ©) const
+Int_t TGeant3::CurrentVolOffID(Int_t off, Int_t ©) const
{
//
// Return the current volume "off" upward in the geometrical tree
- // ID, name and copy number
- // if name=0 no name is returned
+ // ID and copy number
//
Int_t i, gname;
if( (i=fGcvolu->nlevel-off-1) < 0 ) {
- printf("CurrentVolOff: Offset requested %d but stack depth %d\n",off,fGcvolu->nlevel);
+ Warning("CurrentVolOffID","Offset requested %d but stack depth %d\n",
+ off,fGcvolu->nlevel);
} else {
gname=fGcvolu->names[i];
- if(name) {
- strncpy(name,(char *) &gname, 4);
- name[4]='\0';
- }
copy=fGcvolu->number[i];
i=fGcvolu->lvolum[i];
if(gname == fZiq[fGclink->jvolum+i]) return i;
- else printf("CurrentVolOff: Volume %s not found in bank\n",name);
+ else Warning("CurrentVolOffID","Volume %4s not found\n",(char*)&gname);
+ }
+ return 0;
+}
+
+//_____________________________________________________________________________
+const char* TGeant3::CurrentVolName() const
+{
+ //
+ // Returns the current volume name
+ //
+ Int_t i, gname;
+ char *name;
+ if( (i=fGcvolu->nlevel-1) < 0 ) {
+ Warning("CurrentVolName","Stack depth %d\n",fGcvolu->nlevel);
+ } else {
+ gname=fGcvolu->names[i];
+ name = new char[5];
+ strncpy(name,(char *) &gname, 4);
+ name[4]='\0';
+ i=fGcvolu->lvolum[i];
+ if(gname == fZiq[fGclink->jvolum+i]) return name;
+ else Warning("CurrentVolName","Volume %4s not found\n",name);
+ }
+ return 0;
+}
+
+//_____________________________________________________________________________
+const char* TGeant3::CurrentVolOffName(Int_t off) const
+{
+ //
+ // Return the current volume "off" upward in the geometrical tree
+ // ID, name and copy number
+ // if name=0 no name is returned
+ //
+ Int_t i, gname;
+ char *name;
+ if( (i=fGcvolu->nlevel-off-1) < 0 ) {
+ Warning("CurrentVolOffName",
+ "Offset requested %d but stack depth %d\n",off,fGcvolu->nlevel);
+ } else {
+ gname=fGcvolu->names[i];
+ name = new char[5];
+ strncpy(name,(char *) &gname, 4);
+ name[4]='\0';
+ i=fGcvolu->lvolum[i];
+ if(gname == fZiq[fGclink->jvolum+i]) return name;
+ else Warning("CurrentVolOffName","Volume %4s not found\n",name);
}
return 0;
}
}
//_____________________________________________________________________________
-void TGeant3::TrackPosition(Float_t *xyz) const
+void TGeant3::TrackPosition(TLorentzVector &xyz) const
{
//
// Return the current position in the master reference frame of the
xyz[0]=fGctrak->vect[0];
xyz[1]=fGctrak->vect[1];
xyz[2]=fGctrak->vect[2];
+ xyz[3]=fGctrak->tofg;
}
//_____________________________________________________________________________
}
//_____________________________________________________________________________
-void TGeant3::TrackMomentum(Float_t *xyz) const
+void TGeant3::TrackMomentum(TLorentzVector &xyz) const
{
//
// Return the direction and the momentum (GeV/c) of the track
// currently being transported
//
- xyz[0]=fGctrak->vect[3];
- xyz[1]=fGctrak->vect[4];
- xyz[2]=fGctrak->vect[5];
- xyz[3]=fGctrak->vect[6];
+ Double_t ptot=fGctrak->vect[6];
+ xyz[0]=fGctrak->vect[3]*ptot;
+ xyz[1]=fGctrak->vect[4]*ptot;
+ xyz[2]=fGctrak->vect[5]*ptot;
+ xyz[3]=fGctrak->getot;
}
//_____________________________________________________________________________
}
//_____________________________________________________________________________
-Bool_t TGeant3::TrackInside() const
+Bool_t TGeant3::IsTrackInside() const
{
//
// True if the track is not at the boundary of the current volume
}
//_____________________________________________________________________________
-Bool_t TGeant3::TrackEntering() const
+Bool_t TGeant3::IsTrackEntering() const
{
//
// True if this is the first step of the track in the current volume
}
//_____________________________________________________________________________
-Bool_t TGeant3::TrackExiting() const
+Bool_t TGeant3::IsTrackExiting() const
{
//
// True if this is the last step of the track in the current volume
}
//_____________________________________________________________________________
-Bool_t TGeant3::TrackOut() const
+Bool_t TGeant3::IsTrackOut() const
{
//
// True if the track is out of the setup
}
//_____________________________________________________________________________
-Bool_t TGeant3::TrackStop() const
+Bool_t TGeant3::IsTrackStop() const
{
//
// True if the track energy has fallen below the threshold
}
//_____________________________________________________________________________
-Bool_t TGeant3::TrackDisappear() const
+Bool_t TGeant3::IsTrackDisappeared() const
{
//
// True if the current particle has disappered
}
//_____________________________________________________________________________
-Bool_t TGeant3::TrackAlive() const
+Bool_t TGeant3::IsTrackAlive() const
{
//
// True if the current particle is alive and will continue to be
void GeomIter();
Int_t CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl) const;
Int_t NextVolUp(Text_t *name, Int_t ©);
- Int_t CurrentVol(Text_t *name, Int_t ©) const;
- Int_t CurrentVolOff(Int_t off, Text_t *name, Int_t ©) const;
+ Int_t CurrentVolID(Int_t ©) const;
+ Int_t CurrentVolOffID(Int_t off, Int_t ©) const;
+ const char* CurrentVolName() const;
+ const char *CurrentVolOffName(Int_t off) const;
Int_t VolId(Text_t *name) const;
Int_t IdFromPDG(Int_t pdg) const;
Int_t PDGFromId(Int_t pdg) const;
void DefineParticles();
const char* VolName(Int_t id) const;
- void TrackPosition(Float_t *xyz) const;
- void TrackMomentum(Float_t *xyz) const;
+ void TrackPosition(TLorentzVector &xyz) const;
+ void TrackMomentum(TLorentzVector &xyz) const;
Int_t NofVolumes() const;
Float_t TrackTime() const;
Float_t TrackCharge() const;
Float_t TrackStep() const;
Float_t TrackLength() const;
Int_t TrackPid() const;
- Bool_t TrackInside() const;
- Bool_t TrackEntering() const;
- Bool_t TrackExiting() const;
- Bool_t TrackOut() const;
- Bool_t TrackDisappear() const;
- Bool_t TrackStop() const;
- Bool_t TrackAlive() const;
+ Bool_t IsTrackInside() const;
+ Bool_t IsTrackEntering() const;
+ Bool_t IsTrackExiting() const;
+ Bool_t IsTrackOut() const;
+ Bool_t IsTrackDisappeared() const;
+ Bool_t IsTrackStop() const;
+ Bool_t IsTrackAlive() const;
Int_t NSecondaries() const;
Int_t CurrentEvent() const;
void ProdProcess(char*) const;
void TGeant3::GeomIter() {}
Int_t TGeant3::CurrentMaterial(Float_t &, Float_t &, Float_t &, Float_t &, Float_t &) const {return 0;}
Int_t TGeant3::NextVolUp(Text_t*, Int_t&) {return 0;}
-Int_t TGeant3::CurrentVol(Text_t*, Int_t&) const {return 0;}
+Int_t TGeant3::CurrentVolID(Int_t&) const {return 0;}
+const char* TGeant3::CurrentVolName() const {return 0;}
Int_t TGeant3::NofVolumes() const {return 0;}
-Int_t TGeant3::CurrentVolOff(Int_t, Text_t*, Int_t&) const {return 0;}
-void TGeant3::TrackPosition(Float_t*) const {}
-void TGeant3::TrackMomentum(Float_t*) const {}
+Int_t TGeant3::CurrentVolOffID(Int_t, Int_t&) const {return 0;}
+const char *TGeant3::CurrentVolOffName(Int_t) const {return 0;}
+void TGeant3::TrackPosition(TLorentzVector&) const {}
+void TGeant3::TrackMomentum(TLorentzVector&) const {}
Int_t TGeant3::IdFromPDG(Int_t pdg) const {return -1;}
Int_t TGeant3::PDGFromId(Int_t pdg) const {return -1;}
void TGeant3::DefineParticles() {}
const char* TGeant3::VolName(Int_t ) const {return 0;}
Float_t TGeant3::TrackCharge() const {return 0;}
Float_t TGeant3::TrackMass() const {return 0;}
-Bool_t TGeant3::TrackInside() const {return 0;}
-Bool_t TGeant3::TrackEntering() const {return 0;}
-Bool_t TGeant3::TrackExiting() const {return 0;}
-Bool_t TGeant3::TrackOut() const {return 0;}
-Bool_t TGeant3::TrackDisappear() const {return 0;}
-Bool_t TGeant3::TrackStop() const {return 0;}
+Bool_t TGeant3::IsTrackInside() const {return 0;}
+Bool_t TGeant3::IsTrackEntering() const {return 0;}
+Bool_t TGeant3::IsTrackExiting() const {return 0;}
+Bool_t TGeant3::IsTrackOut() const {return 0;}
+Bool_t TGeant3::IsTrackDisappeared() const {return 0;}
+Bool_t TGeant3::IsTrackStop() const {return 0;}
Int_t TGeant3::NSecondaries() const {return 0;}
void TGeant3::ProdProcess(char*) const {}
void TGeant3::GetSecondary(Int_t, Int_t&, Float_t*, Float_t*){}
Float_t TGeant3::TrackLength() const {return 0;}
Float_t TGeant3::TrackTime() const {return 0;}
Int_t TGeant3::TrackPid() const {return 0;}
-Bool_t TGeant3::TrackAlive() const {return 0;}
+Bool_t TGeant3::IsTrackAlive() const {return 0;}
void TGeant3::StopTrack() {}
void TGeant3::StopEvent() {}
void TGeant3::SetMaxNStep(Int_t) {}
//
- Float_t x[3];
+ TLorentzVector x;
Float_t r;
Int_t ipp, jk, id, nt;
Float_t polar[3]={0,0,0};
}
// --- Particle leaving the setup ?
- if (!gMC->TrackOut())
+ if (!gMC->IsTrackOut())
if ((id=gAlice->DetFromMate(geant3->Gctmed()->numed)) >= 0) gAlice->StepManager(id);
}
// Procedure called at each step in the Time Of Flight
Float_t hits[8];
Int_t vol[3];
- Int_t copy, id;
+ Int_t copy, id, i;
+ TLorentzVector mom, pos;
//
// Get the pointer to the MonteCarlo
Int_t *idtmed = fIdtmed->GetArray()-499;
if(gMC->GetMedium()==idtmed[510-1] &&
- gMC->TrackEntering() && gMC->TrackCharge()
- && (id=gMC->CurrentVol(0,copy))==fIdSens) {
+ gMC->IsTrackEntering() && gMC->TrackCharge()
+ && (id=gMC->CurrentVolID(copy))==fIdSens) {
TClonesArray &lhits = *fHits;
//
// Record only charged tracks at entrance
vol[2]=copy;
- vol[1]=gMC->CurrentVolOff(1,0,copy);
+ vol[1]=gMC->CurrentVolOffID(1,copy);
if(id==fIdFBT2) copy+=2; else
if(id==fIdFBT2) copy+=4;
vol[0]=1;
- gMC->TrackPosition(hits);
- gMC->TrackMomentum(&hits[3]);
- hits[7]=gMC->TrackTime();
+ gMC->TrackPosition(pos);
+ gMC->TrackMomentum(mom);
+ Double_t ptot=mom.Rho();
+ Double_t norm=1/ptot;
+ for(i=0;i<3;++i) {
+ hits[i]=pos[i];
+ hits[i+3]=mom[i]*norm;
+ }
+ hits[6]=ptot;
+ hits[7]=pos[3];
new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
}
//______________________________________________________________________________
void AliTOFv1::StepManager()
{
+ TLorentzVector mom, pos;
Float_t hits[8];
Int_t vol[3];
- Int_t copy, id;
+ Int_t copy, id, i;
Int_t *idtmed = fIdtmed->GetArray()-499;
if(gMC->GetMedium()==idtmed[510-1] &&
- gMC->TrackEntering() && gMC->TrackCharge()
- && (id=gMC->CurrentVol(0,copy))==fIdSens) {
+ gMC->IsTrackEntering() && gMC->TrackCharge()
+ && (id=gMC->CurrentVolID(copy))==fIdSens) {
TClonesArray &lhits = *fHits;
//
// Record only charged tracks at entrance
vol[2]=copy;
- vol[1]=gMC->CurrentVolOff(1,0,copy);
+ vol[1]=gMC->CurrentVolOffID(1,copy);
if(id==fIdFBT2) copy+=2; else
if(id==fIdFBT2) copy+=4;
vol[0]=1;
- gMC->TrackPosition(hits);
- gMC->TrackMomentum(&hits[3]);
- hits[7]=gMC->TrackTime();
+ gMC->TrackPosition(pos);
+ gMC->TrackMomentum(mom);
+ //
+ Double_t ptot=mom.Rho();
+ Double_t norm=1/ptot;
+ for(i=0;i<3;++i) {
+ hits[i]=pos[i];
+ hits[i+3]=mom[i]*norm;
+ }
+ hits[6]=ptot;
+ hits[7]=pos[3];
new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
}
// Procedure called at each step in the Time Of Flight
//
Float_t hits[8];
+ TLorentzVector pos, mom;
Int_t vol[3];
- Int_t copy, id;
+ Int_t copy, id, i;
Int_t *idtmed = fIdtmed->GetArray()-499;
if(gMC->GetMedium()==idtmed[510-1] &&
- gMC->TrackEntering() && gMC->TrackCharge()
- && gMC->CurrentVol(0,copy)==fIdSens) {
+ gMC->IsTrackEntering() && gMC->TrackCharge()
+ && gMC->CurrentVolID(copy)==fIdSens) {
TClonesArray &lhits = *fHits;
//
// Record only charged tracks at entrance
- gMC->CurrentVolOff(1,0,copy);
+ gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
- gMC->CurrentVolOff(3,0,copy);
+ gMC->CurrentVolOffID(3,copy);
vol[1]=copy;
- id=gMC->CurrentVolOff(6,0,copy);
+ id=gMC->CurrentVolOffID(6,copy);
vol[0]=copy;
if(id==fIdFTO3) {
vol[0]+=22;
- id=gMC->CurrentVolOff(4,0,copy);
+ id=gMC->CurrentVolOffID(4,copy);
if(id==fIdFLT3) vol[1]+=6;
} else if (id==fIdFTO2) {
vol[0]+=20;
- id=gMC->CurrentVolOff(4,0,copy);
+ id=gMC->CurrentVolOffID(4,copy);
if(id==fIdFLT2) vol[1]+=8;
} else {
- id=gMC->CurrentVolOff(4,0,copy);
+ id=gMC->CurrentVolOffID(4,copy);
if(id==fIdFLT1) vol[1]+=14;
}
- gMC->TrackPosition(hits);
- gMC->TrackMomentum(&hits[3]);
- hits[7]=gMC->TrackTime();
+ gMC->TrackPosition(pos);
+ gMC->TrackMomentum(mom);
+ Double_t ptot=mom.Rho();
+ Double_t norm=1/ptot;
+ for(i=0;i<3;++i) {
+ hits[i]=pos[i];
+ hits[i+3]=mom[i]*norm;
+ }
+ hits[6]=ptot;
+ hits[7]=pos[3];
new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
}
///////////////////////////////////////////////////////////////////////////////
#include "AliTOFv3.h"
-#include <TNode.h>
-#include <TTUBE.h>
#include "AliRun.h"
-#include "AliMC.h"
ClassImp(AliTOFv3)
//
// Procedure called at each step in the Time Of Flight
//
+ TLorentzVector mom, pos;
Float_t hits[8];
Int_t vol[3];
- Int_t copy, id;
+ Int_t copy, id, i;
Int_t *idtmed = fIdtmed->GetArray()-499;
if(gMC->GetMedium()==idtmed[510-1] &&
- gMC->TrackEntering() && gMC->TrackCharge()
- && gMC->CurrentVol(0,copy)==fIdSens) {
+ gMC->IsTrackEntering() && gMC->TrackCharge()
+ && gMC->CurrentVolID(copy)==fIdSens) {
TClonesArray &lhits = *fHits;
//
// Record only charged tracks at entrance
- gMC->CurrentVolOff(1,0,copy);
+ gMC->CurrentVolOffID(1,copy);
vol[2]=copy;
- gMC->CurrentVolOff(3,0,copy);
+ gMC->CurrentVolOffID(3,copy);
vol[1]=copy;
- id=gMC->CurrentVolOff(6,0,copy);
+ id=gMC->CurrentVolOffID(6,copy);
vol[0]=copy;
if(id==fIdFTO3) {
vol[0]+=22;
- id=gMC->CurrentVolOff(4,0,copy);
+ id=gMC->CurrentVolOffID(4,copy);
if(id==fIdFLT3) vol[1]+=6;
} else if (id==fIdFTO2) {
vol[0]+=20;
- id=gMC->CurrentVolOff(4,0,copy);
+ id=gMC->CurrentVolOffID(4,copy);
if(id==fIdFLT2) vol[1]+=8;
} else {
- id=gMC->CurrentVolOff(4,0,copy);
+ id=gMC->CurrentVolOffID(4,copy);
if(id==fIdFLT1) vol[1]+=14;
}
- gMC->TrackPosition(hits);
- gMC->TrackMomentum(&hits[3]);
- hits[7]=gMC->TrackTime();
+ gMC->TrackPosition(pos);
+ gMC->TrackMomentum(mom);
+ Double_t ptot=mom.Rho();
+ Double_t norm=1/ptot;
+ for(i=0;i<3;++i) {
+ hits[i]=pos[i];
+ hits[i+3]=mom[i]*norm;
+ }
+ hits[6]=ptot;
+ hits[7]=pos[3];
new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
}
//
// Called at every step in the Time Projection Chamber
//
- Int_t copy, id;
+ Int_t copy, id, i;
Float_t hits[4];
Int_t vol[2];
+ TLorentzVector p;
TClonesArray &lhits = *fHits;
//
- if(gMC->TrackCharge() && gMC->TrackEntering()) {
+ if(gMC->TrackCharge() && gMC->IsTrackEntering()) {
//
// Only entering charged tracks
- if((id=gMC->CurrentVol(0, copy))==fIdSens1) {
+ if((id=gMC->CurrentVolID(copy))==fIdSens1) {
vol[1]=copy+23;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[0]=copy+24;
} else if(id==fIdSens2) {
vol[1]=copy;
- id=gMC->CurrentVolOff(1,0,copy);
+ id=gMC->CurrentVolOffID(1,copy);
vol[0]=copy;
} else return;
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(p);
+ for(i=0;i<3;++i) hits[i]=p[i];
hits[3]=0;
new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
Float_t hits[4];
Int_t vol[2];
TClonesArray &lhits = *fHits;
+ TLorentzVector pos;
vol[1]=0;
gMC->SetMaxStep(big);
- if(!gMC->TrackAlive()) return; // particle has disappeared
+ if(!gMC->IsTrackAlive()) return; // particle has disappeared
Float_t charge = gMC->TrackCharge();
if(TMath::Abs(charge)<=0.) return; // take only charged particles
- id=gMC->CurrentVol(0, copy);
+ id=gMC->CurrentVolID(copy);
// Check the sensitive volume
{
vol[0] = copy; // S-sector number
}
- else if(id == fIdSens3 && gMC->TrackEntering())
+ else if(id == fIdSens3 && gMC->IsTrackEntering())
{
vol[1] = copy; // row number
- id = gMC->CurrentVolOff(1,0,copy);
+ id = gMC->CurrentVolOffID(1,copy);
vol[0] = copy; // sector number (S-sector)
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(pos);
+ hits[0]=pos[0];
+ hits[1]=pos[1];
+ hits[2]=pos[2];
hits[3]=0.; // this hit has no energy loss
new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
- else if(id == fIdSens4 && gMC->TrackEntering())
+ else if(id == fIdSens4 && gMC->IsTrackEntering())
{
vol[1] = copy; // row number
- id = gMC->CurrentVolOff(1,0,copy);
+ id = gMC->CurrentVolOffID(1,copy);
vol[0] = copy+24; // sector number (L-sector)
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(pos);
+ hits[0]=pos[0];
+ hits[1]=pos[1];
+ hits[2]=pos[2];
hits[3]=0.; // this hit has no energy loss
new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
Int_t nel = (Int_t)(((gMC->Edep())-poti)/w_ion) + 1;
nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(pos);
+ hits[0]=pos[0];
+ hits[1]=pos[1];
+ hits[2]=pos[2];
hits[3]=(Float_t)nel;
// Add this hit
// Stemax calculation for the next step
Float_t pp;
- Float_t vect[4];
- gMC->TrackMomentum(vect);
- Float_t ptot = vect[3];
- Float_t beta_gamma = ptot/(gMC->TrackMass());
+ TLorentzVector mom;
+ gMC->TrackMomentum(mom);
+ Float_t ptot=mom.Rho();
+ Float_t beta_gamma = ptot/gMC->TrackMass();
if(gMC->TrackPid() <= 3 && ptot > 0.002)
{
//
Int_t vol[3];
- Int_t icopy, idSens, icSens;
+ Int_t icopy, idSens, icSens, i;
Float_t hits[4];
+ TLorentzVector p;
TClonesArray &lhits = *fHits;
// Use only charged tracks and count them only once per volume
- if (gMC->TrackCharge() && gMC->TrackExiting()) {
+ if (gMC->TrackCharge() && gMC->IsTrackExiting()) {
// Check on sensitive volume
- idSens = gMC->CurrentVol(0,icSens);
+ idSens = gMC->CurrentVolID(icSens);
if ((idSens == fIdSens1) ||
(idSens == fIdSens2) ||
(idSens == fIdSens3)) {
// The sector number
- gMC->CurrentVolOff(5,0,icopy);
+ gMC->CurrentVolOffID(5,icopy);
vol[0] = icopy;
// The chamber number
// 3: inner
// 4: neighbouring right
// 5: outer right
- gMC->CurrentVolOff(3,0,icopy);
+ gMC->CurrentVolOffID(3,icopy);
if (idSens == fIdSens3)
vol[1] = 4 * icopy - 3;
else if (idSens == fIdSens2)
vol[1] = 3;
// The plane number
- gMC->CurrentVolOff(1,0,icopy);
+ gMC->CurrentVolOffID(1,icopy);
vol[2] = icopy;
if (fSensSelect) {
if ((fSensChamber) && (vol[1] != fSensChamber)) addthishit = 0;
if ((fSensSector) && (vol[0] != fSensSector )) addthishit = 0;
if (addthishit) {
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(p);
+ for(i=0;i<3;++i) hits[i]=p[i];
hits[3] = 0;
new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
}
else {
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(p);
+ for(i=0;i<3;++i) hits[i]=p[i];
hits[3] = 0;
new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
Int_t vol[3];
Int_t icopy1, icopy2;
Int_t idSens, icSens;
+ TLorentzVector pos;
Float_t hits[4];
TClonesArray &lhits = *fHits;
// Use only charged tracks and count them only once per volume
- if (gMC->TrackCharge() && gMC->TrackExiting()) {
+ if (gMC->TrackCharge() && gMC->IsTrackExiting()) {
// Check on sensitive volume
- idSens = gMC->CurrentVol(0,icSens);
+ idSens = gMC->CurrentVolID(icSens);
// Check on sensitive volume
- idSens = gMC->CurrentVol(0,icSens);
+ idSens = gMC->CurrentVolID(icSens);
if ((idSens == fIdSens1) ||
(idSens == fIdSens2) ||
(idSens == fIdSens3)) {
// The sector number
- gMC->CurrentVolOff(5,0,icopy1);
- gMC->CurrentVolOff(6,0,icopy2);
+ gMC->CurrentVolOffID(5,icopy1);
+ gMC->CurrentVolOffID(6,icopy2);
if (icopy2 == 1)
vol[0] = icopy1;
else
// 3: inner
// 4: neighbouring right
// 5: outer right
- gMC->CurrentVolOff(3,0,icopy1);
+ gMC->CurrentVolOffID(3,icopy1);
if (idSens == fIdSens3)
vol[1] = 4 * icopy1 - 3;
else if (idSens == fIdSens2)
vol[1] = 3;
// The plane number
- gMC->CurrentVolOff(1,0,icopy1);
+ gMC->CurrentVolOffID(1,icopy1);
vol[2] = icopy1;
if (fSensSelect) {
if ((fSensChamber) && (vol[1] != fSensChamber)) addthishit = 0;
if ((fSensSector) && (vol[0] != fSensSector )) addthishit = 0;
if (addthishit) {
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(pos);
+ hits[0] = pos[0];
+ hits[1] = pos[1];
+ hits[2] = pos[2];
hits[3] = 0;
new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
}
else {
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(pos);
+ hits[0] = pos[0];
+ hits[1] = pos[1];
+ hits[2] = pos[2];
hits[3] = 0;
new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
}
const Double_t kBig = 1.0E+12;
Float_t hits[4];
- Float_t mom[4];
Float_t random[1];
Float_t charge;
Float_t aMass;
+ TLorentzVector pos, mom;
+
Double_t pTot;
Double_t qTot;
Double_t eDelta;
// Use only charged tracks
if (( gMC->TrackCharge() ) &&
- (!gMC->TrackStop() ) &&
- (!gMC->TrackDisappear())) {
+ (!gMC->IsTrackStop() ) &&
+ (!gMC->IsTrackDisappeared())) {
// Find the sensitive volume
- idSens = gMC->CurrentVol(0,icSens);
+ idSens = gMC->CurrentVolID(icSens);
iPla = 0;
iOut = 0;
for (Int_t icham = 0; icham < ncham; ++icham) {
qTot = (Double_t) ((Int_t) (eDelta / kWion) + 1);
// The sector number
- id = gMC->CurrentVolOff(4,0,iSec);
+ id = gMC->CurrentVolOffID(4,iSec);
// The chamber number
// 1: outer left
// 3: inner
// 4: neighbouring right
// 5: outer right
- id = gMC->CurrentVolOff(2,0,iCha);
+ id = gMC->CurrentVolOffID(2,iCha);
if (iCha == 1)
iCha = 3 + iOut;
else
if (addthishit) {
// Add this hit
- gMC->TrackPosition(hits);
+ gMC->TrackPosition(pos);
+ hits[0]=pos[0];
+ hits[1]=pos[1];
+ hits[2]=pos[2];
hits[3] = qTot;
new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
// The energy loss according to Bethe Bloch
gMC->TrackMomentum(mom);
- pTot = mom[3];
+ pTot = mom.Rho();
iPid = gMC->TrackPid();
if ( (iPid > 3) ||
((iPid <= 3) && (pTot < kPTotMax))) {