#include "stdio.h"
// --- ROOT system
-#include <TBRIK.h>
-#include <TLorentzVector.h>
#include <TMath.h>
-#include <TNode.h>
#include <TRandom.h>
#include <TSystem.h>
#include <TTree.h>
#include <TVirtualMC.h>
+#include <TGeoManager.h>
// --- AliRoot classes
#include "AliConst.h"
-#include "AliDetector.h"
#include "AliMagF.h"
-#include "AliPDG.h"
#include "AliRun.h"
-#include "AliZDCHit.h"
#include "AliZDCv2.h"
#include "AliMC.h"
+class AliZDCHit;
+class AliPDG;
+class AliDetector;
ClassImp(AliZDCv2)
//_____________________________________________________________________________
-AliZDCv2::AliZDCv2() : AliZDC()
+AliZDCv2::AliZDCv2() :
+ AliZDC(),
+ fMedSensF1(0),
+ fMedSensF2(0),
+ fMedSensZP(0),
+ fMedSensZN(0),
+ fMedSensZEM(0),
+ fMedSensGR(0),
+ fMedSensPI(0),
+ fMedSensTDI(0),
+ fNalfan(0),
+ fNalfap(0),
+ fNben(0),
+ fNbep(0),
+ fZEMLength(0),
+ fpLostIT(0),
+ fpLostD1(0),
+ fpLostTDI(0),
+ fpDetected(0),
+ fnDetected(0)
{
//
// Default constructor for Zero Degree Calorimeter
//
- fMedSensF1 = 0;
- fMedSensF2 = 0;
- fMedSensZN = 0;
- fMedSensZP = 0;
- fMedSensZEM = 0;
- fMedSensGR = 0;
-
}
//_____________________________________________________________________________
AliZDCv2::AliZDCv2(const char *name, const char *title)
- : AliZDC(name,title)
+ : AliZDC(name,title),
+ fMedSensF1(0),
+ fMedSensF2(0),
+ fMedSensZP(0),
+ fMedSensZN(0),
+ fMedSensZEM(0),
+ fMedSensGR(0),
+ fMedSensPI(0),
+ fMedSensTDI(0),
+ fNalfan(90),
+ fNalfap(90),
+ fNben(18),
+ fNbep(28),
+ fZEMLength(0),
+ fpLostIT(0),
+ fpLostD1(0),
+ fpLostTDI(0),
+ fpDetected(0),
+ fnDetected(0)
+
+
{
//
// Standard constructor for Zero Degree Calorimeter
fPosZEM[0] = 8.5;
fPosZEM[1] = 0.;
fPosZEM[2] = 735.;
- fZEMLength = 0.;
-
+
+ Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
+ Float_t kDimZEMAir = 0.001; // scotch
+ Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
+ Int_t kDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
+ Float_t kDimZEM0 = 2*kDivZEM[2]*(kDimZEMPb+kDimZEMAir+kFibRadZEM*(TMath::Sqrt(2.)));
+ fZEMLength = kDimZEM0;
+
}
//_____________________________________________________________________________
// -- ROTATE PIPES
Float_t angle = 0.143*kDegrad; // Rotation angle
- AliMatrix(im1, 90.+0.143, 0., 90., 90., 0.143, 180.); // x<0
+ //AliMatrix(im1, 90.+0.143, 0., 90., 90., 0.143, 0.); // x<0
+ gMC->Matrix(im1, 90.+0.143, 0., 90., 90., 0.143, 0.); // x<0
gMC->Gspos("QT17", 1, "ZDC ", TMath::Sin(angle) * 680.8/ 2. - 9.4,
0., -tubpar[2]-zd1, im1, "ONLY");
- AliMatrix(im2, 90.-0.143, 0., 90., 90., 0.143, 0.); // x>0 (ZP)
+ //AliMatrix(im2, 90.-0.143, 0., 90., 90., 0.143, 180.); // x>0 (ZP)
+ gMC->Matrix(im2, 90.-0.143, 0., 90., 90., 0.143, 180.); // x>0 (ZP)
gMC->Gspos("QT18", 1, "ZDC ", 9.7 - TMath::Sin(angle) * 680.8 / 2.,
0., -tubpar[2]-zd1, im2, "ONLY");
tubpar[0] = 4.5;
tubpar[1] = 55.;
tubpar[2] = 170./2.;
- gMC->Gsvolu("YMBX", "TUBE", idtmed[7], tubpar, 3);
+ gMC->Gsvolu("YMBX", "TUBE", idtmed[13], tubpar, 3);
gMC->Gspos("MBXW", 1, "ZDC ", 0., 0., -tubpar[2]-zc, 0, "ONLY");
gMC->Gspos("YMBX", 1, "ZDC ", 0., 0., -tubpar[2]-zc, 0, "ONLY");
// -- MQXL
// -- GAP (VACUUM WITH MAGNETIC FIELD)
tubpar[0] = 0.;
- tubpar[1] = 4.5;
- tubpar[2] = 170./2.;
- gMC->Gsvolu("MCBW", "TUBE", idtmed[11], tubpar, 3);
+ tubpar[1] = 3.5;
+ tubpar[2] = 637./2.;
+ gMC->Gsvolu("MQXL", "TUBE", idtmed[11], tubpar, 3);
+
// -- YOKE
tubpar[0] = 3.5;
// Parameters for EM calorimeter geometry
// NB -> parameters used ONLY in CreateZDC()
- Float_t fDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
- Float_t fDimZEMAir = 0.001; // scotch
- Float_t fFibRadZEM = 0.0315; // External fiber radius (including cladding)
+ Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
+ Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
Int_t fDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
- Float_t fDimZEM0 = 2*fDivZEM[2]*(fDimZEMPb+fDimZEMAir+fFibRadZEM*(TMath::Sqrt(2.)));
- fZEMLength = fDimZEM0;
- Float_t fDimZEM[6] = {fDimZEM0, 3.5, 3.5, 45., 0., 0.}; // Dimensions of EM detector
- Float_t fFibZEM2 = fDimZEM[2]/TMath::Sin(fDimZEM[3]*kDegrad)-fFibRadZEM;
+ Float_t fDimZEM[6] = {fZEMLength, 3.5, 3.5, 45., 0., 0.}; // Dimensions of EM detector
+ Float_t fFibZEM2 = fDimZEM[2]/TMath::Sin(fDimZEM[3]*kDegrad)-kFibRadZEM;
Float_t fFibZEM[3] = {0., 0.0275, fFibZEM2}; // Fibers for EM calorimeter
gMC->Gspos("ZNF4", 1, "ZNG4", 0., 0., 0., 0, "ONLY");
// --- Position the neutron calorimeter in ZDC
- gMC->Gspos("ZNEU", 1, "ZDC ", fPosZN[0], fPosZN[1], fPosZN[2]-fDimZN[2], 0, "ONLY");
+ // -- Rotation of ZDCs
+ Int_t irotzdc;
+ gMC->Matrix(irotzdc, 90., 180., 90., 90., 180., 0.);
+ //
+ gMC->Gspos("ZNEU", 1, "ZDC ", fPosZN[0], fPosZN[1], fPosZN[2]-fDimZN[2], irotzdc, "ONLY");
//Ch debug
//printf("\n ZN -> %f < z < %f cm\n",fPosZN[2],fPosZN[2]-2*fDimZN[2]);
// --- Position the proton calorimeter in ZDC
- gMC->Gspos("ZPRO", 1, "ZDC ", fPosZP[0], fPosZP[1], fPosZP[2]-fDimZP[2], 0, "ONLY");
+ gMC->Gspos("ZPRO", 1, "ZDC ", fPosZP[0], fPosZP[1], fPosZP[2]-fDimZP[2], irotzdc, "ONLY");
//Ch debug
//printf("\n ZP -> %f < z < %f cm\n",fPosZP[2],fPosZP[2]-2*fDimZP[2]);
gMC->Gsdvn("ZETR", "ZEM ", fDivZEM[2], 1); // Tranches
- dimPb[0] = fDimZEMPb; // Lead slices
+ dimPb[0] = kDimZEMPb; // Lead slices
dimPb[1] = fDimZEM[2];
dimPb[2] = fDimZEM[1];
//dimPb[3] = fDimZEM[3]; //controllare
// --- Position the lead slices in the tranche
Float_t zTran = fDimZEM[0]/fDivZEM[2];
- Float_t zTrPb = -zTran+fDimZEMPb;
+ Float_t zTrPb = -zTran+kDimZEMPb;
gMC->Gspos("ZEL0", 1, "ZETR", zTrPb, 0., 0., 0, "ONLY");
- gMC->Gspos("ZEL1", 1, "ZETR", fDimZEMPb, 0., 0., 0, "ONLY");
+ gMC->Gspos("ZEL1", 1, "ZETR", kDimZEMPb, 0., 0., 0, "ONLY");
// --- Vacuum zone (to be filled with fibres)
- dimVoid[0] = (zTran-2*fDimZEMPb)/2.;
+ dimVoid[0] = (zTran-2*kDimZEMPb)/2.;
dimVoid[1] = fDimZEM[2];
dimVoid[2] = fDimZEM[1];
dimVoid[3] = 90.-fDimZEM[3];
gMC->Gspos("ZEM ", 2,"ALIC", fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
// --- Adding last slice at the end of the EM calorimeter
- Float_t zLastSlice = fPosZEM[2]+fDimZEMPb+2*fDimZEM[0];
+ Float_t zLastSlice = fPosZEM[2]+kDimZEMPb+2*fDimZEM[0];
gMC->Gspos("ZEL2", 1,"ALIC", fPosZEM[0], fPosZEM[1], zLastSlice, irot1, "ONLY");
//Ch debug
//printf("\n ZEM lenght = %f cm\n",2*fZEMLength);
- //printf("\n ZEM -> %f < z < %f cm\n",fPosZEM[2],fPosZEM[2]+2*fZEMLength+zLastSlice+fDimZEMPb);
+ //printf("\n ZEM -> %f < z < %f cm\n",fPosZEM[2],fPosZEM[2]+2*fZEMLength+zLastSlice+kDimZEMPb);
}
// Create Materials for the Zero Degree Calorimeter
//
- Int_t *idtmed = fIdtmed->GetArray();
-
- Float_t dens, ubuf[1], wmat[2], a[2], z[2], deemax = -1;
- Int_t i;
+ Float_t dens, ubuf[1], wmat[2], a[2], z[2];
// --- Store in UBUF r0 for nuclear radius calculation R=r0*A**1/3
// --- Iron (energy loss taken into account)
ubuf[0] = 1.1;
- AliMaterial(7, "IRON", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
+ AliMaterial(7, "IRON0", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
// --- Iron (no energy loss)
ubuf[0] = 1.1;
- AliMaterial(8, "IRON", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
-
+ AliMaterial(8, "IRON1", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
+ AliMaterial(13, "IRON2", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
+
+ // ---------------------------------------------------------
+ Float_t aResGas[3]={1.008,12.0107,15.9994};
+ Float_t zResGas[3]={1.,6.,8.};
+ Float_t wResGas[3]={0.28,0.28,0.44};
+ Float_t dResGas = 3.2E-14;
+
// --- Vacuum (no magnetic field)
- AliMaterial(10, "VOID", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf,0);
+ AliMixture(10, "VOID", aResGas, zResGas, dResGas, 3, wResGas);
+ //AliMaterial(10, "VOID", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf,0);
// --- Vacuum (with magnetic field)
- AliMaterial(11, "VOIM", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf,0);
+ AliMixture(11, "VOIM", aResGas, zResGas, dResGas, 3, wResGas);
+ //AliMaterial(11, "VOIM", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf,0);
// --- Air (no magnetic field)
- AliMaterial(12, "Air $", 14.61, 7.3, .001205, 30420., 67500., ubuf, 0);
+ Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
+ Float_t zAir[4]={6.,7.,8.,18.};
+ Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
+ Float_t dAir = 1.20479E-3;
+ //
+ AliMixture(12, "Air $", aAir, zAir, dAir, 4, wAir);
+ //AliMaterial(12, "Air $", 14.61, 7.3, .001205, 30420., 67500., ubuf, 0);
// --- Definition of tracking media:
// --- Vacuum (with field) = 11
// --- Air (no field) = 12
-
- // --- Tracking media parameters
- Float_t epsil = .01, stmin=0.01, stemax = 1.;
-// Int_t isxfld = gAlice->Field()->Integ();
- Float_t fieldm = 0., tmaxfd = 0.;
- Int_t ifield = 0, isvolActive = 1, isvol = 0, inofld = 0;
-
- AliMedium(1, "ZTANT", 1, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
-// AliMedium(1, "ZW", 1, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(2, "ZBRASS",2, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(3, "ZSIO2", 3, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(4, "ZQUAR", 3, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(5, "ZLEAD", 5, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
-// AliMedium(6, "ZCOPP", 6, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
-// AliMedium(7, "ZIRON", 7, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(6, "ZCOPP", 6, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(7, "ZIRON", 7, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(8, "ZIRONN",8, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(10,"ZVOID",10, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
- AliMedium(12,"ZAIR", 12, 0, inofld, fieldm, tmaxfd, stemax,deemax, epsil, stmin);
-
- ifield =2;
- fieldm = 45.;
- AliMedium(11, "ZVOIM", 11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
-
+ // ****************************************************
+ // Tracking media parameters
+ //
+ Float_t epsil = 0.01; // Tracking precision,
+ Float_t stmin = 0.01; // Min. value 4 max. step (cm)
+ Float_t stemax = 1.; // Max. step permitted (cm)
+ Float_t tmaxfd = 0.; // Maximum angle due to field (degrees)
+ Float_t deemax = -1.; // Maximum fractional energy loss
+ Float_t nofieldm = 0.; // Max. field value (no field)
+ Float_t fieldm = 45.; // Max. field value (with field)
+ Int_t isvol = 0; // ISVOL =0 -> not sensitive volume
+ Int_t isvolActive = 1; // ISVOL =1 -> sensitive volume
+ Int_t inofld = 0; // IFIELD=0 -> no magnetic field
+ 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(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(5, "ZLEAD", 5, 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(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(13,"ZIRONE",13, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
+}
+
+//_____________________________________________________________________________
+void AliZDCv2::AddAlignableVolumes() const
+{
+ //
+ // Create entries for alignable volumes associating the symbolic volume
+ // name with the corresponding volume path. Needs to be syncronized with
+ // eventual changes in the geometry.
+ //
+ TString volpath1 = "ALIC_1/ZDC_1/ZNEU_1";
+ TString volpath2 = "ALIC_1/ZDC_1/ZPRO_1";
+
+ TString symname1="ZDC/NeutronZDC";
+ TString symname2="ZDC/ProtonZDC";
+
+ if(!gGeoManager->SetAlignableEntry(symname1.Data(),volpath1.Data()))
+ AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
+
+ if(!gGeoManager->SetAlignableEntry(symname2.Data(),volpath2.Data()))
+ AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
+}
+
+//_____________________________________________________________________________
+void AliZDCv2::Init()
+{
+ InitTables();
+ Int_t *idtmed = fIdtmed->GetArray();
+ Int_t i;
// Thresholds for showering in the ZDCs
i = 1; //tantalum
gMC->Gstpar(idtmed[i], "CUTGAM", .001);
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; //iron with 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 interaction in fibers (only energy loss allowed)
i = 3; //fibers (ZSI02)
fMedSensTDI = idtmed[6]; // Sensitive volume: TDI Cu shield
fMedSensPI = idtmed[7]; // Sensitive volume: beam pipes
fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
-}
-
-//_____________________________________________________________________________
-void AliZDCv2::Init()
-{
- InitTables();
}
//_____________________________________________________________________________
FILE *fp1, *fp2, *fp3, *fp4, *fp5, *fp6, *fp7, *fp8;
// --- Reading light tables for ZN
- lightfName1 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362207s");
+ lightfName1 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362207s");
if((fp1 = fopen(lightfName1,"r")) == NULL){
printf("Cannot open file fp1 \n");
return;
}
- lightfName2 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362208s");
+ lightfName2 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362208s");
if((fp2 = fopen(lightfName2,"r")) == NULL){
printf("Cannot open file fp2 \n");
return;
}
- lightfName3 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362209s");
+ lightfName3 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362209s");
if((fp3 = fopen(lightfName3,"r")) == NULL){
printf("Cannot open file fp3 \n");
return;
}
- lightfName4 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362210s");
+ lightfName4 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362210s");
if((fp4 = fopen(lightfName4,"r")) == NULL){
printf("Cannot open file fp4 \n");
return;
fclose(fp4);
// --- Reading light tables for ZP and ZEM
- lightfName5 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552207s");
+ lightfName5 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552207s");
if((fp5 = fopen(lightfName5,"r")) == NULL){
printf("Cannot open file fp5 \n");
return;
}
- lightfName6 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552208s");
+ lightfName6 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552208s");
if((fp6 = fopen(lightfName6,"r")) == NULL){
printf("Cannot open file fp6 \n");
return;
}
- lightfName7 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552209s");
+ lightfName7 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552209s");
if((fp7 = fopen(lightfName7,"r")) == NULL){
printf("Cannot open file fp7 \n");
return;
}
- lightfName8 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552210s");
+ lightfName8 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552210s");
if((fp8 = fopen(lightfName8,"r")) == NULL){
printf("Cannot open file fp8 \n");
return;
//
Int_t j, vol[2], ibeta=0, ialfa, ibe, nphe;
- Float_t x[3], xdet[3], destep, hits[10], m, ekin, um[3], ud[3], be, radius, out;
+ Float_t x[3], xdet[3], destep, hits[10], m, ekin, um[3], ud[3], be, out;
+ //Float_t radius;
Float_t xalic[3], z, guiEff, guiPar[4]={0.31,-0.0004,0.0197,0.7958};
- TLorentzVector s, p;
+ Double_t s[3], p[4];
const char *knamed;
- for (j=0;j<10;j++) hits[j]=999.;
+ for (j=0;j<10;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->GetMedium() == fMedSensPI) || (gMC->GetMedium() == fMedSensTDI)){
+ if((gMC->CurrentMedium() == fMedSensPI) || (gMC->CurrentMedium() == fMedSensTDI)){
// If option NoShower is set -> StopTrack
if(fNoShower==1) {
- if(gMC->GetMedium() == fMedSensPI) {
+ if(gMC->CurrentMedium() == fMedSensPI) {
knamed = gMC->CurrentVolName();
- // Ch debug
- printf("\t fMedSensPI -> medium: %d, Volume: %s \n",gMC->GetMedium(),knamed);
- if(!strncmp(knamed,"YM", 2)) fpLostIT += 1;
- if(!strncmp(knamed,"YD1",2)) fpLostD1 += 1;
+ if(!strncmp(knamed,"YMQ",3)) fpLostIT += 1;
+ if(!strncmp(knamed,"YD1",3)) fpLostD1 += 1;
}
- else if(gMC->GetMedium() == fMedSensTDI){ // NB->Cu = TDI or D1 vacuum chamber
+ else if(gMC->CurrentMedium() == fMedSensTDI){ // NB->Cu = TDI or D1 vacuum chamber
knamed = gMC->CurrentVolName();
- // Ch debug
- printf("\t fMedSensTDI -> medium: %d, Volume: %s \n",gMC->GetMedium(),knamed);
if(!strncmp(knamed,"MD1",3)) fpLostD1 += 1;
if(!strncmp(knamed,"QTD",3)) fpLostTDI += 1;
}
- printf("\n # of p lost in Inner Triplet = %d\n",fpLostIT);
- printf("\n # of p lost in D1 = %d\n",fpLostD1);
- printf("\n # of p lost in TDI = %d\n\n",fpLostTDI);
+ printf("\n # of spectators lost in IT = %d\n",fpLostIT);
+ printf("\n # of spectators lost in D1 = %d\n",fpLostD1);
+ printf("\n # of spectators lost in TDI = %d\n\n",fpLostTDI);
gMC->StopTrack();
}
return;
}
- if((gMC->GetMedium() == fMedSensZN) || (gMC->GetMedium() == fMedSensZP) ||
- (gMC->GetMedium() == fMedSensGR) || (gMC->GetMedium() == fMedSensF1) ||
- (gMC->GetMedium() == fMedSensF2) || (gMC->GetMedium() == fMedSensZEM)){
+ if((gMC->CurrentMedium() == fMedSensZN) || (gMC->CurrentMedium() == fMedSensZP) ||
+ (gMC->CurrentMedium() == fMedSensGR) || (gMC->CurrentMedium() == fMedSensF1) ||
+ (gMC->CurrentMedium() == fMedSensF2) || (gMC->CurrentMedium() == fMedSensZEM)){
//Particle coordinates
- gMC->TrackPosition(s);
- for(j=0; j<=2; j++){
- x[j] = s[j];
- }
+ gMC->TrackPosition(s[0],s[1],s[2]);
+ for(j=0; j<=2; j++) x[j] = s[j];
hits[0] = x[0];
hits[1] = x[1];
hits[2] = x[2];
// Determine in which ZDC the particle is
knamed = gMC->CurrentVolName();
- if(!strncmp(knamed,"ZN",2)){
- vol[0]=1;
- }
- else if(!strncmp(knamed,"ZP",2)){
- vol[0]=2;
- }
- else if(!strncmp(knamed,"ZE",2)){
- vol[0]=3;
- }
+ if(!strncmp(knamed,"ZN",2)) vol[0]=1;
+ else if(!strncmp(knamed,"ZP",2)) vol[0]=2;
+ else if(!strncmp(knamed,"ZE",2)) vol[0]=3;
// Determine in which quadrant the particle is
-
if(vol[0]==1){ //Quadrant in ZN
// Calculating particle coordinates inside ZN
xdet[0] = x[0]-fPosZN[0];
}
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",vol[1], xdet[0], xdet[1]);
+ "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)
// Store impact point and kinetic energy of the ENTERING particle
-// if(Curtrack==Prim){
if(gMC->IsTrackEntering()){
//Particle energy
- gMC->TrackMomentum(p);
+ gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
hits[3] = p[3];
// Impact point on ZDC
hits[4] = xdet[0];
AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
if(fNoShower==1){
- fpDetected += 1;
+ if(vol[0]==1) fnDetected += 1;
+ else if(vol[0]==2) fpDetected += 1;
+ printf("\n # of nucleons in ZN = %d",fnDetected);
+ printf("\n # of nucleons in ZP = %d\n\n",fpDetected);
gMC->StopTrack();
- if(vol[0]==2) printf("\n # of detected p = %d\n\n",fpDetected);
return;
}
}
-// } // Curtrack IF
// Charged particles -> Energy loss
if((destep=gMC->Edep())){
if(gMC->IsTrackStop()){
- gMC->TrackMomentum(p);
+ gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
m = gMC->TrackMass();
ekin = p[3]-m;
hits[9] = ekin;
AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
}
- }// NB -> Questa parentesi (chiude il primo IF) io la sposterei al fondo!???
+ }
// *** Light production in fibres
- if((gMC->GetMedium() == fMedSensF1) || (gMC->GetMedium() == fMedSensF2)){
+ if((gMC->CurrentMedium() == fMedSensF1) || (gMC->CurrentMedium() == fMedSensF2)){
//Select charged particles
if((destep=gMC->Edep())){
// Particle velocity
Float_t beta = 0.;
- gMC->TrackMomentum(p);
+ gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
Float_t ptot=TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
if(p[3] > 0.00001) beta = ptot/p[3];
else return;
- if(beta<0.67){
- return;
- }
- else if((beta>=0.67) && (beta<=0.75)){
- ibeta = 0;
- }
- if((beta>0.75) && (beta<=0.85)){
- ibeta = 1;
- }
- if((beta>0.85) && (beta<=0.95)){
- ibeta = 2;
- }
- if(beta>0.95){
- ibeta = 3;
- }
+ if(beta<0.67)return;
+ else if((beta>=0.67) && (beta<=0.75)) ibeta = 0;
+ else if((beta>0.75) && (beta<=0.85)) ibeta = 1;
+ else if((beta>0.85) && (beta<=0.95)) ibeta = 2;
+ else if(beta>0.95) ibeta = 3;
// Angle between particle trajectory and fibre axis
// 1 -> Momentum directions
Double_t alfar = TMath::ACos(ud[2]);
Double_t alfa = alfar*kRaddeg;
if(alfa>=110.) return;
+ //
ialfa = Int_t(1.+alfa/2.);
// Distance between particle trajectory and fibre axis
- gMC->TrackPosition(s);
+ gMC->TrackPosition(s[0],s[1],s[2]);
for(j=0; j<=2; j++){
x[j] = s[j];
}
be = TMath::Abs(ud[0]);
}
- if((vol[0]==1)){
- radius = fFibZN[1];
- }
- else if((vol[0]==2)){
- radius = fFibZP[1];
- }
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();
if(ibe>fNben) ibe=fNben;
out = charge*charge*fTablen[ibeta][ialfa][ibe];
nphe = gRandom->Poisson(out);
-// printf("ZN --- ibeta = %d, ialfa = %d, ibe = %d"
-// " -> out = %f, nphe = %d\n", ibeta, ialfa, ibe, out, nphe);
- if(gMC->GetMedium() == fMedSensF1){
+ // Ch. debug
+ //if(ibeta==3) printf("\t %f \t %f \t %f\n",alfa, be, out);
+ //printf("\t ibeta = %d, ialfa = %d, ibe = %d -> nphe = %d\n\n",ibeta,ialfa,ibe,nphe);
+ if(gMC->CurrentMedium() == fMedSensF1){
hits[7] = nphe; //fLightPMQ
hits[8] = 0;
hits[9] = 0;
if(ibe>fNbep) ibe=fNbep;
out = charge*charge*fTablep[ibeta][ialfa][ibe];
nphe = gRandom->Poisson(out);
-// printf("ZP --- ibeta = %d, ialfa = %d, ibe = %d"
-// " -> out = %f, nphe = %d\n", ibeta, ialfa, ibe, out, nphe);
- if(gMC->GetMedium() == fMedSensF1){
+ if(gMC->CurrentMedium() == fMedSensF1){
hits[7] = nphe; //fLightPMQ
hits[8] = 0;
hits[9] = 0;
else if((vol[0]==3)) { // (3) ZEM fibres
if(ibe>fNbep) ibe=fNbep;
out = charge*charge*fTablep[ibeta][ialfa][ibe];
- gMC->TrackPosition(s);
+ gMC->TrackPosition(s[0],s[1],s[2]);
for(j=0; j<=2; j++){
xalic[j] = s[j];
}
// z = xalic[2]-fPosZEM[2]-fZEMLength-xalic[1]*(TMath::Tan(45.*kDegrad));
// printf("\n fPosZEM[2]+2*fZEMLength = %f", fPosZEM[2]+2*fZEMLength);
guiEff = guiPar[0]*(guiPar[1]*z*z+guiPar[2]*z+guiPar[3]);
-// printf("\n xalic[0] = %f xalic[1] = %f xalic[2] = %f z = %f \n",
-// xalic[0],xalic[1],xalic[2],z);
out = out*guiEff;
nphe = gRandom->Poisson(out);
// printf(" out*guiEff = %f nphe = %d", out, nphe);
-// printf("ZEM --- ibeta = %d, ialfa = %d, ibe = %d"
-// " -> out = %f, nphe = %d\n", ibeta, ialfa, ibe, out, nphe);
if(vol[1] == 1){
hits[7] = 0;
hits[8] = nphe; //fLightPMC (ZEM1)