#include <TParticle.h>
// --- AliRoot classes
+#include "AliLog.h"
#include "AliConst.h"
#include "AliMagF.h"
#include "AliRun.h"
fMedSensGR(0),
fMedSensPI(0),
fMedSensTDI(0),
+ fMedSensVColl(0),
+ fMedSensLumi(0),
fNalfan(0),
fNalfap(0),
fNben(0),
fZEMLength(0),
fpLostITC(0),
fpLostD1C(0),
+ fpcVCollC(0),
fpDetectedC(0),
fnDetectedC(0),
- fnLumiC(0),
fpLostITA(0),
fpLostD1A(0),
fpLostTDI(0),
+ fpcVCollA(0),
fpDetectedA(0),
fnDetectedA(0),
- fnLumiA(0),
- fnTrou(0)
+ fVCollAperture(7./2.),
+ fVCollCentreY(0.),
+ fLumiLength(15.)
{
//
// Default constructor for Zero Degree Calorimeter
fMedSensGR(0),
fMedSensPI(0),
fMedSensTDI(0),
+ fMedSensVColl(0),
+ fMedSensLumi(0),
fNalfan(90),
fNalfap(90),
fNben(18),
fZEMLength(0),
fpLostITC(0),
fpLostD1C(0),
+ fpcVCollC(0),
fpDetectedC(0),
fnDetectedC(0),
- fnLumiC(0),
fpLostITA(0),
fpLostD1A(0),
fpLostTDI(0),
+ fpcVCollA(0),
fpDetectedA(0),
- fnDetectedA(0),
- fnLumiA(0),
- fnTrou(0)
+ fnDetectedA(0),
+ fVCollAperture(7./2.),
+ fVCollCentreY(0.),
+ fLumiLength(15.)
{
//
// Standard constructor for Zero Degree Calorimeter
tubpar[1] = 7.0/2.;
tubpar[2] = totLength1/2.;
gMC->Gsvolu("QE02", "ELTU", idtmed[10], tubpar, 3);
- gMC->Gspos("QE02", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
+ gMC->Gspos("QE01", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
gMC->Gspos("QE02", 1, "QE01", 0., 0., 0., 0, "ONLY");
// Ch.debug
- //printf(" QE02 ELTU from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
+ //printf(" QE01 ELTU from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
+
+ // Vertical collimator jaws (defined ONLY if fVCollAperture<3.5!)
+ if(fVCollAperture<3.5){
+ boxpar[0] = 5.4/2.;
+ boxpar[1] = (3.5-fVCollAperture-fVCollCentreY-0.7)/2.;
+ if(boxpar[1]<0.) boxpar[1]=0.;
+ boxpar[2] = 124.4/2.;
+ printf("\n AliZDCv3 -> Setting VCollimator jaw: aperture %1.2f center %1.2f mod.thickness %1.3f\n\n",
+ 2*fVCollAperture,fVCollCentreY,2*boxpar[1]);
+ gMC->Gsvolu("QCVC" , "BOX ", idtmed[13], boxpar, 3);
+ gMC->Gspos("QCVC", 1, "QE02", -boxpar[0], fVCollAperture+fVCollCentreY+boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");
+ gMC->Gspos("QCVC", 2, "QE02", -boxpar[0], -fVCollAperture+fVCollCentreY-boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");
+ }
zd1 += tubpar[2] * 2.;
gMC->Gsvolu("QT05", "TUBE", idtmed[7], tubpar, 3);
gMC->Gspos("QT05", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
// Ch.debug
- printf(" QT05 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
+ //printf(" QT05 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
zd1 += 2.*tubpar[2];
gMC->Gsvolu("QC08", "CONE", idtmed[7], conpar, 5);
gMC->Gspos("QC08", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
// Ch.debug
- printf(" QC08 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
+ //printf(" QC08 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
zd1 += 2.*conpar[0];
zd1 += 2.*tubpar[2];
// Ch.debug
- printf(" Beginning of VCTYB volume @ z = %f \n",-zd1);
+ //printf(" Beginning of VCTYB volume @ z = %1.2f \n",-zd1);
// simulation of the trousers (VCTYB)
tubpar[0] = 19.6/2.;
TGeoCompositeShape *pOutTrousersC = new TGeoCompositeShape("outTrousersC", "QCLext:ZDCC_c1+QCLext:ZDCC_c2");
// Volume: QCLext
- TGeoMedium *medZDCFe = gGeoManager->GetMedium("ZDC_ZIRON");
+ TGeoMedium *medZDCFe = gGeoManager->GetMedium("ZDC_ZIRONT");
TGeoVolume *pQCLext = new TGeoVolume("QCLext",pOutTrousersC, medZDCFe);
pQCLext->SetLineColor(kGreen);
pQCLext->SetVisLeaves(kTRUE);
// -- Luminometer (Cu box) in front of ZN - side C
boxpar[0] = 8.0/2.;
boxpar[1] = 8.0/2.;
- boxpar[2] = 15./2.;
- gMC->Gsvolu("QLUC", "BOX ", idtmed[6], boxpar, 3);
+ boxpar[2] = fLumiLength/2.;
+ gMC->Gsvolu("QLUC", "BOX ", idtmed[9], boxpar, 3);
gMC->Gspos("QLUC", 1, "ZDCC", 0., 0., fPosZNC[2]+66.+boxpar[2], 0, "ONLY");
//printf(" QLUC LUMINOMETER from z = %1.2f to z= %1.2f\n", fPosZNC[2]+66., fPosZNC[2]+66.+2*boxpar[2]);
//printf(" QA07 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
gMC->Gspos("QA06", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
gMC->Gspos("QA07", 1, "QA06", 0., 0., 0., 0, "ONLY");
-
+
+ // Vertical collimator jaws (defined ONLY if fVCollAperture<3.5!)
+ if(fVCollAperture<3.5){
+ boxpar[0] = 5.4/2.;
+ boxpar[1] = (3.5-fVCollAperture-fVCollCentreY-0.7)/2.;
+ if(boxpar[1]<0.) boxpar[1]=0.;
+ boxpar[2] = 124.4/2.;
+ gMC->Gsvolu("QCVA" , "BOX ", idtmed[13], boxpar, 3);
+ gMC->Gspos("QCVA", 1, "QA07", -boxpar[0], fVCollAperture+fVCollCentreY+boxpar[1], -313.3/2.+78.+148./2., 0, "ONLY");
+ gMC->Gspos("QCVA", 2, "QA07", -boxpar[0], -fVCollAperture+fVCollCentreY-boxpar[1], -313.3/2.+78.+148./2., 0, "ONLY");
+ }
+
zd2 += 2.*tubpar[2];
// VCTCP second part: transition cone from ID=180 to ID=212.7
gMC->Gsvolu("QA14", "TUBE", idtmed[7], tubpar, 3);
gMC->Gspos("QA14", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
// Ch.debug
- printf(" QA14 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
+ //printf(" QA14 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
zd2 += 2.*tubpar[2];
// -- Luminometer (Cu box) in front of ZN - side A
boxpar[0] = 8.0/2.;
boxpar[1] = 8.0/2.;
- boxpar[2] = 15./2.;
- gMC->Gsvolu("QLUA", "BOX ", idtmed[6], boxpar, 3);
+ boxpar[2] = fLumiLength/2.;
+ gMC->Gsvolu("QLUA", "BOX ", idtmed[9], boxpar, 3);
gMC->Gspos("QLUA", 1, "ZDCA", 0., 0., fPosZNA[2]-66.-boxpar[2], 0, "ONLY");
//printf(" QLUA LUMINOMETER from z = %1.2f to z= %1.2f\n\n", fPosZNA[2]-66., fPosZNA[2]-66.-2*boxpar[2]);
// --- Lead
ubuf[0] = 1.12;
- AliMaterial(5, "LEAD", 207.19, 82., 11.35, .56, 18.5, ubuf, 1);
+ AliMaterial(5, "LEAD", 207.19, 82., 11.35, .56, 0., ubuf, 1);
// --- Copper (energy loss taken into account)
ubuf[0] = 1.10;
AliMaterial(6, "COPP0", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
+
+ // --- Copper
+ ubuf[0] = 1.10;
+ AliMaterial(9, "COPP1", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
// --- Iron (energy loss taken into account)
ubuf[0] = 1.1;
// --- Iron (no energy loss)
ubuf[0] = 1.1;
AliMaterial(8, "IRON1", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
+
+ // --- Tatalum
+ ubuf[0] = 1.1;
+ AliMaterial(13, "TANT", 183.84, 74., 19.3, 0.35, 0., ubuf, 1);
// ---------------------------------------------------------
Float_t aResGas[3]={1.008,12.0107,15.9994};
// --- Fibers (SiO2) = 3 ;
// --- Fibers (SiO2) = 4 ;
// --- Lead = 5 ;
- // --- Copper (with energy loss)= 6 ;
- // --- Copper (with energy loss)= 13 ;
+ // --- Copper (with high thr.)= 6 ;
+ // --- Copper (with low thr.)= 9;
// --- Iron (with energy loss) = 7 ;
// --- Iron (without energy loss) = 8 ;
// --- Vacuum (no field) = 10
Int_t ifield =2; // IFIELD=2 -> magnetic field defined in AliMagFC.h
// *****************************************************
- AliMedium(1, "ZTANT", 1, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
+ AliMedium(1, "ZWALL", 1, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
AliMedium(2, "ZBRASS",2, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
AliMedium(3, "ZSIO2", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
AliMedium(4, "ZQUAR", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
AliMedium(6, "ZCOPP", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
AliMedium(7, "ZIRON", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
AliMedium(8, "ZIRONN",8, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
+ AliMedium(9, "ZCOPL", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
AliMedium(10,"ZVOID",10, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(12,"ZAIR", 12, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
- //
AliMedium(11,"ZVOIM",11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
-
+ AliMedium(12,"ZAIR", 12, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
+ AliMedium(13,"ZTANT",13, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
+ AliMedium(14, "ZIRONT", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
}
Int_t *idtmed = fIdtmed->GetArray();
Int_t i;
// Thresholds for showering in the ZDCs
- i = 1; //tantalum
+ i = 1; //Wa lloy
gMC->Gstpar(idtmed[i], "CUTGAM", .001);
gMC->Gstpar(idtmed[i], "CUTELE", .001);
gMC->Gstpar(idtmed[i], "CUTNEU", .01);
gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
+ // Thresholds for showering in the luminometer
+ i = 9; //copper
+ gMC->Gstpar(idtmed[i], "CUTGAM", .001);
+ gMC->Gstpar(idtmed[i], "CUTELE", .001);
+ gMC->Gstpar(idtmed[i], "CUTNEU", .01);
+ gMC->Gstpar(idtmed[i], "CUTHAD", .01);
+
// Avoid too detailed showering along the beam line
i = 7; //iron with energy loss (ZIRON)
gMC->Gstpar(idtmed[i], "CUTGAM", .1);
gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
// Avoid too detailed showering along the beam line
- i = 8; //iron with energy loss (ZIRONN)
+ i = 14; //iron with energy loss (ZIRONT)
+ gMC->Gstpar(idtmed[i], "CUTGAM", .001);
+ gMC->Gstpar(idtmed[i], "CUTELE", .001);
+ gMC->Gstpar(idtmed[i], "CUTNEU", .01);
+ gMC->Gstpar(idtmed[i], "CUTHAD", .01);
+
+ // Avoid too detailed showering along the beam line
+ i = 8; //iron without energy loss (ZIRONN)
+ gMC->Gstpar(idtmed[i], "CUTGAM", .1);
+ gMC->Gstpar(idtmed[i], "CUTELE", .1);
+ gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
+ gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
+
+ // Avoid too detailed showering along the beam line
+ i = 13; //collimator jaws (ZTANT)
gMC->Gstpar(idtmed[i], "CUTGAM", .1);
gMC->Gstpar(idtmed[i], "CUTELE", .1);
gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
gMC->Gstpar(idtmed[i], "HADR", 0.);
//
- fMedSensZN = idtmed[1]; // Sensitive volume: ZN passive material
- fMedSensZP = idtmed[2]; // Sensitive volume: ZP passive material
- fMedSensF1 = idtmed[3]; // Sensitive volume: fibres type 1
- fMedSensF2 = idtmed[4]; // Sensitive volume: fibres type 2
- fMedSensZEM = idtmed[5]; // Sensitive volume: ZEM passive material
- fMedSensTDI = idtmed[6]; // Sensitive volume: TDI Cu shield
- fMedSensPI = idtmed[7]; // Sensitive volume: beam pipes
- fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
+ fMedSensZN = idtmed[1]; // Sensitive volume: ZN passive material
+ fMedSensZP = idtmed[2]; // Sensitive volume: ZP passive material
+ fMedSensF1 = idtmed[3]; // Sensitive volume: fibres type 1
+ fMedSensF2 = idtmed[4]; // Sensitive volume: fibres type 2
+ fMedSensZEM = idtmed[5]; // Sensitive volume: ZEM passive material
+ fMedSensTDI = idtmed[6]; // Sensitive volume: TDI Cu shield
+ fMedSensPI = idtmed[7]; // Sensitive volume: beam pipes
+ fMedSensLumi = idtmed[9]; // Sensitive volume: luminometer
+ fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
+ fMedSensVColl = idtmed[13]; // Sensitive volume: collimator jaws
}
//_____________________________________________________________________________
return;
}
+ int read=1;
for(k=0; k<fNalfan; k++){
for(j=0; j<fNben; j++){
- fscanf(fp1,"%f",&fTablen[0][k][j]);
- fscanf(fp2,"%f",&fTablen[1][k][j]);
- fscanf(fp3,"%f",&fTablen[2][k][j]);
- fscanf(fp4,"%f",&fTablen[3][k][j]);
+ read = fscanf(fp1,"%f",&fTablen[0][k][j]);
+ if(read==0) AliDebug(3, " Error in reading light table 1");
+ read = fscanf(fp2,"%f",&fTablen[1][k][j]);
+ if(read==0) AliDebug(3, " Error in reading light table 2");
+ read = fscanf(fp3,"%f",&fTablen[2][k][j]);
+ if(read==0) AliDebug(3, " Error in reading light table 3");
+ read = fscanf(fp4,"%f",&fTablen[3][k][j]);
+ if(read==0) AliDebug(3, " Error in reading light table 4");
}
}
fclose(fp1);
for(k=0; k<fNalfap; k++){
for(j=0; j<fNbep; j++){
- fscanf(fp5,"%f",&fTablep[0][k][j]);
- fscanf(fp6,"%f",&fTablep[1][k][j]);
- fscanf(fp7,"%f",&fTablep[2][k][j]);
- fscanf(fp8,"%f",&fTablep[3][k][j]);
+ read = fscanf(fp5,"%f",&fTablep[0][k][j]);
+ if(read==0) AliDebug(3, " Error in reading light table 5");
+ read = fscanf(fp6,"%f",&fTablep[1][k][j]);
+ if(read==0) AliDebug(3, " Error in reading light table 6");
+ read = fscanf(fp7,"%f",&fTablep[2][k][j]);
+ if(read==0) AliDebug(3, " Error in reading light table 7");
+ read = fscanf(fp8,"%f",&fTablep[3][k][j]);
+ if(read==0) AliDebug(3, " Error in reading light table 8");
}
}
fclose(fp5);
// Routine called at every step in the Zero Degree Calorimeters
//
Int_t j, vol[2]={0,0}, ibeta=0, ialfa=0, ibe=0, nphe=0;
- Float_t hits[11], x[3], xdet[3], um[3], ud[3];
- Float_t m=0., ekin=0., destep=0., be=0., out=0.;
- // Parametrization for light guide uniformity
- // NEW!!! Light guide tilted @ 51 degrees
- Float_t guiPar[4]={0.31,-0.0006305,0.01337,0.8895};
+ Float_t hits[13], x[3], xdet[3], um[3], ud[3];
+ Float_t destep=0., be=0., out=0.;
Double_t s[3], p[3];
const char *knamed;
//
- for(j=0;j<11;j++) hits[j]=-999.;
+ for(j=0;j<13;j++) hits[j]=-999.;
//
- // --- This part is for no shower developement in beam pipe and TDI
- // If particle interacts with beam pipe or TDI -> return
- if((gMC->CurrentMedium() == fMedSensPI) || (gMC->CurrentMedium() == fMedSensTDI)){
+ // --- This part is for no shower developement in beam pipe, TDI, VColl
+ // If particle interacts with beam pipe, TDI, VColl -> return
+ if(fNoShower==1 && ((gMC->CurrentMedium() == fMedSensPI) || (gMC->CurrentMedium() == fMedSensTDI) ||
+ (gMC->CurrentMedium() == fMedSensVColl || (gMC->CurrentMedium() == fMedSensLumi)))){
+
// If option NoShower is set -> StopTrack
+
Int_t ipr = 0;
- if(fNoShower==1){
gMC->TrackPosition(s[0],s[1],s[2]);
if(gMC->CurrentMedium() == fMedSensPI){
knamed = gMC->CurrentVolName();
else fpLostD1A += 1;
ipr=1;
}
- else if(!strncmp(knamed,"QAL",3)) fnTrou++;
}
else if(gMC->CurrentMedium() == fMedSensTDI){
knamed = gMC->CurrentVolName();
ipr=1;
}
else if(!strncmp(knamed,"QTD",3)) fpLostTDI += 1;
- else if(!strncmp(knamed,"QLU",3)){
- if(s[2]<0) fnLumiC ++;
- else fnLumiA++;
- ipr=1;
- }
+ }
+ else if(gMC->CurrentMedium() == fMedSensVColl){
+ knamed = gMC->CurrentVolName();
+ if(!strncmp(knamed,"QCVC",4)) fpcVCollC++;
+ else if(!strncmp(knamed,"QCVA",4)) fpcVCollA++;
+ ipr=1;
}
//
//gMC->TrackMomentum(p[0], p[1], p[2], p[3]);
if(ipr!=0){
printf("\n\t **********************************\n");
printf("\t ********** Side C **********\n");
- printf("\t # of spectators in IT = %d\n",fpLostITC);
- printf("\t # of spectators in D1 = %d\n",fpLostD1C);
- printf("\t # of spectators in luminometer = %d\n",fnLumiC);
+ printf("\t # of particles in IT = %d\n",fpLostITC);
+ printf("\t # of particles in D1 = %d\n",fpLostD1C);
+ printf("\t # of particles in VColl = %d\n",fpcVCollC);
printf("\t ********** Side A **********\n");
- printf("\t # of spectators in IT = %d\n",fpLostITA);
- printf("\t # of spectators in D1 = %d\n",fpLostD1A);
- printf("\t # of spectators in TDI = %d\n",fpLostTDI);
- printf("\t # of spectators in luminometer = %d\n",fnLumiA);
- printf("\t # of spectators in trousers = %d\n",fnTrou);
+ printf("\t # of particles in IT = %d\n",fpLostITA);
+ printf("\t # of particles in D1 = %d\n",fpLostD1A);
+ printf("\t # of particles in TDI = %d\n",fpLostTDI);
+ printf("\t # of particles in VColl = %d\n",fpcVCollA);
printf("\t **********************************\n");
}
gMC->StopTrack();
- }
- return;
+ return;
}
-
if((gMC->CurrentMedium() == fMedSensZN) || (gMC->CurrentMedium() == fMedSensZP) ||
(gMC->CurrentMedium() == fMedSensGR) || (gMC->CurrentMedium() == fMedSensF1) ||
(gMC->CurrentMedium() == fMedSensF2) || (gMC->CurrentMedium() == fMedSensZEM)){
if(xdet[1]<=0.) vol[1]=2;
else vol[1]=4;
}
- if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
- printf(" ZDC StepManager->ERROR in ZN!!! vol[1] = %d, xdet[0] = %f,"
- "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
}
else if(vol[0]==2){ //Quadrant in ZPC
break;
}
}
- if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
- printf(" ZDC StepManager->ERROR in ZP!!! vol[1] = %d, xdet[0] = %f,"
- "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
}
//
// Quadrant in ZEM: vol[1] = 1 -> particle in 1st ZEM (placed at x = 8.5 cm)
if(xdet[1]<=0.) vol[1]=2;
else vol[1]=4;
}
- if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
- printf(" ZDC StepManager->ERROR in ZNA!!! vol[1] = %d, xdet[0] = %f,"
- "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
}
//
else if(vol[0]==5){ //Quadrant in ZPA
break;
}
}
- if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
- printf(" ZDC StepManager->ERROR in ZPA!!! vol[1] = %d, xdet[0] = %f,"
- "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
}
+ if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
+ AliError(Form(" WRONG tower for det %d: tow %d with xdet=(%f, %f)\n",
+ vol[0], vol[1], xdet[0], xdet[1]));
+ // Ch. debug
+ //printf("\t *** det %d vol %d xdet(%f, %f)\n",vol[0], vol[1], xdet[0], xdet[1]);
- // Store impact point and kinetic energy of the ENTERING particle
+ // Store impact point and kinetic energy of the ENTERING particle
- if(gMC->IsTrackEntering()){
- //Particle energy
- gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
- hits[3] = p[3];
- // Impact point on ZDC
+ if(gMC->IsTrackEntering()){
+ //Particle energy
+ gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
+ hits[3] = p[3];
+
+ // Impact point on ZDC
+ // X takes into account the LHC x-axis sign
+ // which is opposite to positive x on detector front face
+ // for side A detectors (ZNA and ZPA)
+ if(vol[0]==4 || vol[0]==5){
+ hits[4] = -xdet[0];
+ }
+ else{
hits[4] = xdet[0];
- hits[5] = xdet[1];
- hits[6] = 0;
- hits[7] = 0;
- hits[8] = 0;
- hits[9] = 0;
- //
- Int_t curTrackN = gAlice->GetMCApp()->GetCurrentTrackNumber();
- TParticle *part = (gAlice->GetMCApp())->Particle(curTrackN);
- hits[10] = part->GetPdgCode();
- //printf("\t PDGCode = %d\n", part->GetPdgCode());
-
- AddHit(curTrackN, vol, hits);
-
- if(fNoShower==1){
- //printf("\t VolName %s -> det %d quad %d - x = %f, y = %f, z = %f\n",
- //knamed, vol[0], vol[1], x[0], x[1], x[2]);
- if(vol[0]==1){
- fnDetectedC += 1;
- printf(" # of particles in ZNC = %d\n\n",fnDetectedC);
- }
- else if(vol[0]==2){
- fpDetectedC += 1;
- printf(" # of particles in ZPC = %d\n\n",fpDetectedC);
- }
- else if(vol[0]==4){
- fnDetectedA += 1;
- printf(" # of particles in ZNA = %d\n\n",fnDetectedA);
- }
- else if(vol[0]==5){
- fpDetectedA += 1;
- printf(" # of particles in ZPA = %d\n\n",fpDetectedA);
- }
- //
- //printf("\t Particle: mass = %1.3f, E = %1.3f GeV, pz = %1.2f GeV -> stopped in volume %s\n",
- // gMC->TrackMass(), p[3], p[2], gMC->CurrentVolName());
- //
- gMC->StopTrack();
- return;
- }
}
-
- // Charged particles -> Energy loss
- if((destep=gMC->Edep())){
- if(gMC->IsTrackStop()){
- gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
- m = gMC->TrackMass();
- ekin = p[3]-m;
- hits[9] = ekin;
- hits[7] = 0.;
- hits[8] = 0.;
- AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
- }
- else{
- hits[9] = destep;
- hits[7] = 0.;
- hits[8] = 0.;
- AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
- }
+ hits[5] = xdet[1];
+ hits[6] = 0;
+ hits[7] = 0;
+ hits[8] = 0;
+ hits[9] = 0;
+ //
+ Int_t curTrackN = gAlice->GetMCApp()->GetCurrentTrackNumber();
+ TParticle *part = gAlice->GetMCApp()->Particle(curTrackN);
+ hits[10] = part->GetPdgCode();
+ //printf("\t PDGCode = %d\n", part->GetPdgCode());
+ //
+ Int_t imo = part->GetFirstMother();
+ if(imo>0){
+ TParticle * pmot = gAlice->GetMCApp()->Particle(imo);
+ hits[11] = pmot->GetPdgCode();
+ }
+ else hits[11]=0;
+ //
+ hits[12] = 1.0e09*gMC->TrackTime(); // in ns!
+ //printf("\t TrackTime = %f\n", hits[12]);
+
+ AddHit(curTrackN, vol, hits);
+
+ if(fNoShower==1){
+ if(vol[0]==1){
+ fnDetectedC += 1;
+ if(fnDetectedC==1) printf(" ### Particle in ZNC\n\n");
+ }
+ else if(vol[0]==2){
+ fpDetectedC += 1;
+ if(fpDetectedC==1) printf(" ### Particle in ZPC\n\n");
+ }
+ else if(vol[0]==4){
+ fnDetectedA += 1;
+ if(fnDetectedA==1) printf(" ### Particle in ZNA\n\n");
+ }
+ else if(vol[0]==5){
+ fpDetectedA += 1;
+ if(fpDetectedA==1) printf(" ### Particle in ZPA\n\n");
+ }
+ //
+ //printf("\t Pc: x %1.2f y %1.2f z %1.2f E %1.2f GeV pz = %1.2f GeV in volume %s\n",
+ // x[0],x[1],x[3],p[3],p[2],gMC->CurrentVolName());
+ //
+ gMC->StopTrack();
+ return;
}
+ }
+
+ // Particle energy loss
+ if(gMC->Edep() != 0){
+ hits[9] = gMC->Edep();
+ hits[7] = 0.;
+ hits[8] = 0.;
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
+ }
}
}
ibe = Int_t(be*1000.+1);
- //if((vol[0]==1)) radius = fFibZN[1];
- //else if((vol[0]==2)) radius = fFibZP[1];
-
+
//Looking into the light tables
Float_t charge = gMC->TrackCharge();
Float_t z = -xalic[2]+fPosZEM[2]+2*fZEMLength-xalic[1];
//z = xalic[2]-fPosZEM[2]-fZEMLength-xalic[1]*(TMath::Tan(45.*kDegrad));
//printf(" fPosZEM[2]+2*fZEMLength = %f", fPosZEM[2]+2*fZEMLength);
+ //
+ // Parametrization for light guide uniformity
+ // NEW!!! Light guide tilted @ 51 degrees
+ Float_t guiPar[4]={0.31,-0.0006305,0.01337,0.8895};
Float_t guiEff = guiPar[0]*(guiPar[1]*z*z+guiPar[2]*z+guiPar[3]);
out = out*guiEff;
nphe = gRandom->Poisson(out);