///////////////////////////////////////////////////////////////////////////////
// //
// Transition Radiation Detector version 2 -- detailed simulation //
// //
//Begin_Html
/*
*/
//End_Html
// //
// //
///////////////////////////////////////////////////////////////////////////////
#include
#include
#include
#include
#include
#include
#include "GParticle.h"
#include "AliTRDv2.h"
#include "AliRun.h"
#include "AliConst.h"
#include "AliMC.h"
ClassImp(AliTRDv2)
//_____________________________________________________________________________
AliTRDv2::AliTRDv2(const char *name, const char *title)
:AliTRD(name, title)
{
//
// Standard constructor for Transition Radiation Detector version 2
//
fIdSenO1 = fIdSenO2 = fIdSenO3 = fIdSenO4 = fIdSenO5 = fIdSenO6 = 0;
fIdSenI1 = fIdSenI2 = fIdSenI3 = fIdSenI4 = fIdSenI5 = fIdSenI6 = 0;
SetBufferSize(128000);
}
//_____________________________________________________________________________
void AliTRDv2::CreateGeometry()
{
//
// Create geometry for the Transition Radiation Detector version 2
// This version covers the full azimuth.
//
//Begin_Html
/*
*/
//End_Html
//Begin_Html
/*
*/
//End_Html
// --- Name Conventions :
// The mother volume and the support structure
// TRD --> Mother TRD volume (Air)
// UTRS --> The sectors of the detector (Air)
// UTSP --> The aluminum part of the support structure (Al)
// UTII(O) --> The inner parts of the support structure (Air)
// The chambers
// UCI1-6 --> The frame of the inner chambers (C)
// UCO1-6 --> The frame of the outer chambers (C)
// UII1-6 --> The inner part of the inner chambers (Air)
// UIO1-6 --> The inner part of the outer chambers (Air)
// The layers inside a chamber
// UT1I(O) --> Radiator layer (CO2)
// UT2I(O) --> Polyethylene layer (PE)
// UT3I(O) --> Mylar layer (Mylar)
// UXI1-6 --> Xe/C02 layer in the inner chambers (Xe/C02)
// UXO1-6 --> Xe/C02 layer in the outer chambers (Xe/C02)
// UT5I(O) --> Cu layer (pads/sensitive) (Cu)
// UT6I(O) --> Kapton layer (Kapton)
// UT7I(O) --> NOMEX layer (C)
// UT8I(O) --> Readout layer (Al)
// --- Contains geometry information
// --- Number of sectors in the full detector
// --- Number of modules in each sector
// --- z-Coordinates of the TRD-frame
// --- r-Coordinates of the TRD-frame
// --- Thickness of the aluminium of the support frame
// --- Thickness of the interior of the support frame
// --- Thickness of the carbon chamber frame
// --- Thickness and z-position of the PE-layer in the radiator
// --- Thickness and z-position of the radiator
// --- Thickness and z-position of the mylar-layer
// --- Thickness and z-position of the Xe/C02-layer
// --- Thickness and z-position of the Cu-layer (Pads)
// --- Thickness and z-position of the kapton-layer
// --- Thickness and z-position of the NOMEX-layer
// Simple C-layer for the time being
// --- Thickness and z-position of the readout-layer
// --- Parameter for the arrays
// --- Number of different chambers
// --- Number of rotation matrices
AliMC* pMC = AliMC::GetMC();
Float_t xpos, ypos, zpos;
Int_t icham;
Int_t idmat[2];
Float_t widma, widmi;
Float_t lendifc, widdifc, heightc;
Float_t par_ic[3], par_oc[3], par_mo[10], par_sp[4], par_ch[3];
Int_t *idtmed = gAlice->Idtmed();
//************************************************************************
// Definition of Volumes
//************************************************************************
const Int_t ncham = 6; //Number of different chambers
widmi = rmin*TMath::Sin(kPI/nsect);
widma = rmax*TMath::Sin(kPI/nsect);
// --- Some parameter for the chambers
lendifc = (zmax1-zmax2)/nmodul;
heightc = (rmax-rmin)/nmodul;
widdifc = (widma - widmi)/nmodul;
// --- Definition of the Mother volume for the TRD (Air)
par_mo[0] = 0.;
par_mo[1] = 360.;
par_mo[2] = nsect;
par_mo[3] = 2.;
par_mo[4] = -zmax1;
par_mo[5] = rmin;
par_mo[6] = rmax;
par_mo[7] = zmax1;
par_mo[8] = rmin;
par_mo[9] = rmax;
pMC->Gsvolu("TRD ", "PGON", idtmed[1301], par_mo, 10);
// --- Divide the mother volume into sectors
pMC->Gsdvn("UTRS", "TRD ", nsect, 2);
// --- Definition of the aluminum part of the support structure (Al)
par_sp[0] = widmi - inframe/2;
par_sp[1] = widma - inframe/2;
par_sp[2] = zmax1/2;
par_sp[3] = (rmax-rmin)/2;
pMC->Gsvolu("UTSP", "TRD1", idtmed[1300], par_sp, 4);
// --- Definition of the inner part of the support structure (Air)
par_sp[0] = widmi - inframe/2 - alfram1/2;
par_sp[1] = widma - inframe/2 - alfram1/2;
par_sp[2] = zmax1/4 -alfram2/2;
par_sp[3] = (rmax-rmin)/2;
pMC->Gsvolu("UTII", "TRD1", idtmed[1301], par_sp, 4);
pMC->Gsvolu("UTIO", "TRD1", idtmed[1301], par_sp, 4);
// --- Definition of the chambers
char ctagc[5], ctagi[5], ctagx[5];
for (icham = 1; icham <= ncham; ++icham) {
// --- Carbon frame of the inner chambers (C)
par_ch[0] = widmi + (icham-1) * widdifc - (inframe+alfram1)/2;
par_ch[1] = zmax1/4 -alfram2/2;
par_ch[2] = heightc/2.;
sprintf(ctagc,"UCI%1d",icham);
pMC->Gsvolu(ctagc, "BOX ", idtmed[1306], par_ch, 3);
// --- Inner part of the inner chambers (Air)
par_ch[0] -= ccframe;
par_ch[1] -= ccframe;
sprintf(ctagi,"UII%1d",icham);
pMC->Gsvolu(ctagi, "BOX ", idtmed[1301], par_ch, 3);
// --- Carbon frame of the outer chambers (C)
par_ch[0] = widmi + (icham - 1) * widdifc - 2.;
par_ch[1] = (icham - 6) * lendifc / 2. + zmax1/4 -alfram2/2;
par_ch[2] = heightc / 2.;
sprintf(ctagc,"UCO%1d",icham);
pMC->Gsvolu(ctagc, "BOX ", idtmed[1306], par_ch, 3);
// --- Inner part of the outer chambers (Air)
par_ch[0] -= ccframe;
par_ch[1] -= ccframe;
sprintf(ctagi,"UIO%1d",icham);
pMC->Gsvolu(ctagi, "BOX ", idtmed[1301], par_ch, 3);
}
// --- Definition of the layers in each inner chamber
par_ic[0] = -1.;
par_ic[1] = -1.;
// --- Radiator layer
par_ic[2] = rathick/2;;
pMC->Gsvolu("UT1I", "BOX ", idtmed[1311], par_ic, 3);
// --- Polyethylene layer
par_ic[2] = pethick/2;
pMC->Gsvolu("UT2I", "BOX ", idtmed[1302], par_ic, 3);
// --- Mylar layer
par_ic[2] = mythick/2;
pMC->Gsvolu("UT3I", "BOX ", idtmed[1307], par_ic, 3);
// --- Xe/CO2 layer
par_ic[2] = 1.8;
for (icham = 1; icham <= 6; ++icham) {
sprintf(ctagx,"UXI%1d",icham);
pMC->Gsvolu(ctagx, "BOX ", idtmed[1308], par_ic, 3);
}
// --- Cu layer
par_ic[2] = cuthick/2;
pMC->Gsvolu("UT5I", "BOX ", idtmed[1304], par_ic, 3);
// --- Kapton layer
par_ic[2] = kathick/2;
pMC->Gsvolu("UT6I", "BOX ", idtmed[1310], par_ic, 3);
// --- NOMEX layer
par_ic[2] = nothick/2;
pMC->Gsvolu("UT7I", "BOX ", idtmed[1309], par_ic, 3);
// --- Read out layer
par_ic[2] = rothick/2;
pMC->Gsvolu("UT8I", "BOX ", idtmed[1305], par_ic, 3);
// --- Definition of the layers in each outer chamber
par_oc[0] = -1.;
par_oc[1] = -1.;
// --- Radiator layer
par_oc[2] = rathick/2;;
pMC->Gsvolu("UT1O", "BOX ", idtmed[1311], par_oc, 3);
// --- Polyethylene layer
par_oc[2] = pethick/2;
pMC->Gsvolu("UT2O", "BOX ", idtmed[1302], par_oc, 3);
// --- Mylar layer
par_oc[2] = mythick/2;
pMC->Gsvolu("UT3O", "BOX ", idtmed[1307], par_oc, 3);
// --- Xe/CO2 layer
par_oc[2] = xethick/2;
for (icham = 1; icham <= ncham; ++icham) {
sprintf(ctagx,"UXO%1d",icham);
pMC->Gsvolu(ctagx, "BOX ", idtmed[1308], par_oc, 3);
}
// --- Cu layer
par_oc[2] = cuthick/2;
pMC->Gsvolu("UT5O", "BOX ", idtmed[1304], par_oc, 3);
// --- Kapton layer
par_oc[2] = kathick/2;
pMC->Gsvolu("UT6O", "BOX ", idtmed[1310], par_oc, 3);
// --- NOMEX layer
par_oc[2] = nothick/2;
pMC->Gsvolu("UT7O", "BOX ", idtmed[1309], par_oc, 3);
// --- Read out layer
par_oc[2] = rothick/2;
pMC->Gsvolu("UT8O", "BOX ", idtmed[1305], par_oc, 3);
//*************************************************************************
// Positioning of Volumes
//************************************************************************
// --- The rotation matrices
AliMatrix(idmat[0], 90., 90., 180., 0., 90., 0.);
AliMatrix(idmat[1], 90., 90., 0., 0., 90., 0.);
// --- Position of the layers in a chamber
for (icham = 1; icham <= ncham; ++icham) {
// --- The inner chambers
sprintf(ctagi,"UII%1d",icham);
sprintf(ctagx,"UXI%1d",icham);
pMC->Gspos("UT8I", icham, ctagi, 0., 0., rozpos, 0, "ONLY");
pMC->Gspos("UT7I", icham, ctagi, 0., 0., nozpos, 0, "ONLY");
pMC->Gspos("UT6I", icham, ctagi, 0., 0., kazpos, 0, "ONLY");
pMC->Gspos("UT5I", icham, ctagi, 0., 0., cuzpos, 0, "ONLY");
pMC->Gspos(ctagx, 1, ctagi, 0., 0., xezpos, 0, "ONLY");
pMC->Gspos("UT3I", icham, ctagi, 0., 0., myzpos, 0, "ONLY");
pMC->Gspos("UT1I", icham, ctagi, 0., 0., razpos, 0, "ONLY");
// --- The outer chambers
sprintf(ctagi,"UIO%d",icham);
sprintf(ctagx,"UXO%d",icham);
pMC->Gspos("UT8O", icham, ctagi, 0., 0., rozpos, 0, "ONLY");
pMC->Gspos("UT7O", icham, ctagi, 0., 0., nozpos, 0, "ONLY");
pMC->Gspos("UT6O", icham, ctagi, 0., 0., kazpos, 0, "ONLY");
pMC->Gspos("UT5O", icham, ctagi, 0., 0., cuzpos, 0, "ONLY");
pMC->Gspos(ctagx, 1, ctagi, 0., 0., xezpos, 0, "ONLY");
pMC->Gspos("UT3O", icham, ctagi, 0., 0., myzpos, 0, "ONLY");
pMC->Gspos("UT1O", icham, ctagi, 0., 0., razpos, 0, "ONLY");
}
pMC->Gspos("UT2I", 1, "UT1I", 0., 0., 0., 0, "ONLY");
pMC->Gspos("UT2O", 1, "UT1O", 0., 0., 0., 0, "ONLY");
// --- Position of the inner part of the chambers in the carbon-frames
for (icham = 1; icham <= ncham; ++icham) {
// --- The inner chambers
sprintf(ctagi,"UII%1d",icham);
sprintf(ctagc,"UCI%1d",icham);
pMC->Gspos(ctagi, 1, ctagc, 0., 0., 0., 0, "ONLY");
// --- The outer chambers
sprintf(ctagi,"UIO%1d",icham);
sprintf(ctagc,"UCO%1d",icham);
pMC->Gspos(ctagi, 1, ctagc, 0., 0., 0., 0, "ONLY");
}
// --- Position of the chambers in the full TRD-setup
for (icham = 1; icham <= ncham; ++icham) {
// --- The inner chambers
xpos = 0.;
ypos = 0.;
zpos = (icham - .5) * heightc - (rmax-rmin)/2;
sprintf(ctagc,"UCI%1d",icham);
pMC->Gspos(ctagc, 1, "UTII", xpos, ypos, zpos, 0, "ONLY");
// --- The outer chambers
xpos = 0.;
ypos = 0. - (icham - 6) * lendifc / 2.;
zpos = (icham - .5) * heightc - (rmax-rmin)/2;
sprintf(ctagc,"UCO%1d",icham);
pMC->Gspos(ctagc, 1, "UTIO", xpos, ypos, zpos, 0, "ONLY");
}
// --- Position of the inner parts of the support frame
xpos = 0.;
ypos = zmax1/4;
zpos = 0.;
pMC->Gspos("UTIO", 1, "UTSP", xpos,-ypos, zpos, 0, "ONLY");
pMC->Gspos("UTII", 1, "UTSP", xpos, ypos, zpos, 0, "ONLY");
// --- Position of the support frame in the TRD-sectors
xpos = (rmax+rmin)/2;
ypos = 0.;
zpos = zmax1/2;
pMC->Gspos("UTSP", 1, "UTRS", xpos, ypos, zpos, idmat[0], "ONLY");
pMC->Gspos("UTSP", 2, "UTRS", xpos, ypos,-zpos, idmat[1], "ONLY");
// --- Position of TRD mother volume in ALICE experiment
pMC->Gspos("TRD ", 1, "ALIC", 0., 0., 0., 0, "ONLY");
}
//_____________________________________________________________________________
void AliTRDv2::DrawModule()
{
//
// Draw a shaded view of the Transition Radiation Detector version 1
//
AliMC* pMC = AliMC::GetMC();
// Set everything unseen
pMC->Gsatt("*", "seen", -1);
//
// Set ALIC mother transparent
pMC->Gsatt("ALIC","SEEN",0);
//
// Set the volumes visible
pMC->Gsatt("TRD","SEEN",0);
pMC->Gsatt("UTRS","SEEN",0);
pMC->Gsatt("UTSP","SEEN",0);
pMC->Gsatt("UTII","SEEN",0);
pMC->Gsatt("UTIO","SEEN",0);
pMC->Gsatt("UCI1","SEEN",0);
pMC->Gsatt("UII1","SEEN",0);
pMC->Gsatt("UCO1","SEEN",0);
pMC->Gsatt("UIO1","SEEN",0);
pMC->Gsatt("UCI2","SEEN",0);
pMC->Gsatt("UII2","SEEN",0);
pMC->Gsatt("UCO2","SEEN",0);
pMC->Gsatt("UIO2","SEEN",0);
pMC->Gsatt("UCI3","SEEN",0);
pMC->Gsatt("UII3","SEEN",0);
pMC->Gsatt("UCO3","SEEN",0);
pMC->Gsatt("UIO3","SEEN",0);
pMC->Gsatt("UCI4","SEEN",0);
pMC->Gsatt("UII4","SEEN",0);
pMC->Gsatt("UCO4","SEEN",0);
pMC->Gsatt("UIO4","SEEN",0);
pMC->Gsatt("UCI5","SEEN",0);
pMC->Gsatt("UII5","SEEN",0);
pMC->Gsatt("UCO5","SEEN",0);
pMC->Gsatt("UIO5","SEEN",0);
pMC->Gsatt("UCI6","SEEN",0);
pMC->Gsatt("UII6","SEEN",0);
pMC->Gsatt("UCO6","SEEN",0);
pMC->Gsatt("UIO6","SEEN",0);
pMC->Gsatt("UT1I","SEEN",1);
pMC->Gsatt("UXI1","SEEN",1);
pMC->Gsatt("UXI2","SEEN",1);
pMC->Gsatt("UXI3","SEEN",1);
pMC->Gsatt("UXI4","SEEN",1);
pMC->Gsatt("UXI5","SEEN",1);
pMC->Gsatt("UXI6","SEEN",1);
pMC->Gsatt("UT1O","SEEN",1);
pMC->Gsatt("UXO1","SEEN",1);
pMC->Gsatt("UXO2","SEEN",1);
pMC->Gsatt("UXO3","SEEN",1);
pMC->Gsatt("UXO4","SEEN",1);
pMC->Gsatt("UXO5","SEEN",1);
pMC->Gsatt("UXO6","SEEN",1);
//
pMC->Gdopt("hide", "on");
pMC->Gdopt("shad", "on");
pMC->Gsatt("*", "fill", 7);
pMC->SetClipBox(".");
pMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
pMC->DefaultRange();
pMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .021, .021);
pMC->Gdhead(1111, "Transition Radiation Detector Version 2");
pMC->Gdman(18, 4, "MAN");
pMC->Gdopt("hide", "off");
}
//_____________________________________________________________________________
void AliTRDv2::CreateMaterials()
{
//
// Create materials for the Transition Radiation Detector version 2
//
printf("TRD: Slow simulation with fine geometry\n");
AliTRD::CreateMaterials();
}
//_____________________________________________________________________________
void AliTRDv2::Init()
{
//
// Initialise Transition Radiation Detector after geometry has been built
//
AliTRD::Init();
AliMC* pMC = AliMC::GetMC();
fIdSenI1 = pMC->VolId("UXI1");
fIdSenI2 = pMC->VolId("UXI2");
fIdSenI3 = pMC->VolId("UXI3");
fIdSenI4 = pMC->VolId("UXI4");
fIdSenI5 = pMC->VolId("UXI5");
fIdSenI6 = pMC->VolId("UXI6");
fIdSenO1 = pMC->VolId("UXO1");
fIdSenO2 = pMC->VolId("UXO2");
fIdSenO3 = pMC->VolId("UXO3");
fIdSenO4 = pMC->VolId("UXO4");
fIdSenO5 = pMC->VolId("UXO5");
fIdSenO6 = pMC->VolId("UXO6");
}
//_____________________________________________________________________________
void AliTRDv2::StepManager()
{
//
// Called at every step in the Transition Radiation Detector version 2
//
Int_t idSens, icSens;
Int_t iPla, iCha, iSec;
Int_t iOut;
Int_t vol[3];
Int_t iPid;
const Float_t kBig = 1.0E+12;
Float_t random[1];
Float_t charge;
Float_t betaGamma, pp;
Float_t aMass;
Float_t eLos, qTot;
Float_t hits[4];
Float_t mom[4];
Float_t pTot;
TClonesArray &lhits = *fHits;
AliMC* pMC = AliMC::GetMC();
// Ionization energy
// taken from: Ionization Measurements in High Energy Physics, Springer
const Double_t kWion = 23.0E-9;
// Maximum energy for e+ e- g for the step-size calculation
const Float_t kPTotMax = 0.002;
// Plateau value of the energy-loss for electron in xenon
// taken from: Allison + Comb, Ann. Rev. Nucl. Sci. (1980), 30, 253
const Float_t kPlateau = 1.70;
// dN1/dx|min for the gas mixture (90% Xe + 10% CO2)
// taken from: Ionization Measurements in High Energy Physics, Springer
const Float_t kPrim = 43.68;
// Set the maximum step size to a very large number for all
// neutral particles and those outside the driftvolume
pMC->SetMaxStep(kBig);
// Use only charged tracks
if (( pMC->TrackCharge() ) &&
(!pMC->TrackStop() ) &&
(!pMC->TrackDisappear())) {
// Find the sensitive volume
idSens = pMC->CurrentVol(0,icSens);
iPla = 0;
iOut = 0;
if (idSens == fIdSenI1) iPla = 1;
else if (idSens == fIdSenI2) iPla = 2;
else if (idSens == fIdSenI3) iPla = 3;
else if (idSens == fIdSenI4) iPla = 4;
else if (idSens == fIdSenI5) iPla = 5;
else if (idSens == fIdSenI6) iPla = 6;
else if (idSens == fIdSenO1) {
iPla = 1;
iOut = 1; }
else if (idSens == fIdSenO2) {
iPla = 2;
iOut = 1; }
else if (idSens == fIdSenO3) {
iPla = 3;
iOut = 1; }
else if (idSens == fIdSenO4) {
iPla = 4;
iOut = 1; }
else if (idSens == fIdSenO5) {
iPla = 5;
iOut = 1; }
else if (idSens == fIdSenO6) {
iPla = 6;
iOut = 1; }
// Inside a sensitive volume?
if (iPla) {
// Calculate the energy loss
// ((1/E^2.0) distribution for the fluctuations)
pMC->Rndm(random,1);
eLos = Eloss(random[0]);
// The amount of charge created
qTot = (Float_t) ((Int_t) (eLos / kWion) + 1);
// The sector number
pMC->CurrentVolOff(5,0,iSec);
// The chamber number
pMC->CurrentVolOff(4,0,iCha);
if (iOut)
iCha = (iCha - 1) * 3 + 1;
else
iCha = iCha + 1;
vol[0] = iSec;
vol[1] = iCha;
vol[2] = iPla;
pMC->TrackPosition(hits);
hits[3] = qTot;
// Add the hit
new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
pMC->TrackMomentum(mom);
pTot = mom[3];
// New step size for electrons only if momentum is small enough
iPid = pMC->TrackPid();
if ( (iPid > 3) ||
((iPid <= 3) && (pTot < kPTotMax))) {
aMass = pMC->TrackMass();
betaGamma = pTot / aMass;
pp = kPrim * BetheBloch(betaGamma);
// Take charge > 1 into account
charge = pMC->TrackCharge();
if (TMath::Abs(charge) > 1) pp = pp * charge*charge;
}
// Electrons above 20 Mev/c are at the plateau
else {
pp = kPrim * kPlateau;
}
// Calculate the maximum step size for the next tracking step
do
pMC->Rndm(random,1);
while ((random[0] == 1.) || (random[0] == 0.));
pMC->SetMaxStep( - TMath::Log(random[0]) / pp);
}
}
}